Revision 7ff57e98fb78ad94edafbdc7435f2d745e9e6bb5 authored by Fabio M. De Francesco on 23 February 2022, 10:02:52 UTC, committed by Jakub Kicinski on 24 February 2022, 17:09:33 UTC
smc_pnetid_by_table_ib() uses read_lock() and then it calls smc_pnet_apply_ib()
which, in turn, calls mutex_lock(&smc_ib_devices.mutex).

read_lock() disables preemption. Therefore, the code acquires a mutex while in
atomic context and it leads to a SAC bug.

Fix this bug by replacing the rwlock with a mutex.

Reported-and-tested-by: syzbot+4f322a6d84e991c38775@syzkaller.appspotmail.com
Fixes: 64e28b52c7a6 ("net/smc: add pnet table namespace support")
Confirmed-by: Tony Lu <tonylu@linux.alibaba.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Acked-by: Karsten Graul <kgraul@linux.ibm.com>
Link: https://lore.kernel.org/r/20220223100252.22562-1-fmdefrancesco@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent e13ad14
Raw File
max1668.rst
Kernel driver max1668
=====================

Supported chips:

  * Maxim MAX1668, MAX1805 and MAX1989

    Prefix: 'max1668'

    Addresses scanned: I2C 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, 0x4d, 0x4e

    Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX1668-MAX1989.pdf

Author:

    David George <david.george@ska.ac.za>

Description
-----------

This driver implements support for the Maxim MAX1668, MAX1805 and MAX1989
chips.

The three devices are very similar, but the MAX1805 has a reduced feature
set; only two remote temperature inputs vs the four available on the other
two ICs.

The driver is able to distinguish between the devices and creates sysfs
entries as follows:

- MAX1805, MAX1668 and MAX1989:

=============== == ============================================================
temp1_input     ro local (ambient) temperature
temp1_max       rw local temperature maximum threshold for alarm
temp1_max_alarm ro local temperature maximum threshold alarm
temp1_min       rw local temperature minimum threshold for alarm
temp1_min_alarm ro local temperature minimum threshold alarm
temp2_input     ro remote temperature 1
temp2_max       rw remote temperature 1 maximum threshold for alarm
temp2_max_alarm ro remote temperature 1 maximum threshold alarm
temp2_min       rw remote temperature 1 minimum threshold for alarm
temp2_min_alarm ro remote temperature 1 minimum threshold alarm
temp3_input     ro remote temperature 2
temp3_max       rw remote temperature 2 maximum threshold for alarm
temp3_max_alarm ro remote temperature 2 maximum threshold alarm
temp3_min       rw remote temperature 2 minimum threshold for alarm
temp3_min_alarm ro remote temperature 2 minimum threshold alarm
=============== == ============================================================

- MAX1668 and MAX1989 only:

=============== == ============================================================
temp4_input     ro remote temperature 3
temp4_max       rw remote temperature 3 maximum threshold for alarm
temp4_max_alarm ro remote temperature 3 maximum threshold alarm
temp4_min       rw remote temperature 3 minimum threshold for alarm
temp4_min_alarm ro remote temperature 3 minimum threshold alarm
temp5_input     ro remote temperature 4
temp5_max       rw remote temperature 4 maximum threshold for alarm
temp5_max_alarm ro remote temperature 4 maximum threshold alarm
temp5_min       rw remote temperature 4 minimum threshold for alarm
temp5_min_alarm ro remote temperature 4 minimum threshold alarm
=============== == ============================================================

Module Parameters
-----------------

* read_only: int
  Set to non-zero if you wish to prevent write access to alarm thresholds.
back to top