id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
768461517a28d80fe81ea4d5d03a90cd184ea6ad
Analyze and fix the following issue in the Linux kernel code: iio: adc: ti-adc161s626: use DMA-safe memory for spi_read()
Problem Details: Add a DMA-safe buffer and use it for spi_read() instead of a stack memory. All SPI buffers must be DMA-safe. Since we only need up to 3 bytes, we just use a u8[] instead of __be16 and __be32 and change the conversion functions appropriately. Fixes: 4d671b71beef ("iio: adc: ti-adc161s626: add support ...
```diff diff --git a/drivers/iio/adc/ti-adc161s626.c b/drivers/iio/adc/ti-adc161s626.c index 42968d96572b..be1cc2e77862 100644 --- a/drivers/iio/adc/ti-adc161s626.c +++ b/drivers/iio/adc/ti-adc161s626.c @@ -15,6 +15,7 @@ #include <linux/init.h> #include <linux/err.h> #include <linux/spi/spi.h> +#include <linux/unali...
07183aac4a6828e474f00b37c9d795d0d99e18a7
Analyze and fix the following issue in the Linux kernel code: tracing: Fix trace_marker copy link list updates
Problem Details: When the "copy_trace_marker" option is enabled for an instance, anything written into /sys/kernel/tracing/trace_marker is also copied into that instances buffer. When the option is set, that instance's trace_array descriptor is added to the marker_copies link list. This list is protected by RCU, as all...
```diff diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index bb4a62f4b953..a626211ceb9a 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -555,7 +555,7 @@ static bool update_marker_trace(struct trace_array *tr, int enabled) lockdep_assert_held(&event_mutex); if (enabled) { - if (!list_emp...
edca33a56297d5741ccf867669debec116681987
Analyze and fix the following issue in the Linux kernel code: tracing: Fix failure to read user space from system call trace events
Problem Details: The system call trace events call trace_user_fault_read() to read the user space part of some system calls. This is done by grabbing a per-cpu buffer, disabling migration, enabling preemption, calling copy_from_user(), disabling preemption, enabling migration and checking if the task was preempted whil...
```diff diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index ebd996f8710e..bb4a62f4b953 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -6783,6 +6783,23 @@ char *trace_user_fault_read(struct trace_user_buf_info *tinfo, */ do { + /* + * It is possible that something is trying to migra...
24869650dff34a6fc8fd1cc91b2058a72f9abc95
Analyze and fix the following issue in the Linux kernel code: iio: adc: ti-adc161s626: fix buffer read on big-endian
Problem Details: Rework ti_adc_trigger_handler() to properly handle data on big-endian architectures. The scan data format is 16-bit CPU-endian, so we can't cast it to a int * on big-endian and expect it to work. Instead, we introduce a local int variable to read the data into, and then copy it to the buffer. Since th...
```diff diff --git a/drivers/iio/adc/ti-adc161s626.c b/drivers/iio/adc/ti-adc161s626.c index 28aa6b80160c..42968d96572b 100644 --- a/drivers/iio/adc/ti-adc161s626.c +++ b/drivers/iio/adc/ti-adc161s626.c @@ -70,8 +70,6 @@ struct ti_adc_data { u8 read_size; u8 shift; - - u8 buffer[16] __aligned(IIO_DMA_MINALIGN); ...
a6f22e50c7d51aa225c392c62c33f0fae11f734d
Analyze and fix the following issue in the Linux kernel code: tracing: Revert "tracing: Remove pid in task_rename tracing output"
Problem Details: This reverts commit e3f6a42272e028c46695acc83fc7d7c42f2750ad. The commit says that the tracepoint only deals with the current task, however the following case is not current task: comm_write() { p = get_proc_task(inode); if (!p) return -ESRCH; if (same_thread_group(current, p)) ...
```diff diff --git a/include/trace/events/task.h b/include/trace/events/task.h index 4f0759634306..b9a129eb54d9 100644 --- a/include/trace/events/task.h +++ b/include/trace/events/task.h @@ -38,19 +38,22 @@ TRACE_EVENT(task_rename, TP_ARGS(task, comm), TP_STRUCT__entry( + __field( pid_t, pid) __array( char, o...
4a04d13576fd69149b91672b5f1dc62eca272fa5
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Add a test cases for sync_linked_regs regarding zext propagation
Problem Details: Add multiple test cases for linked register tracking with alu32 ops: - Add a test that checks sync_linked_regs() regarding reg->id (the linked target register) for BPF_ADD_CONST32 rather than known_reg->id (the branch register). - Add a test case for linked register tracking that exposes ...
```diff diff --git a/tools/testing/selftests/bpf/progs/verifier_linked_scalars.c b/tools/testing/selftests/bpf/progs/verifier_linked_scalars.c index 7bf7dbfd237d..f4f8a055af8a 100644 --- a/tools/testing/selftests/bpf/progs/verifier_linked_scalars.c +++ b/tools/testing/selftests/bpf/progs/verifier_linked_scalars.c @@ -3...
bc308be380c136800e1e94c6ce49cb53141d6506
Analyze and fix the following issue in the Linux kernel code: bpf: Fix sync_linked_regs regarding BPF_ADD_CONST32 zext propagation
Problem Details: Jenny reported that in sync_linked_regs() the BPF_ADD_CONST32 flag is checked on known_reg (the register narrowed by a conditional branch) instead of reg (the linked target register created by an alu32 operation). Example case with reg: 1. r6 = bpf_get_prandom_u32() 2. r7 = r6 (linked, same id) ...
```diff diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 62377bcb66fd..f108c01ff6d0 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -17415,6 +17415,12 @@ static void sync_linked_regs(struct bpf_verifier_env *env, struct bpf_verifier_s continue; if ((reg->id & ~BPF_ADD_CONST) != ...
0ad1734cc5598d3ddb6126a8960efe85f0f807d7
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Add tests for maybe_fork_scalars() OR vs AND handling
Problem Details: Add three test cases to verifier_bounds.c to verify that maybe_fork_scalars() correctly tracks register values for BPF_OR operations with constant source operands: 1. or_scalar_fork_rejects_oob: After ARSH 63 + OR 8, the pushed path should have dst = 8. With value_size = 8, accessing map_value +...
```diff diff --git a/tools/testing/selftests/bpf/progs/verifier_bounds.c b/tools/testing/selftests/bpf/progs/verifier_bounds.c index e526315c718a..79a328276805 100644 --- a/tools/testing/selftests/bpf/progs/verifier_bounds.c +++ b/tools/testing/selftests/bpf/progs/verifier_bounds.c @@ -2037,4 +2037,98 @@ __naked void s...
c845894ebd6fb43226b3118d6b017942550910c5
Analyze and fix the following issue in the Linux kernel code: bpf: Fix unsound scalar forking in maybe_fork_scalars() for BPF_OR
Problem Details: maybe_fork_scalars() is called for both BPF_AND and BPF_OR when the source operand is a constant. When dst has signed range [-1, 0], it forks the verifier state: the pushed path gets dst = 0, the current path gets dst = -1. For BPF_AND this is correct: 0 & K == 0. For BPF_OR this is wrong: 0 | K =...
```diff diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 5c0e6809024f..62377bcb66fd 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -15999,7 +15999,7 @@ static int maybe_fork_scalars(struct bpf_verifier_env *env, struct bpf_insn *ins else return 0; - branch = push_stack(env, env...
4ac95c65efeaf0c010199b2b2f5f78b06f28dab6
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Add tests for sdiv32/smod32 with INT_MIN dividend
Problem Details: Add tests to verify that signed 32-bit division and modulo operations produce correct results when the dividend is INT_MIN (0x80000000). The bug fixed in the previous commit only affects the BPF interpreter path. When JIT is enabled (the default on most architectures), the native CPU division instruct...
```diff diff --git a/tools/testing/selftests/bpf/progs/verifier_sdiv.c b/tools/testing/selftests/bpf/progs/verifier_sdiv.c index 148d2299e5b4..fd59d57e8e37 100644 --- a/tools/testing/selftests/bpf/progs/verifier_sdiv.c +++ b/tools/testing/selftests/bpf/progs/verifier_sdiv.c @@ -1209,6 +1209,64 @@ __naked void smod32_ri...
c77b30bd1dcb61f66c640ff7d2757816210c7cb0
Analyze and fix the following issue in the Linux kernel code: bpf: Fix undefined behavior in interpreter sdiv/smod for INT_MIN
Problem Details: The BPF interpreter's signed 32-bit division and modulo handlers use the kernel abs() macro on s32 operands. The abs() macro documentation (include/linux/math.h) explicitly states the result is undefined when the input is the type minimum. When DST contains S32_MIN (0x80000000), abs((s32)DST) triggers ...
```diff diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 9e126be33755..7b675a451ec8 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -1757,6 +1757,12 @@ bool bpf_opcode_in_insntable(u8 code) } #ifndef CONFIG_BPF_JIT_ALWAYS_ON +/* Absolute value of s32 without undefined behavior for S32_MIN */ +stat...
6c2128505f61b504c79a20b89596feba61388112
Analyze and fix the following issue in the Linux kernel code: bpf: Fix exception exit lock checking for subprogs
Problem Details: process_bpf_exit_full() passes check_lock = !curframe to check_resource_leak(), which is false in cases when bpf_throw() is called from a static subprog. This makes check_resource_leak() to skip validation of active_rcu_locks, active_preempt_locks, and active_irq_id on exception exits from subprogs. A...
```diff diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index df22bfc572e2..5c0e6809024f 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -20911,7 +20911,8 @@ static int process_bpf_exit_full(struct bpf_verifier_env *env, * state when it exits. */ int err = check_resource_leak(env, e...
88d699da8ab6ead396809006c65d07b13b19907c
Analyze and fix the following issue in the Linux kernel code: iio: amplifiers: fix typo from Curren to Current
Problem Details: Fix incorrect spelling from Curren to Current. Signed-off-by: Shi Hao <i.shihao.999@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
```diff diff --git a/drivers/iio/amplifiers/ada4250.c b/drivers/iio/amplifiers/ada4250.c index 40f396ea9069..71e361af2074 100644 --- a/drivers/iio/amplifiers/ada4250.c +++ b/drivers/iio/amplifiers/ada4250.c @@ -109,7 +109,7 @@ static int ada4250_set_offset_uv(struct iio_dev *indio_dev, /* * Compute Range and Vol...
1011a6bd86bc79dcadab04f3326868e62613484a
Analyze and fix the following issue in the Linux kernel code: iio: cdc: fix spelling mistakes in comments
Problem Details: Fix spelling mistakes in comments. - becaue -> because - reenable -> re-enable - irq's -> IRQs Signed-off-by: Shi Hao <i.shihao.999@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
```diff diff --git a/drivers/iio/cdc/ad7150.c b/drivers/iio/cdc/ad7150.c index 427d32e398b3..8106a6a83561 100644 --- a/drivers/iio/cdc/ad7150.c +++ b/drivers/iio/cdc/ad7150.c @@ -306,7 +306,7 @@ static int ad7150_write_event_config(struct iio_dev *indio_dev, dir); if (ret) goto error_ret; - /* reenable a...
1a18c847c89ce4b301a5870b0feafd931b076005
Analyze and fix the following issue in the Linux kernel code: iio: chemical: rephrase comment and fix a typo
Problem Details: Rephrase the comment and fix a spelling mistake. - insuffient -> insufficient Signed-off-by: Shi Hao <i.shihao.999@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
```diff diff --git a/drivers/iio/chemical/bme680_core.c b/drivers/iio/chemical/bme680_core.c index 70f81c4a96ba..b5b2c8587749 100644 --- a/drivers/iio/chemical/bme680_core.c +++ b/drivers/iio/chemical/bme680_core.c @@ -807,7 +807,7 @@ static int bme680_read_gas(struct bme680_data *data, int *comp_gas_res) adc_gas_res...
96f46405219d9bf62d9fab76e055e3b6059b0bd5
Analyze and fix the following issue in the Linux kernel code: iio: common: fix spelling mistakes in comments
Problem Details: Fix spelling mistakes in comments. - exepects -> expects - fuction -> function - theoritical -> theoretical - appopriate -> appropriate - iio -> IIO Signed-off-by: Shi Hao <i.shihao.999@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
```diff diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c index 82cef4a12442..f34e2bbba2d1 100644 --- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c +++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c @@ -106,7 +106,7 @@ static int cr...
5088fc744837eaba3f7a1c374cf9457a4ddbd87e
Analyze and fix the following issue in the Linux kernel code: iio: test: fix typo from neeeds to needs in comment
Problem Details: Fix incorrect spelling from neeeds to needs. Signed-off-by: Shi Hao <i.shihao.999@gmail.com> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
```diff diff --git a/drivers/iio/test/iio-test-gts.c b/drivers/iio/test/iio-test-gts.c index 11250bc905c9..6ffff85ba853 100644 --- a/drivers/iio/test/iio-test-gts.c +++ b/drivers/iio/test/iio-test-gts.c @@ -20,7 +20,7 @@ * * If yes, then adding a test is probably a good idea but please stop for a * moment and con...
abf88d037b1bbdc76dec4248e09f7a3f71aae832
Analyze and fix the following issue in the Linux kernel code: iio: temp: fix spelling mistakes in comments
Problem Details: Fix spelling mistakes in comments. - catched -> caught - chanel -> channel Signed-off-by: Shi Hao <i.shihao.999@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
```diff diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index 7dd40d69cce6..38e6f8dfd3b8 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -709,7 +709,7 @@ ltc2983_thermocouple_new(const struct fwnode_handle *child, struct ltc2983_data ret = ...
761451473febd7777034720b85ba2bbb2c73ec89
Analyze and fix the following issue in the Linux kernel code: iio: resolver: fix typo from degredation to degradation
Problem Details: Fix incorrect spelling from degredation to degradation and fixed up some missing spaces prior to */ Signed-off-by: Shi Hao <i.shihao.999@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
```diff diff --git a/drivers/iio/resolver/ad2s1210.c b/drivers/iio/resolver/ad2s1210.c index 06d9c784f93e..774728c804c0 100644 --- a/drivers/iio/resolver/ad2s1210.c +++ b/drivers/iio/resolver/ad2s1210.c @@ -896,14 +896,14 @@ static const struct iio_event_spec ad2s1210_monitor_signal_event_spec[] = { .mask_separate =...
22dd6499c1a67fd3fdb73a7b2e57bc90a464987c
Analyze and fix the following issue in the Linux kernel code: iio: proximity: fix typo from currenly to currently
Problem Details: Fix incorrect spelling from currenly to currently. Signed-off-by: Shi Hao <i.shihao.999@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
```diff diff --git a/drivers/iio/proximity/sx9324.c b/drivers/iio/proximity/sx9324.c index c7b2d03c23bc..f61eff39751d 100644 --- a/drivers/iio/proximity/sx9324.c +++ b/drivers/iio/proximity/sx9324.c @@ -821,7 +821,7 @@ static const struct sx_common_reg_default sx9324_default_regs[] = { { SX9324_REG_ADV_CTRL10, 0x00, ...
896b6508acdfa052dfdf91460ee1b2d565d23010
Analyze and fix the following issue in the Linux kernel code: iio: pressure: fix spelling mistakes in comments
Problem Details: Fix several spelling mistakes in comments. - opertion -> operations - transfered -> transferred - usng -> using - externaly -> externally Signed-off-by: Shi Hao <i.shihao.999@gmail.com> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.co...
```diff diff --git a/drivers/iio/pressure/bmp280-spi.c b/drivers/iio/pressure/bmp280-spi.c index 3b90384f17d7..04bf2f5be5b1 100644 --- a/drivers/iio/pressure/bmp280-spi.c +++ b/drivers/iio/pressure/bmp280-spi.c @@ -47,7 +47,7 @@ static int bmp380_regmap_spi_read(void *context, const void *reg, return -EINVAL; /*...
2354338cc8136fd4e77b92807cf5e0ad89c82e3d
Analyze and fix the following issue in the Linux kernel code: iio: magnetometer: fix various spelling mistakes
Problem Details: Fix spelling mistakes in comments. - follwing -> following - atleast -> at least - occured -> occurred - measurment -> measurement - rougly -> roughly Signed-off-by: Shi Hao <i.shihao.999@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
```diff diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c index 68ece700c7ce..817b18257608 100644 --- a/drivers/iio/magnetometer/ak8974.c +++ b/drivers/iio/magnetometer/ak8974.c @@ -577,7 +577,7 @@ static int ak8974_measure_channel(struct ak8974 *ak8974, unsigned long address, /* *...
d5036cd38aef10a59a08c10baf71a92efdd2d485
Analyze and fix the following issue in the Linux kernel code: iio: imu: fix typo from adjustement to adjustment
Problem Details: Fix incorrect spelling in a comment. - adjustement -> adjustment Signed-off-by: Shi Hao <i.shihao.999@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
```diff diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_magn.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_magn.c index 6aee6c989485..47394594d17a 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_magn.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_magn.c @@ -125,7 +125,7 @@ static int inv_magn_init(struct inv_mpu6050_state *st...
0dcaf3db244802283a268bb93b38a7683e476b2a
Analyze and fix the following issue in the Linux kernel code: iio: light: fix several incorrect spellings
Problem Details: Fix spelling mistakes reported by codespell. - sesnor -> sensor - substraction -> subtraction - simulataneous -> simultaneous - proccessed -> processed - coefficents -> coefficients Signed-off-by: Shi Hao <i.shihao.999@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
```diff diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig index ac1408d374c9..eff33e456c70 100644 --- a/drivers/iio/light/Kconfig +++ b/drivers/iio/light/Kconfig @@ -359,7 +359,7 @@ config ROHM_BU27034 select IIO_KFIFO_BUF help Enable support for the ROHM BU27034 ambient light sensor. ROHM BU27...
db0da4b7f688a76951acc38870f71e673f8fcad0
Analyze and fix the following issue in the Linux kernel code: iio: accel: fix typo celcius to Celsius
Problem Details: Fix incorrect spelling in comments - celcius -> Celsius Signed-off-by: Shi Hao <i.shihao.999@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
```diff diff --git a/drivers/iio/accel/adis16201.c b/drivers/iio/accel/adis16201.c index 5127e58eebc7..ba0f97944c6d 100644 --- a/drivers/iio/accel/adis16201.c +++ b/drivers/iio/accel/adis16201.c @@ -147,7 +147,7 @@ static int adis16201_read_raw(struct iio_dev *indio_dev, /* * The raw ADC value is 1278 when the t...
7e226f036a71c032cd1eb985dd02bc8314e69adf
Analyze and fix the following issue in the Linux kernel code: sched_ext: Documentation: Document events sysfs file and module parameters
Problem Details: Two categories of sched_ext diagnostics are currently undocumented: 1. Per-scheduler events sysfs file Each active BPF scheduler exposes a set of diagnostic counters at /sys/kernel/sched_ext/<name>/events. These counters are defined (with detailed comments) in kernel/sched/ext_internal.h but...
```diff diff --git a/Documentation/scheduler/sched-ext.rst b/Documentation/scheduler/sched-ext.rst index f4f7d8f4f9e4..9e4dbabc03c0 100644 --- a/Documentation/scheduler/sched-ext.rst +++ b/Documentation/scheduler/sched-ext.rst @@ -93,6 +93,55 @@ scheduler has been loaded): # cat /sys/kernel/sched_ext/enable_seq ...
66ab53c286989634acaa2c4a5703c0f647cb9aa3
Analyze and fix the following issue in the Linux kernel code: iio: adc: aspeed: Replace mdelay() with fsleep() for ADC stabilization delay
Problem Details: The ADC stabilization delays in compensation mode and battery sensing mode do not require atomic context. Using mdelay() here results in unnecessary busy waiting. Replace mdelay(1) with fsleep(1000) to allow the scheduler to run other tasks while waiting for the ADC to stabilize. Also fix a minor typ...
```diff diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c index 3ff24474f394..a1a6296d3003 100644 --- a/drivers/iio/adc/aspeed_adc.c +++ b/drivers/iio/adc/aspeed_adc.c @@ -259,7 +259,7 @@ static int aspeed_adc_compensation(struct iio_dev *indio_dev) * After enable compensating sensing mode nee...
cbf8db23fc58db8d516ebc7aa57c4563f36532b9
Analyze and fix the following issue in the Linux kernel code: counter: sysfs: remove double return in counter_sysfs_attr_add()
Problem Details: sysfs attribute creation for counter extensions has been consolidated into a single function, counter_sysfs_exts_add(). Inside counter_sysfs_attr_add(), although the code was changed to return the result of counter_sysfs_exts_add(), an unreachable return 0; statement was left at the end of the functio...
```diff diff --git a/drivers/counter/counter-sysfs.c b/drivers/counter/counter-sysfs.c index 42c523343d32..ed85da907982 100644 --- a/drivers/counter/counter-sysfs.c +++ b/drivers/counter/counter-sysfs.c @@ -1101,8 +1101,6 @@ static int counter_sysfs_attr_add(struct counter_device *const counter, /* Add device extensi...
ab4a4043db1fcc4fd4c5745c5be8caf053502e29
Analyze and fix the following issue in the Linux kernel code: PCI: mediatek: Fix possible truncation in mtk_pcie_parse_port()
Problem Details: As reported by the W=1 warning below, content of the 'name' variable might get truncated with the existing size of 10 bytes. Though it is not practically possible to exceed the 10 bytes size, increase it to 20 to silence the warning for a clean W=1 build: $ make W=1 drivers/pci/controller/pcie-media...
```diff diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c index 5defa5cc4c2b..75722524fe74 100644 --- a/drivers/pci/controller/pcie-mediatek.c +++ b/drivers/pci/controller/pcie-mediatek.c @@ -953,7 +953,7 @@ static int mtk_pcie_parse_port(struct mtk_pcie *pcie, struct mtk_pc...
d1895c15fc7d90a615bc8c455feb02acaf08ef1e
Analyze and fix the following issue in the Linux kernel code: x86/um: fix vDSO installation
Problem Details: The generic vDSO installation logic used by 'make vdso_install' requires that $(vdso-install-y) is defined by the top-level architecture Makefile and that it contains a path relative to the root of the tree. For UML neither of these is satisfied. Move the definition of $(vdso-install-y) to a place whi...
```diff diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um index c86cbd9cbba3..19c13afa474e 100644 --- a/arch/x86/Makefile.um +++ b/arch/x86/Makefile.um @@ -60,4 +60,6 @@ ELF_FORMAT := elf64-x86-64 LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib64 LINK-y += -m64 +vdso-install-y += arch/x86/um/vdso/vdso....
92d5c5c04eaa61f01c5b99bea9d639f0bd008036
Analyze and fix the following issue in the Linux kernel code: um: Remove CONFIG_FRAME_WARN from x86_64_defconfig
Problem Details: The CONFIG_FRAME_WARN=1024 setting in x86_64_defconfig originates from arch/um/defconfig, which was split into i386_defconfig and x86_64_defconfig by commit e40f04d040c6 ("arch/um: make it work with defconfig and x86_64"). Currently, it's even smaller than the default on 32bit (i.e., 1280). It's no lon...
```diff diff --git a/arch/um/configs/x86_64_defconfig b/arch/um/configs/x86_64_defconfig index cf309c5406a2..af6ff784e2d3 100644 --- a/arch/um/configs/x86_64_defconfig +++ b/arch/um/configs/x86_64_defconfig @@ -60,5 +60,4 @@ CONFIG_PROC_KCORE=y CONFIG_TMPFS=y CONFIG_NLS=y CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y ...
cd4126d48f7f61928c18498629ca19a0f846d0c4
Analyze and fix the following issue in the Linux kernel code: um: Fix pte_read() and pte_exec() for kernel mappings
Problem Details: The pte_read() and pte_exec() helpers are only used during the TLB sync to determine the read/exec permissions for mmap. However, for kernel mappings, they will always return 0. This leads to kern_map() having to unconditionally set the exec flag to 1 and the read flag unexpectedly always being 0. Remo...
```diff diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h index 3b42b0f45bf6..e156ef6f4fdb 100644 --- a/arch/um/include/asm/pgtable.h +++ b/arch/um/include/asm/pgtable.h @@ -121,13 +121,12 @@ static inline int pte_none(pte_t pte) */ static inline int pte_read(pte_t pte) { - return((pte_get_...
102331b66bcaf1f41f50b9c4cd5c36e46bafa9f3
Analyze and fix the following issue in the Linux kernel code: um: Fix potential race condition in TLB sync
Problem Details: During the TLB sync, we need to traverse and modify the page table, so we should hold the page table lock. Since full SMP support for threads within the same process is still missing, let's disable the split page table lock for simplicity. Fixes: 1e4ee5135d81 ("um: Add initial SMP support") Signed-off...
```diff diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c index 39608cccf2c6..5386ab2d0da5 100644 --- a/arch/um/kernel/tlb.c +++ b/arch/um/kernel/tlb.c @@ -165,6 +165,7 @@ int um_tlb_sync(struct mm_struct *mm) unsigned long addr, next; int ret = 0; + guard(spinlock_irqsave)(&mm->page_table_lock); guard(s...
d46dfb369a4627d90efc2c2ffbe29e38e3e74286
Analyze and fix the following issue in the Linux kernel code: um: avoid struct sigcontext redefinition with musl
Problem Details: mcontext.c includes both <sys/ucontext.h> and <asm/sigcontext.h>. With musl libc, this causes a struct sigcontext redefinition error: <sys/ucontext.h> pulls in musl's <bits/signal.h>, which defines struct sigcontext directly. The kernel's <asm/sigcontext.h> then provides a second, conflicting d...
```diff diff --git a/arch/x86/um/os-Linux/mcontext.c b/arch/x86/um/os-Linux/mcontext.c index a21403df6663..b1580df80b3f 100644 --- a/arch/x86/um/os-Linux/mcontext.c +++ b/arch/x86/um/os-Linux/mcontext.c @@ -4,7 +4,13 @@ #include <linux/string.h> #include <sys/ucontext.h> #include <asm/ptrace.h> +/* + * musl defines ...
4076f7329832074196e050def49d22265fce2021
Analyze and fix the following issue in the Linux kernel code: um: fix address-of CMSG_DATA() rvalue in stub
Problem Details: The UML stub takes the address of CMSG_DATA(fd_msg): fd_map = (void *)&CMSG_DATA(fd_msg); CMSG_DATA() is specified by POSIX to return unsigned char *. Taking its address is semantically wrong -- the intent is to get a pointer to the control message data, which is exactly what CMSG_DATA() already...
```diff diff --git a/arch/um/kernel/skas/stub.c b/arch/um/kernel/skas/stub.c index 67cab46a602c..e09216a20cb5 100644 --- a/arch/um/kernel/skas/stub.c +++ b/arch/um/kernel/skas/stub.c @@ -146,7 +146,7 @@ restart_wait: /* Receive the FDs */ num_fds = 0; fd_msg = msghdr.msg_control; - fd_map = (void *)&CMSG_DATA...
431400d49cac4bac944fc2d989921003314667ae
Analyze and fix the following issue in the Linux kernel code: openrisc: mm: Fix section mismatch between map_page and __set_fixmap
Problem Details: This warning was reported by the kernel test robot: WARNING: modpost: vmlinux: section mismatch in reference: __set_fixmap+0x84 (section: .text.unlikely) -> map_page.isra.0 (section: .init.text) With commit 4735037b5d9b ("openrisc: Add text patching API support") the __set_fixmap function was moved...
```diff diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c index 78fb0734cdbc..50aee0ea18b7 100644 --- a/arch/openrisc/mm/init.c +++ b/arch/openrisc/mm/init.c @@ -196,7 +196,7 @@ void __init mem_init(void) return; } -static int __init map_page(unsigned long va, phys_addr_t pa, pgprot_t prot) +static in...
39f4b29d9e7359d8a5a4d176f09623ad963d4d68
Analyze and fix the following issue in the Linux kernel code: drm/i915/wm: Include .min_ddb_alloc_uv in the wm dumps
Problem Details: We include the Y/RGB .min_ddb_alloc in the wm state change dumps. Do the same for .min_ddb_alloc_uv, on the platforms where it is used. Also adjust the whitespace in the other debug prints to keep the values for each wm level lined up across all the lines. Signed-off-by: Ville Syrjälä <ville.syrjala@...
```diff diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c index e9cfbb7c9a77..d45b3bcc6ef0 100644 --- a/drivers/gpu/drm/i915/display/skl_watermark.c +++ b/drivers/gpu/drm/i915/display/skl_watermark.c @@ -2624,7 +2624,7 @@ skl_print_plane_wm_changes(struct intel_pla...
2ef3bac16fb5e9eee4fb1d722578a79b751ea58a
Analyze and fix the following issue in the Linux kernel code: crypto: krb5enc - fix sleepable flag handling in encrypt dispatch
Problem Details: krb5enc_encrypt_ahash_done() continues encryption from an ahash completion callback by calling krb5enc_dispatch_encrypt(). That helper takes a flags argument for this continuation path, but it ignored that argument and reused aead_request_flags(req) when setting up the skcipher subrequest callback. Th...
```diff diff --git a/crypto/krb5enc.c b/crypto/krb5enc.c index a1de55994d92..1bfe8370cf94 100644 --- a/crypto/krb5enc.c +++ b/crypto/krb5enc.c @@ -154,7 +154,7 @@ static int krb5enc_dispatch_encrypt(struct aead_request *req, dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); skcipher_request_set_tfm...
e0ce97f781c78b717b00493630a9e34caf04f79b
Analyze and fix the following issue in the Linux kernel code: crypto: simd - reject compat registrations without __ prefixes
Problem Details: simd_register_skciphers_compat() and simd_register_aeads_compat() derive the wrapper algorithm names by stripping the __ prefix from the internal algorithm names. Currently they only WARN if cra_name or cra_driver_name lacks that prefix, but they still continue and unconditionally add 2 to both string...
```diff diff --git a/crypto/simd.c b/crypto/simd.c index f71c4a334c7d..4e6f437e9e77 100644 --- a/crypto/simd.c +++ b/crypto/simd.c @@ -214,13 +214,17 @@ int simd_register_skciphers_compat(struct skcipher_alg *algs, int count, const char *basename; struct simd_skcipher_alg *simd; + for (i = 0; i < count; i++) { + ...
017ecd04985573eeeb0745fa2c23896fb22ee0cc
Analyze and fix the following issue in the Linux kernel code: drm/i915: Unlink NV12 planes earlier
Problem Details: unlink_nv12_plane() will clobber parts of the plane state potentially already set up by plane_atomic_check(), so we must make sure not to call the two in the wrong order. The problem happens when a plane previously selected as a Y plane is now configured as a normal plane by user space. plane_atomic_ch...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_plane.c b/drivers/gpu/drm/i915/display/intel_plane.c index e06a0618b4c6..076b9b356481 100644 --- a/drivers/gpu/drm/i915/display/intel_plane.c +++ b/drivers/gpu/drm/i915/display/intel_plane.c @@ -436,11 +436,16 @@ void intel_plane_copy_hw_state(struct intel_plane_s...
caf6144053b4e1c815aa56afb54745a176f999df
Analyze and fix the following issue in the Linux kernel code: fbdev: matroxfb: Mark variable with __maybe_unused to avoid W=1 build break
Problem Details: Clang is not happy about set but unused variable: drivers/video/fbdev/matrox/g450_pll.c:412:18: error: variable 'mnp' set but not used 412 | unsigned int mnp; | ^ 1 error generated. Since the commit 7b987887f97b ("video: fbdev: matroxfb: remove dead code and set...
```diff diff --git a/drivers/video/fbdev/matrox/g450_pll.c b/drivers/video/fbdev/matrox/g450_pll.c index e2c1478aa47f..6a08f78cd1ac 100644 --- a/drivers/video/fbdev/matrox/g450_pll.c +++ b/drivers/video/fbdev/matrox/g450_pll.c @@ -409,7 +409,7 @@ static int __g450_setclk(struct matrox_fb_info *minfo, unsigned int fout,...
c3fd16c3b98ed726294feab2f94f876290bf7b61
Analyze and fix the following issue in the Linux kernel code: virt: tdx-guest: Fix handling of host controlled 'quote' buffer length
Problem Details: Validate host controlled value `quote_buf->out_len` that determines how many bytes of the quote are copied out to guest userspace. In TDX environments with remote attestation, quotes are not considered private, and can be forwarded to an attestation server. Catch scenarios where the host specifies a r...
```diff diff --git a/drivers/virt/coco/tdx-guest/tdx-guest.c b/drivers/virt/coco/tdx-guest/tdx-guest.c index 4252b147593a..7cee97559ba2 100644 --- a/drivers/virt/coco/tdx-guest/tdx-guest.c +++ b/drivers/virt/coco/tdx-guest/tdx-guest.c @@ -171,6 +171,8 @@ static void tdx_mr_deinit(const struct attribute_group *mr_grp) ...
a8f5c98517c7c89947024f79e5854e6b09766b79
Analyze and fix the following issue in the Linux kernel code: soc: hisilicon: kunpeng_hccs: Remove unused input parameter
Problem Details: The 'hdev' parameter of hccs_create_hccs_dir() is unused. Remove it to fix the compiler warning. Signed-off-by: Huisong Li <lihuisong@huawei.com> Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
```diff diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c index d6ff7de63836..0cc2953d59a5 100644 --- a/drivers/soc/hisilicon/kunpeng_hccs.c +++ b/drivers/soc/hisilicon/kunpeng_hccs.c @@ -1621,8 +1621,7 @@ static void hccs_remove_topo_dirs(struct hccs_dev *hdev) hccs_remove_misc...
3caf4aa0d515080533373f4b75786d295f64e806
Analyze and fix the following issue in the Linux kernel code: soc: hisilicon: kunpeng_hccs: Fix discard ‘const’ qualifier compiling warning
Problem Details: The link_fsm_map has ‘const’ qualifier, but the 'str' pointer in link_fsm_map is discarded. So add 'const' for this pointer to fix the compiling warning. Signed-off-by: Huisong Li <lihuisong@huawei.com> Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
```diff diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c index 2af3bfda313e..d6ff7de63836 100644 --- a/drivers/soc/hisilicon/kunpeng_hccs.c +++ b/drivers/soc/hisilicon/kunpeng_hccs.c @@ -961,7 +961,7 @@ static ssize_t link_fsm_show(struct kobject *kobj, struct hccs_link_status ...
1af997cad473d505248df6d9577183bb91f69670
Analyze and fix the following issue in the Linux kernel code: arm64: dts: hisilicon: hi3798cv200: Add missing dma-ranges
Problem Details: Reboot starts failing on Poplar since commit 8424ecdde7df ("arm64: mm: Set ZONE_DMA size based on devicetree's dma-ranges"), which effectively changes zone_dma_bits from 30 to 32 for arm64 platforms that do not properly define dma-ranges in device tree. It's unclear how Poplar reboot gets broken by th...
```diff diff --git a/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi b/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi index f6bc001c3832..2f4ad5da5e33 100644 --- a/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi +++ b/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi @@ -122,6 +122,7 @@ #address-cells = <1>; #size-cel...
c1f2b0f2b5e37b2c27540a175aea2755a3799433
Analyze and fix the following issue in the Linux kernel code: arm64: dts: hisilicon: poplar: Correct PCIe reset GPIO polarity
Problem Details: The PCIe reset GPIO on Poplar is actually active low. The active high worked before because kernel driver didn't respect the setting from DT. This is changed since commit 1d26a55fbeb9 ("PCI: histb: Switch to using gpiod API"), and thus PCIe on Poplar got brken since then. Fix the problem by correctin...
```diff diff --git a/arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dts b/arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dts index 7d370dac4c85..579d55daa7d0 100644 --- a/arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dts +++ b/arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dts @@ -179,7 +179,7 @@ }; &pcie ...
5754a1c9f9b6e298791c4bb34263f37dfe93ee35
Analyze and fix the following issue in the Linux kernel code: tc-testing: add a test case for ETS offload
Problem Details: While reviewing the fix for unintentional u32 overflows in ets offload code, Jamal said: [...] > otherwise a tdc test should cover it fine (when you get to the > netdevsim change perhaps) Extend tdc to allow setting hw-tc-offload via ethtool, and add a test case to reproduce the division by zero ...
```diff diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ets.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ets.json index a5d94cdec605..ee09e6d6fdf3 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ets.json +++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ets.json @@ -9...
53edd8309570517137d58e3644976843b817179c
Analyze and fix the following issue in the Linux kernel code: net: netdevsim: correct typo in new_device_store error message
Problem Details: Fix the format hint by replacing "unit" with "uint" in the pr_err() string. Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com> Reviewed-by: Joe Damato <joe@dama.to> Link: https://patch.msgid.link/20260319060812.495488-1-alok.a.tiwari@oracle.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
```diff diff --git a/drivers/net/netdevsim/bus.c b/drivers/net/netdevsim/bus.c index f85b1c261dfb..41483e371f05 100644 --- a/drivers/net/netdevsim/bus.c +++ b/drivers/net/netdevsim/bus.c @@ -177,7 +177,7 @@ new_device_store(const struct bus_type *bus, const char *buf, size_t count) } break; default: - pr_err("...
27dfe9030acbc601c260b42ecdbb4e5858a97b53
Analyze and fix the following issue in the Linux kernel code: net: bcmasp: fix double disable of clk
Problem Details: Switch to devm_clk_get_optional() so we can manage the clock ourselves. We dynamically control the clocks depending on the state of the interface for power savings. The default state is clock disabled, so unbinding the driver causes a double disable. Fixes: 490cb412007d ("net: bcmasp: Add support for ...
```diff diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c index 2034a1593db7..972474893a6b 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c @@ -1249,7 +1249,7 @@ static int bcmasp_probe(struct platform_device ...
cbfa5be2bf64511d49b854a0f9fd6d0b5118621f
Analyze and fix the following issue in the Linux kernel code: net: bcmasp: fix double free of WoL irq
Problem Details: We do not need to free wol_irq since it was instantiated with devm_request_irq(). So devres will free for us. Fixes: a2f0751206b0 ("net: bcmasp: Add support for WoL magic packet") Signed-off-by: Justin Chen <justin.chen@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: ...
```diff diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c index aa6d8606849f..2034a1593db7 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c @@ -1152,12 +1152,6 @@ void bcmasp_enable_wol(struct bcmasp_intf *int...
ee00a12593ffb69db4dd1a1c00ecb0253376874a
Analyze and fix the following issue in the Linux kernel code: rtnetlink: count IFLA_INFO_SLAVE_KIND in if_nlmsg_size
Problem Details: rtnl_link_get_slave_info_data_size counts IFLA_INFO_SLAVE_DATA, but rtnl_link_slave_info_fill adds both IFLA_INFO_SLAVE_DATA and IFLA_INFO_SLAVE_KIND. Fixes: ba7d49b1f0f8 ("rtnetlink: provide api for getting and setting slave info") Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Sabrina Dubr...
```diff diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 0fe279432d82..4a2278614250 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -707,11 +707,14 @@ static size_t rtnl_link_get_slave_info_data_size(const struct net_device *dev) goto out; ops = master_dev->rtnl_link_ops; - if (!ops...
52501989c76206462d9b11a8485beef40ef41821
Analyze and fix the following issue in the Linux kernel code: rtnetlink: count IFLA_PARENT_DEV_{NAME,BUS_NAME} in if_nlmsg_size
Problem Details: Commit 00e77ed8e64d ("rtnetlink: add IFLA_PARENT_[DEV|DEV_BUS]_NAME") added those attributes to rtnl_fill_ifinfo, but forgot to extend if_nlmsg_size. Fixes: 00e77ed8e64d ("rtnetlink: add IFLA_PARENT_[DEV|DEV_BUS]_NAME") Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Link: https://patch.msgid.link...
```diff diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index dad4b1054955..0fe279432d82 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -1267,6 +1267,21 @@ static size_t rtnl_dpll_pin_size(const struct net_device *dev) return size; } +static size_t rtnl_dev_parent_size(const struct net_de...
24dd586bb4cbba1889a50abe74143817a095c1c9
Analyze and fix the following issue in the Linux kernel code: net/smc: fix double-free of smc_spd_priv when tee() duplicates splice pipe buffer
Problem Details: smc_rx_splice() allocates one smc_spd_priv per pipe_buffer and stores the pointer in pipe_buffer.private. The pipe_buf_operations for these buffers used .get = generic_pipe_buf_get, which only increments the page reference count when tee(2) duplicates a pipe buffer. The smc_spd_priv pointer itself wa...
```diff diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c index d833e36f7fd4..c1d9b923938d 100644 --- a/net/smc/smc_rx.c +++ b/net/smc/smc_rx.c @@ -135,9 +135,16 @@ out: sock_put(sk); } +static bool smc_rx_pipe_buf_get(struct pipe_inode_info *pipe, + struct pipe_buffer *buf) +{ + /* smc_spd_priv in buf->private ...
e783e40fb689381caca31e03d28c39e10c82e722
Analyze and fix the following issue in the Linux kernel code: net: lan743x: fix SGMII detection on PCI1xxxx B0+ during warm reset
Problem Details: A warm reset on boards using an EEPROM-only strap configuration (where no MAC address is set in the image) can cause the driver to incorrectly revert to RGMII mode. This occurs because the ENET_CONFIG_LOAD_STARTED bit may not persist or behave as expected. Update pci11x1x_strap_get_status() to use rev...
```diff diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c index a3845edf0e48..ff48012c8046 100644 --- a/drivers/net/ethernet/microchip/lan743x_main.c +++ b/drivers/net/ethernet/microchip/lan743x_main.c @@ -28,6 +28,12 @@ #define RFE_RD_FIFO_TH_3_DWORDS 0x3 +...
546b68ac893595877ffbd7751e5c55fd1c43ede6
Analyze and fix the following issue in the Linux kernel code: openvswitch: validate MPLS set/set_masked payload length
Problem Details: validate_set() accepted OVS_KEY_ATTR_MPLS as variable-sized payload for SET/SET_MASKED actions. In action handling, OVS expects fixed-size MPLS key data (struct ovs_key_mpls). Use the already normalized key_len (masked case included) and reject non-matching MPLS action key sizes. Reject invalid MPLS ...
```diff diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c index 67fbf6e48a30..13052408a132 100644 --- a/net/openvswitch/flow_netlink.c +++ b/net/openvswitch/flow_netlink.c @@ -2953,6 +2953,8 @@ static int validate_set(const struct nlattr *a, case OVS_KEY_ATTR_MPLS: if (!eth_p_mpls(eth_ty...
6931d21f87bc6d657f145798fad0bf077b82486c
Analyze and fix the following issue in the Linux kernel code: openvswitch: defer tunnel netdev_put to RCU release
Problem Details: ovs_netdev_tunnel_destroy() may run after NETDEV_UNREGISTER already detached the device. Dropping the netdev reference in destroy can race with concurrent readers that still observe vport->dev. Do not release vport->dev in ovs_netdev_tunnel_destroy(). Instead, let vport_netdev_free() drop the referenc...
```diff diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c index c688dee96503..12055af832dc 100644 --- a/net/openvswitch/vport-netdev.c +++ b/net/openvswitch/vport-netdev.c @@ -196,8 +196,6 @@ void ovs_netdev_tunnel_destroy(struct vport *vport) */ if (vport->dev->reg_state == NETREG_REGIS...
0c3893d37892f332b595906710bf53bbd9c7c572
Analyze and fix the following issue in the Linux kernel code: selftests/vsock: fix vsock_test path shadowing in nested VMs
Problem Details: The /root mount introduced for nested VM support shadows any host paths under /root. This breaks systems where the outer VM runs as root and the vsock_test binary path is something like: /root/linux/tools/testing/selftests/vsock/vsock_test Fix this by copying vsock_test into the temporary home direct...
```diff diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index c8d5cb66bf5f..d97913a6bdc7 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -393,6 +393,7 @@ handle_build() { setup_home() { mkdir -p "$(dirname "${SSH_KEY...
865926e26e05be52ff311883619b9198298698df
Analyze and fix the following issue in the Linux kernel code: selftests/vsock: fix vmtest.sh for read-only nested VM runners
Problem Details: When running vmtest.sh inside a nested VM, there occurs a problem with stacking two sets of virtiofs/overlay layers (the first set from the outer VM and the second set from the inner VM). The virtme init scripts (sshd, udhcpd, etc...) fail to execute basic programs (e.g., /bin/cat) and load library dep...
```diff diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index 9eacb753238a..c8d5cb66bf5f 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -42,6 +42,8 @@ readonly KERNEL_CMDLINE="\ virtme.ssh virtme_ssh_channel=tcp virt...
eb2415854f3ba7d95c4f30d259f6f598ab604616
Analyze and fix the following issue in the Linux kernel code: net: phylink: add debug for phy_config_inband()
Problem Details: Add debug for the phy_config_inband() call so we can see which inband modes are being configured at the PHY. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Link: https://patch.msgid.link/E1w2mFk-0000000DXW2-2PR9@rmk-PC.a...
```diff diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index aba1b35c7cd7..f80cd13c8e32 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1341,6 +1341,13 @@ static void phylink_major_config(struct phylink *pl, bool restart, } if (pl->phydev && pl->phy_ib_mode) { + phy...
f44218cd5e6a3d98b137344b808ee154117ce765
Analyze and fix the following issue in the Linux kernel code: net: airoha: Reset PPE cpu port configuration in airoha_ppe_hw_init()
Problem Details: Before this patch, the PPE cpu port configuration used for a specific GDM device was set just running ndo_init() callback during the device initialization. The selected PPE cpu port configuration depends on the QDMA block assigned to the GDM port. The QDMA block is selected according to the GDM port LA...
```diff diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c index db9d9531711e..961325da833b 100644 --- a/drivers/net/ethernet/airoha/airoha_eth.c +++ b/drivers/net/ethernet/airoha/airoha_eth.c @@ -1755,8 +1755,7 @@ static int airoha_dev_init(struct net_device *dev) { str...
6b5f49176a08e01deb7b1435658152237bb44173
Analyze and fix the following issue in the Linux kernel code: net: dsa: mxl862xx: don't read out-of-bounds
Problem Details: The write loop in mxl862xx_api_wrap() computes the word count as (size + 1) / 2, rounding up for odd-sized structs. On the last iteration of an odd-sized buffer it reads a full __le16 from data[i], accessing one byte past the end of the caller's struct. KASAN catches this as a stack-out-of-bounds read...
```diff diff --git a/drivers/net/dsa/mxl862xx/mxl862xx-host.c b/drivers/net/dsa/mxl862xx/mxl862xx-host.c index 8c55497a0ce8..4eefd2a759a7 100644 --- a/drivers/net/dsa/mxl862xx/mxl862xx-host.c +++ b/drivers/net/dsa/mxl862xx/mxl862xx-host.c @@ -175,8 +175,14 @@ int mxl862xx_api_wrap(struct mxl862xx_priv *priv, u16 cmd, v...
baa35a698cea26930679a20a7550bbb4c8319725
Analyze and fix the following issue in the Linux kernel code: net: macb: Protect access to net_device::ip_ptr with RCU lock
Problem Details: Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This...
```diff diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 1b95226ae696..944aab71795c 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -5776,9 +5776,9 @@ static int __maybe_unused macb_suspend(struct device *dev) ...
317e49358ebbf6390fa439ef3c142f9239dd25fb
Analyze and fix the following issue in the Linux kernel code: net: macb: Move devm_{free,request}_irq() out of spin lock area
Problem Details: The devm_free_irq() and devm_request_irq() functions should not be executed in an atomic context. During device suspend, all userspace processes and most kernel threads are frozen. Additionally, we flush all tx/rx status, disable all macb interrupts, and halt rx operations. Therefore, it is safe to sp...
```diff diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index c16ac9c76aa3..1b95226ae696 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -5835,6 +5835,7 @@ static int __maybe_unused macb_suspend(struct device *dev) ...
fc0c2f0cba01eb945dc68f57afe06fd4746a7aae
Analyze and fix the following issue in the Linux kernel code: ARM: dts: bcm63138: Fix DMA IRQ
Problem Details: INTERRUPT_ID_PL081 is (ISR_TABLE_3_OFFSET + 23) which is 96+3 = 119, convert back to SPI interrupt 119-32 = 87. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: William Zhang <william.zhang@broadcom.com> Link: https://lore.kernel.org/r/20260218-bcmbca-i2c-dts-v2-2-5373ef82c50c@kern...
```diff diff --git a/arch/arm/boot/dts/broadcom/bcm63138.dtsi b/arch/arm/boot/dts/broadcom/bcm63138.dtsi index 4ec568586b14..8e41c7130406 100644 --- a/arch/arm/boot/dts/broadcom/bcm63138.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm63138.dtsi @@ -317,7 +317,7 @@ // The magic B105F00D info is missing arm,primecell-p...
e2de08086d72dcd7b4c26cda201cb98b518f62c4
Analyze and fix the following issue in the Linux kernel code: ARM: dts: bcm6878: Fix PL081 DMA block IRQ
Problem Details: SPI_TABLE_OFFSET_2 is 96 in 6878. 96+30 = 126. Convert back dtsi SPI interrupt 126 - 32 = 94 Reviewed-by: William Zhang <william.zhang@broadcom.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20260218-bcmbca-i2c-dts-v2-1-5373ef82c50c@kernel.org Signed-off-...
```diff diff --git a/arch/arm/boot/dts/broadcom/bcm6878.dtsi b/arch/arm/boot/dts/broadcom/bcm6878.dtsi index dd837bf69390..5a37bfd7f53f 100644 --- a/arch/arm/boot/dts/broadcom/bcm6878.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm6878.dtsi @@ -244,7 +244,7 @@ // The magic B105F00D info is missing arm,primecell-perip...
e7bae9a7a5e1251ab414291f4e9304d702bb9221
Analyze and fix the following issue in the Linux kernel code: hwmon: (max6639) Fix pulses-per-revolution implementation
Problem Details: The valid range for the pulses-per-revolution devicetree property is 1..4. The current code checks for a range of 1..5. Fix it. Declare the variable used to retrieve pulses per revolution from devicetree as u32 (unsigned) to match the of_property_read_u32() API. The current code uses a postfix decrem...
```diff diff --git a/drivers/hwmon/max6639.c b/drivers/hwmon/max6639.c index 9a3c515efe2e..163d31f17bd4 100644 --- a/drivers/hwmon/max6639.c +++ b/drivers/hwmon/max6639.c @@ -232,7 +232,7 @@ static int max6639_read_fan(struct device *dev, u32 attr, int channel, static int max6639_set_ppr(struct max6639_data *data, int...
a261f6dff3c1653c19c065c3b3650c625447b8a7
Analyze and fix the following issue in the Linux kernel code: check-uapi: link into shared objects
Problem Details: While testing ABI changes across all architectures, I found that abidiff sometimes produces nonsensical output. Further debugging identified missing or broken libelf support for architecture specific relocations in ET_REL binaries as the source of the problem[1]. Change the script to no longer produce...
```diff diff --git a/scripts/check-uapi.sh b/scripts/check-uapi.sh index 955581735cb3..9fa45cbdecc2 100755 --- a/scripts/check-uapi.sh +++ b/scripts/check-uapi.sh @@ -178,8 +178,11 @@ do_compile() { local -r inc_dir="$1" local -r header="$2" local -r out="$3" - printf "int main(void) { return 0; }\n" | \ - "$CC"...
1347a742a1e1b080e2e8d200312ae45b8d6ac859
Analyze and fix the following issue in the Linux kernel code: vfio: selftests: Build tests on aarch64
Problem Details: Fix vfio selftests on aarch64, allowing native builds on aarch64 hosts. Reported-by: Matt Evans <mattev@meta.com> Closes: https://lore.kernel.org/all/e51b4ff2-13c4-47d4-b781-3dcbd740d274@meta.com/ Fixes: a55d4bbbe644 ("vfio: selftests: only build tests on arm64 and x86_64") Signed-off-by: Ted Logan <t...
```diff diff --git a/tools/testing/selftests/vfio/Makefile b/tools/testing/selftests/vfio/Makefile index 8e90e409e91d..0684932d91bf 100644 --- a/tools/testing/selftests/vfio/Makefile +++ b/tools/testing/selftests/vfio/Makefile @@ -1,6 +1,6 @@ ARCH ?= $(shell uname -m) -ifeq (,$(filter $(ARCH),arm64 x86_64)) +ifeq (,...
7a618ca9b9c4769fc5adf7344bb1dd98f823da22
Analyze and fix the following issue in the Linux kernel code: init/Kconfig: Require a release version of clang-22 for CC_HAS_COUNTED_BY_PTR
Problem Details: Commit 150a04d817d8 ("compiler_types.h: Attributes: Add __counted_by_ptr macro") used Clang 22.0.0 as a minimum supported version for __counted_by_ptr, which made sense while 22.0.0 was the version of LLVM's main branch to allow developers to easily test and develop uses of __counted_by_ptr in their co...
```diff diff --git a/init/Kconfig b/init/Kconfig index b55deae9256c..399c0ed3b4a9 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -146,7 +146,7 @@ config CC_HAS_COUNTED_BY config CC_HAS_COUNTED_BY_PTR bool # supported since clang 22 - default y if CC_IS_CLANG && CLANG_VERSION >= 220000 + default y if CC_IS_CLANG &...
1f6aa5bbf1d0f81a8a2aafc16136e7dd9a609ff3
Analyze and fix the following issue in the Linux kernel code: x86/platform/uv: Handle deconfigured sockets
Problem Details: When a socket is deconfigured, it's mapped to SOCK_EMPTY (0xffff). This causes a panic while allocating UV hub info structures. Fix this by using NUMA_NO_NODE, allowing UV hub info structures to be allocated on valid nodes. Fixes: 8a50c5851927 ("x86/platform/uv: UV support for sub-NUMA clustering") S...
```diff diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 15209f220e1f..42568ceec481 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -1708,8 +1708,22 @@ static void __init uv_system_init_hub(void) struct uv_hub_info_s *new_hub; ...
cb7415d8cbb750221b48e5beebe8f402719a20d9
Analyze and fix the following issue in the Linux kernel code: drm/xe: Fix format specifier for printing pointer differences
Problem Details: GCC and clang warn (or error with CONFIG_WERROR=y / W=e) several times when targeting 32-bit platforms along the lines of drivers/gpu/drm/xe/xe_lrc.c: In function 'dump_mi_command': drivers/gpu/drm/xe/xe_lrc.c:1921:40: error: format '%lx' expects argument of type 'long unsigned int', but argument ...
```diff diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c index c5cfd8f75a94..dde3bcff3c22 100644 --- a/drivers/gpu/drm/xe/xe_lrc.c +++ b/drivers/gpu/drm/xe/xe_lrc.c @@ -1918,17 +1918,17 @@ static int dump_mi_command(struct drm_printer *p, while (num_noop < remaining_dw && (*(++dw) & R...
e83b07dc8c05a55d02057b1484724a0b188f6f8d
Analyze and fix the following issue in the Linux kernel code: tools/nolibc: MIPS: fix clobbers of 'lo' and 'hi' registers on different ISAs
Problem Details: All MIPS ISAs before r6 use the 'lo' and 'hi' special registers. These are clobbered by system calls and need to be marked as such to avoid miscompilations. Currently nolibc ties the clobbers to the ABI. But this is wrong and leads to ISA<->ABI combinations which are not handled correctly, leading to c...
```diff diff --git a/tools/include/nolibc/arch-mips.h b/tools/include/nolibc/arch-mips.h index bd4a9b57e1f0..bb9d580ea1b1 100644 --- a/tools/include/nolibc/arch-mips.h +++ b/tools/include/nolibc/arch-mips.h @@ -39,11 +39,19 @@ * - stack is 16-byte aligned */ +#if !defined(__mips_isa_rev) || __mips_isa_rev < 6 +...
5eae5f1a01aff6f9773547265167d7a680c6fbc3
Analyze and fix the following issue in the Linux kernel code: tools/nolibc/printf: Special case 0 and add support for %#x
Problem Details: The output for %#x is almost the same as that for %p, both output in hexadecimal with a leading "0x". However for zero %#x should just output "0" (the same as decimal and ocal). For %p match glibc and output "(nil)" rather than "0x0" or "0". Add tests for "%#x", "% d", "%+d" and passing NULL to "%p". ...
```diff diff --git a/tools/include/nolibc/stdio.h b/tools/include/nolibc/stdio.h index 65e113f135d4..db714b1ce274 100644 --- a/tools/include/nolibc/stdio.h +++ b/tools/include/nolibc/stdio.h @@ -296,7 +296,7 @@ int fseek(FILE *stream, long offset, int whence) * - %% generates a single % * - %m outputs strerror(er...
63f8b60151dc00895137bfadc987f258060ab264
Analyze and fix the following issue in the Linux kernel code: x86/entry/vdso: Fix path of included gettimeofday.c
Problem Details: Commit in Fixes forgot to convert one include path to be relative to the kernel source directory after adding latter to flags-y. Fix it. [ bp: Rewrite commit message. ] Fixes: 693c819fedcd ("x86/entry/vdso: Refactor the vdso build") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-o...
```diff diff --git a/arch/x86/entry/vdso/common/vclock_gettime.c b/arch/x86/entry/vdso/common/vclock_gettime.c index 027b7e88d753..57066f346b3f 100644 --- a/arch/x86/entry/vdso/common/vclock_gettime.c +++ b/arch/x86/entry/vdso/common/vclock_gettime.c @@ -13,7 +13,7 @@ #include <linux/types.h> #include <vdso/gettime.h...
125632871929e9bf5b0bc907c8fef2d326e4623a
Analyze and fix the following issue in the Linux kernel code: tools/nolibc/printf: Add support for length modifiers tzqL and formats iX
Problem Details: Length modifiers t (ptrdiff_t) and z (size_t) are aliases for l (long), q and L are 64bit the same as j (intmax). Format i is an alias for d and X similar to x but upper case. Supporting them is mostly just adding the relevant bit to the bit pattern used for matching characters. Although %X is detected...
```diff diff --git a/tools/include/nolibc/stdio.h b/tools/include/nolibc/stdio.h index f5a176bffc93..7382b00707fb 100644 --- a/tools/include/nolibc/stdio.h +++ b/tools/include/nolibc/stdio.h @@ -291,10 +291,11 @@ int fseek(FILE *stream, long offset, int whence) } -/* printf(). Supports the following integer and st...
4ea2dedd502e2b4bfa8a47f2aaaaac4eab01e00d
Analyze and fix the following issue in the Linux kernel code: selftests/nolibc: Check that snprintf() doesn't write beyond the buffer end
Problem Details: Fill buf[] with known data and check the vsnprintf() doesn't write beyond the specified buffer length. Would have picked up the bug in field padding. Signed-off-by: David Laight <david.laight.linux@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://patch.msgid.link/20260302101815.3043-7-davi...
```diff diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 154cc5711a4c..5dc0edfe8d9a 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -1679,6 +1679,10 @@ static int expect_vfprintf(int llen, const...
4045e7b19bbf7338452cda11e64cfe7ae3361964
Analyze and fix the following issue in the Linux kernel code: tools/nolibc/printf: Move snprintf length check to callback
Problem Details: Move output truncation to the snprintf() callback. This simplifies the main code and fixes truncation of padded fields. Add a zero length callback to 'finalise' the buffer rather than doing it in snprintf() itself. Fixes: e90ce42e81381 ("tools/nolibc: implement width padding in printf()") Signed-off-...
```diff diff --git a/tools/include/nolibc/stdio.h b/tools/include/nolibc/stdio.h index 77d7669cdb80..a4df72d9a2d3 100644 --- a/tools/include/nolibc/stdio.h +++ b/tools/include/nolibc/stdio.h @@ -295,16 +295,25 @@ int fseek(FILE *stream, long offset, int whence) * - %[l*]{d,u,c,x,p} * - %s * - unknown modifiers...
27532c645e61da541173d43fbe03d234f68232f9
Analyze and fix the following issue in the Linux kernel code: selftests/nolibc: Fix build with host headers and libc
Problem Details: Many systems don't have strlcpy() or strlcat() and readdir_r() is deprecated. This makes the tests fail to build with the host headers. Disable the 'directories' test and define strlcpy(), strlcat() and readdir_r() using #defines so that the code compiles. Fixes: 6fe8360b16acb ("selftests/nolibc: also...
```diff diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 1aca8468eac4..801b2ad18853 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -82,6 +82,20 @@ static const int is_glibc = #endif ; +#if ...
8ba600aa577f73cc551747fdf121afc7d04afcea
Analyze and fix the following issue in the Linux kernel code: selftests/nolibc: fix test_file_stream() on musl libc
Problem Details: fwrite() modifying errno is non-standard. Only validate this behavior on those libc implementations which implement it. Fixes: a5f00be9b3b0 ("tools/nolibc: Add a simple test for writing to a FILE and reading it back") Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
```diff diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 1b9d3b2e2491..1aca8468eac4 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -74,6 +74,14 @@ static const int is_nolibc = #endif ; +sta...
217c0a5c177a3d4f7c8497950cbf5c36756e8bbb
Analyze and fix the following issue in the Linux kernel code: x86/efi: efi_unmap_boot_services: fix calculation of ranges_to_free size
Problem Details: ranges_to_free array should have enough room to store the entire EFI memmap plus an extra element for NULL entry. The calculation of this array size wrongly adds 1 to the overall size instead of adding 1 to the number of elements. Add parentheses to properly size the array. Reported-by: Guenter Roeck...
```diff diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c index 35caa5746115..79f0818131e8 100644 --- a/arch/x86/platform/efi/quirks.c +++ b/arch/x86/platform/efi/quirks.c @@ -424,7 +424,7 @@ void __init efi_unmap_boot_services(void) if (efi_enabled(EFI_DBG)) return; - sz = sizeof(*ran...
be8058f31b4e237604e4ce7599593ab68dc69ae7
Analyze and fix the following issue in the Linux kernel code: rtla: Fix segfault on multiple SIGINTs
Problem Details: Detach stop_trace() from SIGINT/SIGALRM on tool clean-up to prevent it from crashing RTLA by accessing freed memory. This prevents a crash when multiple SIGINTs are received. Fixes: d6899e560366 ("rtla/timerlat_hist: Abort event processing on second signal") Fixes: 80967b354a76 ("rtla/timerlat_top: A...
```diff diff --git a/tools/tracing/rtla/src/common.c b/tools/tracing/rtla/src/common.c index 50d8aafdfd3b..35e3d3aa922e 100644 --- a/tools/tracing/rtla/src/common.c +++ b/tools/tracing/rtla/src/common.c @@ -41,6 +41,18 @@ static void set_signals(struct common_params *params) } } +/* + * unset_signals - unsets the ...
76f9377cd2ab7a9220c25d33940d9ca20d368172
Analyze and fix the following issue in the Linux kernel code: writeback: don't block sync for filesystems with no data integrity guarantees
Problem Details: Add a SB_I_NO_DATA_INTEGRITY superblock flag for filesystems that cannot guarantee data persistence on sync (eg fuse). For superblocks with this flag set, sync kicks off writeback of dirty inodes but does not wait for the flusher threads to complete the writeback. This replaces the per-inode AS_NO_DAT...
```diff diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index d8dac1931595..3c75ee025bda 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2787,13 +2787,8 @@ static void wait_sb_inodes(struct super_block *sb) * The mapping can appear untagged while still on-list since we * do not have the mapping lo...
49e64d7136366a9657d581158d4a20399231530c
Analyze and fix the following issue in the Linux kernel code: init/initramfs.c: trivial fix: FSM -> Finite-state machine
Problem Details: FSM means "finite-state machine", but I think this is not obvious to everyone. Signed-off-by: Askar Safin <safinaskar@gmail.com> Link: https://patch.msgid.link/20260319232721.452950-1-safinaskar@gmail.com Signed-off-by: Christian Brauner <brauner@kernel.org>
```diff diff --git a/init/initramfs.c b/init/initramfs.c index 6ddbfb17fb8f..24d7cde4fff0 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -212,7 +212,7 @@ static void __init parse_header(char *s) hdr_csum = parsed[12]; } -/* FSM */ +/* Finite-state machine */ static __initdata enum state { Start, ```
215e5fe75881a7e2425df04aeeed47a903d5cd5d
Analyze and fix the following issue in the Linux kernel code: ASoC: SOF: topology: reject invalid vendor array size in token parser
Problem Details: sof_parse_token_sets() accepts array->size values that can be invalid for a vendor tuple array header. In particular, a zero size does not advance the parser state and can lead to non-progress parsing on malformed topology data. Validate array->size against the minimum header size and reject values sm...
```diff diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 18e2401152c8..35200d801fb7 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -736,7 +736,7 @@ static int sof_parse_token_sets(struct snd_soc_component *scomp, asize = le32_to_cpu(array->size); /* validate asize ...
d9794c0600f95b226b6672c5b364e44c80d660c5
Analyze and fix the following issue in the Linux kernel code: dma-mapping: fix false kernel-doc comment marker
Problem Details: Change /** to /* for the DMA attributes list comment in dma-mapping.h. The comment is not a kernel-doc structured comment and should not use the kernel-doc opening marker. Assisted-by: Claude:claude-opus-4-6 Signed-off-by: Kit Dallege <xaum.io@gmail.com> Signed-off-by: Marek Szyprowski <m.szyprowski@s...
```diff diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 29973baa0581..0c2807e50bdf 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -9,7 +9,7 @@ #include <linux/bug.h> #include <linux/cache.h> -/** +/* * List of possible attributes associated with a DMA ma...
f5ebf241c407dbf629fcf515015e139fcea2c2f0
Analyze and fix the following issue in the Linux kernel code: mm/hmm: Indicate that HMM requires DMA coherency
Problem Details: HMM is fundamentally about allowing a sophisticated device to perform DMA directly to a process’s memory while the CPU accesses that same memory at the same time. It is similar to SVA but does not rely on IOMMU support. Because the entire model depends on concurrent access to shared memory, it fails as...
```diff diff --git a/mm/hmm.c b/mm/hmm.c index f6c4ddff4bd6..5955f2f0c83d 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -778,7 +778,7 @@ dma_addr_t hmm_dma_map_pfn(struct device *dev, struct hmm_dma_map *map, struct page *page = hmm_pfn_to_page(pfns[idx]); phys_addr_t paddr = hmm_pfn_to_phys(pfns[idx]); size_t offset =...
d9d43a3f5c48d5a3d1da922f46c4a30d94d61ba5
Analyze and fix the following issue in the Linux kernel code: RDMA/umem: Tell DMA mapping that UMEM requires coherency
Problem Details: The RDMA subsystem exposes DMA regions through the verbs interface, which assumes a coherent system. Use the DMA_ATTR_REQUIRE_COHERENCE attribute to ensure coherency and avoid taking the SWIOTLB path. The RDMA verbs programming model resembles HMM and assumes concurrent DMA and CPU access to userspace...
```diff diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index cff4fcca2c34..edc34c69f0f2 100644 --- a/drivers/infiniband/core/umem.c +++ b/drivers/infiniband/core/umem.c @@ -55,7 +55,8 @@ static void __ib_umem_release(struct ib_device *dev, struct ib_umem *umem, int d if (dirty) ib_d...
636e6572e848339d2ae591949fe81de2cef00563
Analyze and fix the following issue in the Linux kernel code: iommu/dma: add support for DMA_ATTR_REQUIRE_COHERENT attribute
Problem Details: Add support for the DMA_ATTR_REQUIRE_COHERENT attribute to the exported functions. This attribute indicates that the SWIOTLB path must not be used and that no sync operations should be performed. Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.c...
```diff diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 5dac64be61bb..94d514169642 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -1211,7 +1211,7 @@ dma_addr_t iommu_dma_map_phys(struct device *dev, phys_addr_t phys, size_t size, */ if (dev_use_swiotlb(dev, size,...
2536617f20ddc7c2f4cef59b549aa45d166b03b1
Analyze and fix the following issue in the Linux kernel code: dma-direct: prevent SWIOTLB path when DMA_ATTR_REQUIRE_COHERENT is set
Problem Details: DMA_ATTR_REQUIRE_COHERENT indicates that SWIOTLB must not be used. Ensure the SWIOTLB path is declined whenever the DMA direct path is selected. Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Link: https://lore.kernel.org/r/20260316-dma-de...
```diff diff --git a/kernel/dma/direct.h b/kernel/dma/direct.h index e89f175e9c2d..6184ff303f08 100644 --- a/kernel/dma/direct.h +++ b/kernel/dma/direct.h @@ -84,7 +84,7 @@ static inline dma_addr_t dma_direct_map_phys(struct device *dev, dma_addr_t dma_addr; if (is_swiotlb_force_bounce(dev)) { - if (attrs & DMA_...
453b8fb68f3641fea970db88b7d9a153ed2a37e8
Analyze and fix the following issue in the Linux kernel code: xen/privcmd: restrict usage in unprivileged domU
Problem Details: The Xen privcmd driver allows to issue arbitrary hypercalls from user space processes. This is normally no problem, as access is usually limited to root and the hypervisor will deny any hypercalls affecting other domains. In case the guest is booted using secure boot, however, the privcmd driver would...
```diff diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index 1759cc18753f..a83bad69f4f2 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c @@ -12,6 +12,7 @@ #include <linux/eventfd.h> #include <linux/file.h> #include <linux/kernel.h> +#include <linux/kstrtox.h> #include <linux/module.h> #in...
e6a58fa2556203a7f6731b4071705dc81cca5ca5
Analyze and fix the following issue in the Linux kernel code: dma-mapping: Introduce DMA require coherency attribute
Problem Details: The mapping buffers which carry this attribute require DMA coherent system. This means that they can't take SWIOTLB path, can perform CPU cache overlap and doesn't perform cache flushing. Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Link...
```diff diff --git a/Documentation/core-api/dma-attributes.rst b/Documentation/core-api/dma-attributes.rst index 48cfe86cc06d..123c8468d58f 100644 --- a/Documentation/core-api/dma-attributes.rst +++ b/Documentation/core-api/dma-attributes.rst @@ -163,3 +163,19 @@ data corruption. All mappings that share a cache line...
9bb0a4d6a4433b75274204b083dac8e515d2007d
Analyze and fix the following issue in the Linux kernel code: dma-mapping: Clarify valid conditions for CPU cache line overlap
Problem Details: Rename the DMA_ATTR_CPU_CACHE_CLEAN attribute to better reflect that it is debugging aid to inform DMA core code that CPU cache line overlaps are allowed, and refine the documentation describing its use. Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Marek Szyprowski <m.szyprowski@s...
```diff diff --git a/Documentation/core-api/dma-attributes.rst b/Documentation/core-api/dma-attributes.rst index 1d7bfad73b1c..48cfe86cc06d 100644 --- a/Documentation/core-api/dma-attributes.rst +++ b/Documentation/core-api/dma-attributes.rst @@ -149,11 +149,17 @@ For architectures that require cache flushing for DMA c...
6f45b1604cf43945ef472ae4ef30354025307c19
Analyze and fix the following issue in the Linux kernel code: dma-mapping: handle DMA_ATTR_CPU_CACHE_CLEAN in trace output
Problem Details: Tracing prints decoded DMA attribute flags, but it does not yet include the recently added DMA_ATTR_CPU_CACHE_CLEAN. Add support for decoding and displaying this attribute in the trace output. Fixes: 61868dc55a11 ("dma-mapping: add DMA_ATTR_CPU_CACHE_CLEAN") Signed-off-by: Leon Romanovsky <leonro@nvid...
```diff diff --git a/include/trace/events/dma.h b/include/trace/events/dma.h index 33e99e792f1a..69cb3805ee81 100644 --- a/include/trace/events/dma.h +++ b/include/trace/events/dma.h @@ -32,7 +32,8 @@ TRACE_DEFINE_ENUM(DMA_NONE); { DMA_ATTR_ALLOC_SINGLE_PAGES, "ALLOC_SINGLE_PAGES" }, \ { DMA_ATTR_NO_WARN, "NO_WAR...
eca58535b154e6951327319afda94ac80eae7dc3
Analyze and fix the following issue in the Linux kernel code: dma-debug: Allow multiple invocations of overlapping entries
Problem Details: Repeated DMA mappings with DMA_ATTR_CPU_CACHE_CLEAN trigger the following splat. This prevents using the attribute in cases where a DMA region is shared and reused more than seven times. ------------[ cut here ]------------ DMA-API: exceeded 7 overlapping mappings of cacheline 0x000000000438c440 WA...
```diff diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 86f87e43438c..be207be74996 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -453,7 +453,7 @@ static int active_cacheline_set_overlap(phys_addr_t cln, int overlap) return overlap; } -static void active_cacheline_inc_overlap(phys_addr_t cl...
cf3a5a77d82cec9f48b4bcb615876d020566e43a
Analyze and fix the following issue in the Linux kernel code: arm64: dts: renesas: rzt2h-rzn2h-evk: Fix GMAC pins sort order
Problem Details: Restore alphabetical sort order of the pin control subnodes by exchanging the gmac1-pins and gmac2-pins nodes. While at it, fix the index in an incorrect "GMAC2" comment. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Li...
```diff diff --git a/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts b/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts index 52e5f6c3ab67..4c0e52850ca9 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts +++ b/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts @@ -253,6 +253,35 @@ ...
c961cc86af01246a7ce706bbc29072d314e00880
Analyze and fix the following issue in the Linux kernel code: reset: rzg2l-usbphy-ctrl: Fix malformed MODULE_AUTHOR string
Problem Details: Fix a malformed MODULE_AUTHOR macro in the RZ/G2L USBPHY control driver where the author's name and opening angle bracket were missing, leaving only the email address with a stray closing >. Correct it to the standard Name <email> format. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-b...
```diff diff --git a/drivers/reset/reset-rzg2l-usbphy-ctrl.c b/drivers/reset/reset-rzg2l-usbphy-ctrl.c index 05dd9b4a02df..fd75d9601a3b 100644 --- a/drivers/reset/reset-rzg2l-usbphy-ctrl.c +++ b/drivers/reset/reset-rzg2l-usbphy-ctrl.c @@ -350,4 +350,4 @@ module_platform_driver(rzg2l_usbphy_ctrl_driver); MODULE_LICEN...
fbef867cf6614178bc6afd15ee15f85cddf19eab
Analyze and fix the following issue in the Linux kernel code: drm/bridge: samsung-dsim: use drm_bridge_clear_and_put() to put the next bridge
Problem Details: drm_bridge_clear_and_put() is simpler to write and it prevents any potential future use-after-free. Reviewed-by: Osama Abdelkader <osama.abdelkader@gmail.com> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://patch.msgid.link/20260310-drm-...
```diff diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index ec632f268644..c3eb437ef1b0 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1988,9 +1988,7 @@ of_find_panel_or_bridge: return 0; err_release_next_bridge: - drm_...
8f3c83720555ffa96799896f2a0bb985a03a89f4
Analyze and fix the following issue in the Linux kernel code: drm/bridge: add drm_bridge_clear_and_put()
Problem Details: Drivers having a struct drm_bridge pointer pointing to a bridge in many cases hold that reference until the owning device is removed. In those cases the reference to the bridge can be put in the .remove callback (possibly using devm actions) or in the .destroy func (possibly with the help of struct drm...
```diff diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 1868d512ffa1..30d957675d87 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -304,6 +304,9 @@ EXPORT_SYMBOL(drm_bridge_get); * * This function decrements the bridge's reference count and frees the ...
e6d7eba23b666d85cacee0643be280d6ce1ebffc
Analyze and fix the following issue in the Linux kernel code: ata: libata-scsi: report correct sense field pointer in ata_scsiop_maint_in()
Problem Details: Commit 4ab7bb976343 ("ata: libata-scsi: Refactor ata_scsiop_maint_in()") modified ata_scsiop_maint_in() to directly call ata_scsi_set_invalid_field() to set the field pointer of the sense data of a failed MAINTENANCE IN command. However, in the case of an invalid command format, the sense data field in...
```diff diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index ad798e5246b4..3b65df914ebb 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -3600,7 +3600,7 @@ static unsigned int ata_scsiop_maint_in(struct ata_device *dev, if (cdb[2] != 1 && cdb[2] != 3) { ata_dev_warn(d...
fc3bbf34e643faa8678aabdc3810c60109f3435a
Analyze and fix the following issue in the Linux kernel code: drm/shmem-helper: Fix huge page mapping in fault handler
Problem Details: When running ./tools/testing/selftests/mm/split_huge_page_test multiple times with /sys/kernel/mm/transparent_hugepage/shmem_enabled and /sys/kernel/mm/transparent_hugepage/enabled set as always the following BUG occurs: [ 232.728858] ------------[ cut here ]------------ [ 232.729458] kernel BUG at ...
```diff diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 7b5a49935ae4..c549293b5bb6 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -550,27 +550,27 @@ int drm_gem_shmem_dumb_create(struct drm_file *file, struct drm_dev...