id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
fe4b3a34e9a9654d98d274218dac0270779db0ae
Analyze and fix the following issue in the Linux kernel code: rust: Add -fno-isolate-erroneous-paths-dereference to bindgen_skip_c_flags
Problem Details: It's used to work around an objtool issue since commit abb2a5572264 ("LoongArch: Add cflag -fno-isolate-erroneous-paths-dereference"), but it's then passed to bindgen and cause an error because Clang does not have this option. Fixes: abb2a5572264 ("LoongArch: Add cflag -fno-isolate-erroneous-paths-der...
```diff diff --git a/rust/Makefile b/rust/Makefile index 3e545c1a0ff4..7842ad0a4ea7 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -298,7 +298,7 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \ -fno-inline-functions-called-once -fsanitize=bounds-strict \ -fstrict-flex-arrays=% -fmin-f...
98a5fd31cbf72d46bf18e50b3ab0ce86d5f319a9
Analyze and fix the following issue in the Linux kernel code: ksmbd: close accepted socket when per-IP limit rejects connection
Problem Details: When the per-IP connection limit is exceeded in ksmbd_kthread_fn(), the code sets ret = -EAGAIN and continues the accept loop without closing the just-accepted socket. That leaks one socket per rejected attempt from a single IP and enables a trivial remote DoS. Release client_sk before continuing. Th...
```diff diff --git a/fs/smb/server/transport_tcp.c b/fs/smb/server/transport_tcp.c index 7a1e3dcc2cde..d2e391c29464 100644 --- a/fs/smb/server/transport_tcp.c +++ b/fs/smb/server/transport_tcp.c @@ -290,8 +290,11 @@ static int ksmbd_kthread_fn(void *p) } } up_read(&conn_list_lock); - if (ret == -EAGAIN) + i...
e8c73eb7db0a498cd4b22d2819e6ab1a6f506bd6
Analyze and fix the following issue in the Linux kernel code: cifs: client: fix memory leak in smb3_fs_context_parse_param
Problem Details: The user calls fsconfig twice, but when the program exits, free() only frees ctx->source for the second fsconfig, not the first. Regarding fc->source, there is no code in the fs context related to its memory reclamation. To fix this memory leak, release the source memory corresponding to ctx or fc bef...
```diff diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index e60927b2a7c8..c2d5bb23040c 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -1435,12 +1435,14 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, cifs_errorf(fc, "Unknown error parsing devname\...
79280191c2fd7f24899bbd640003b5389d3c109c
Analyze and fix the following issue in the Linux kernel code: smb: client: fix cifs_pick_channel when channel needs reconnect
Problem Details: cifs_pick_channel iterates candidate channels using cur. The reconnect-state test mistakenly used a different variable. This checked the wrong slot and would cause us to skip a healthy channel and to dispatch on one that needs reconnect, occasionally failing operations when a channel was down. Fix by...
```diff diff --git a/fs/smb/client/transport.c b/fs/smb/client/transport.c index 051cd9dbba13..915cedde5d66 100644 --- a/fs/smb/client/transport.c +++ b/fs/smb/client/transport.c @@ -830,7 +830,7 @@ struct TCP_Server_Info *cifs_pick_channel(struct cifs_ses *ses) if (!server || server->terminate) continue; - i...
9b07cdf86a0b90556f5b68a6b20b35833b558df3
Analyze and fix the following issue in the Linux kernel code: pinctrl: cirrus: Fix fwnode leak in cs42l43_pin_probe()
Problem Details: The driver calls fwnode_get_named_child_node() which takes a reference on the child node, but never releases it, which causes a reference leak. Fix by using devm_add_action_or_reset() to automatically release the reference when the device is removed. Fixes: d5282a539297 ("pinctrl: cs42l43: Add suppor...
```diff diff --git a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c index 68abb6d6cecd..a8f82104a384 100644 --- a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c +++ b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c @@ -532,6 +532,11 @@ static int cs42l43_gpio_add_pin_ranges(struct gpio_chip *chi...
2d8482959efee5721456d199106b9c256c11b11b
Analyze and fix the following issue in the Linux kernel code: tools/nolibc: avoid using plain integer as NULL pointer
Problem Details: While an integer zero is a valid NULL pointer as per the C standard, sparse will complain about it. Use explicit NULL pointers instead. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/r/202509261452.g5peaXCc-lkp@intel.com/ Signed-off-by: Thomas Weißschuh <linux@weisssch...
```diff diff --git a/tools/include/nolibc/getopt.h b/tools/include/nolibc/getopt.h index 217abb95264b..87565e3b6a33 100644 --- a/tools/include/nolibc/getopt.h +++ b/tools/include/nolibc/getopt.h @@ -78,7 +78,7 @@ int getopt(int argc, char * const argv[], const char *optstring) return '?'; } if (optstring[i] == '...
780813d7018067f2796f023b56b51385970be460
Analyze and fix the following issue in the Linux kernel code: x86/math-emu: Fix div_Xsig() prototype
Problem Details: The third argument of div_Xsig() is the output of the division, but is marked 'const', which means the compiler is not expecting it to be updated and may generate bad code around the call. clang-21 now warns about the pattern since an uninitialized variable is passed into two 'const' arguments by refer...
```diff diff --git a/arch/x86/math-emu/poly.h b/arch/x86/math-emu/poly.h index fc1c887ca073..654bfe4e29a0 100644 --- a/arch/x86/math-emu/poly.h +++ b/arch/x86/math-emu/poly.h @@ -39,7 +39,7 @@ asmlinkage void mul_Xsig_Xsig(Xsig *dest, const Xsig *mult); asmlinkage void shr_Xsig(Xsig *, const int n); asmlinkage int ro...
d16d1c2553248f9b859b86c94344d8b81f0297cd
Analyze and fix the following issue in the Linux kernel code: iio: imu: inv_icm45600: Initializes inv_icm45600_buffer_postdisable() sleep
Problem Details: The sleep variable in inv_icm45600_buffer_postdisable() could be used without being assigned in case of error. It must be initialized to 0 by default. Fixes: 06674a72cf7a ("iio: imu: inv_icm45600: add buffer support in iio devices") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https:/...
```diff diff --git a/drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c b/drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c index 2efcc177f9d6..2b9ea317385c 100644 --- a/drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c +++ b/drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c @@ -370,6 +370,7 @@ static int inv_icm456...
8265cc284dc619aefb49fb07dde436bb3e8b52e3
Analyze and fix the following issue in the Linux kernel code: iio: dac: ad5446: Fix coding style issues
Problem Details: Fix style issues as reported by checkpatch. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
```diff diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c index 0556ce78c2f6..46a2eadb1d9b 100644 --- a/drivers/iio/dac/ad5446.c +++ b/drivers/iio/dac/ad5446.c @@ -28,7 +28,8 @@ static const char * const ad5446_powerdown_modes[] = { }; static int ad5446_set_powerdown_mode(struct iio_dev *indio_dev, -...
02f86101e430cce9a99a044b483c4ed5b91bb3b8
Analyze and fix the following issue in the Linux kernel code: iio: imu: bmi270: fix dev_err_probe error msg
Problem Details: The bmi270 can be connected to I2C or a SPI interface. If it is a SPI, during probe, if devm_regmap_init() fails, it should print the "spi" term rather "i2c". Fixes: 92cc50a00574 ("iio: imu: bmi270: Add spi driver for bmi270 imu") Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com> Reviewed-by: A...
```diff diff --git a/drivers/iio/imu/bmi270/bmi270_spi.c b/drivers/iio/imu/bmi270/bmi270_spi.c index 19dd7734f9d0..80c9fa1d685a 100644 --- a/drivers/iio/imu/bmi270/bmi270_spi.c +++ b/drivers/iio/imu/bmi270/bmi270_spi.c @@ -60,7 +60,7 @@ static int bmi270_spi_probe(struct spi_device *spi) &bmi270_spi_regmap_confi...
49708f45be675d726b6c39a0eee260c0df1f77bc
Analyze and fix the following issue in the Linux kernel code: iio: backend: fix kernel-doc to avoid warnings and ensure consistency
Problem Details: Fix multiple kernel-doc warnings and make the documentation style consistent in drivers/iio/industrialio-backend.c. Changes include: - Add missing @chan parameter description in iio_backend_oversampling_ratio_set(). - Add missing RETURNS section in iio_backend_get_priv(). - Replace Return: with ...
```diff diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-backend.c index 23760652a046..447b694d6d5f 100644 --- a/drivers/iio/industrialio-backend.c +++ b/drivers/iio/industrialio-backend.c @@ -702,7 +702,7 @@ EXPORT_SYMBOL_NS_GPL(iio_backend_interface_type_get, "IIO_BACKEND"); * interface/da...
1d165919c8261b927f8dc8cfe61eb04342bedb7e
Analyze and fix the following issue in the Linux kernel code: iio: imu: adis: fix all kernel-doc warnings in header file
Problem Details: Correct and add to adis.h to resolve all kernel-doc warnings: - add a missing struct member description - change one non-kernel-doc comment to use /* instead of /** - correct function parameter @value to @val (7 locations) - add function return value comments (13 locations) Warning: include/linux/iio...
```diff diff --git a/include/linux/iio/imu/adis.h b/include/linux/iio/imu/adis.h index aa160511e265..bfb6df68e6c9 100644 --- a/include/linux/iio/imu/adis.h +++ b/include/linux/iio/imu/adis.h @@ -57,6 +57,7 @@ struct adis_timeout { * @enable_irq: Hook for ADIS devices that have a special IRQ enable/disable * @unmask...
97289f6accca405d63149e56774912c8be85f76b
Analyze and fix the following issue in the Linux kernel code: iio: adc: ad7124: fix possible OOB array access
Problem Details: Reorder the channel bounds check before using it to index into the channels array in ad7124_release_config_slot(). This prevents reading past the end of the array. The value read from invalid memory was not used, so this was mostly harmless, but we still should not be reading out of bounds in the firs...
```diff diff --git a/drivers/iio/adc/ad7124.c b/drivers/iio/adc/ad7124.c index 9d58ced7371d..ed828a82acb7 100644 --- a/drivers/iio/adc/ad7124.c +++ b/drivers/iio/adc/ad7124.c @@ -586,13 +586,18 @@ static int ad7124_request_config_slot(struct ad7124_state *st, u8 channel) static void ad7124_release_config_slot(struct...
c6763b15c49edc4926a8c6cd8cd2f01d49134d74
Analyze and fix the following issue in the Linux kernel code: iio: imu: inv_icm45600: Add a missing return statement in probe()
Problem Details: The intention here was clearly to return -ENODEV but the return statement was missing. It would result in an off by one read in i3c_chip_info[] on the next line. Add the return statement. Fixes: 1bef24e9007e ("iio: imu: inv_icm45600: add I3C driver for inv_icm45600 driver") Signed-off-by: Dan Carpen...
```diff diff --git a/drivers/iio/imu/inv_icm45600/inv_icm45600_i3c.c b/drivers/iio/imu/inv_icm45600/inv_icm45600_i3c.c index b5df06b97d44..9247eae9b3e2 100644 --- a/drivers/iio/imu/inv_icm45600/inv_icm45600_i3c.c +++ b/drivers/iio/imu/inv_icm45600/inv_icm45600_i3c.c @@ -57,7 +57,8 @@ static int inv_icm45600_i3c_probe(s...
cf274907901115d7cec71bc89fbfac8842ee57dd
Analyze and fix the following issue in the Linux kernel code: RDMA/bnxt_re: Add a debugfs entry for CQE coalescing tuning
Problem Details: This patch adds debugfs interfaces that allows the user to enable/disable the RoCE CQ coalescing and fine tune certain CQ coalescing parameters which would be helpful during debug. Signed-off-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com> Reviewed-by: Hongguang Gao <hongguang.gao@broadco...
```diff diff --git a/drivers/infiniband/hw/bnxt_re/bnxt_re.h b/drivers/infiniband/hw/bnxt_re/bnxt_re.h index 3485e495ac6a..3a7ce4729fcf 100644 --- a/drivers/infiniband/hw/bnxt_re/bnxt_re.h +++ b/drivers/infiniband/hw/bnxt_re/bnxt_re.h @@ -224,6 +224,8 @@ struct bnxt_re_dev { struct workqueue_struct *dcb_wq; struct...
8a4821412cf2c1429fffa07c012dd150f2edf78c
Analyze and fix the following issue in the Linux kernel code: KVM: nSVM: Fix and simplify LBR virtualization handling with nested
Problem Details: The current scheme for handling LBRV when nested is used is very complicated, especially when L1 does not enable LBRV (i.e. does not set LBR_CTL_ENABLE_MASK). To avoid copying LBRs between VMCB01 and VMCB02 on every nested transition, the current implementation switches between using VMCB01 or VMCB02 ...
```diff diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index a6443feab252..da6e80b3ac35 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -677,11 +677,10 @@ static void nested_vmcb02_prepare_save(struct vcpu_svm *svm, struct vmcb *vmcb12 */ svm_copy_lbrs(vmcb02, vmcb12...
fbe5e5f030c22ae717ee422aaab0e00ea84fab5e
Analyze and fix the following issue in the Linux kernel code: KVM: nSVM: Always recalculate LBR MSR intercepts in svm_update_lbrv()
Problem Details: svm_update_lbrv() is called when MSR_IA32_DEBUGCTLMSR is updated, and on nested transitions where LBRV is used. It checks whether LBRV enablement needs to be changed in the current VMCB, and if it does, it also recalculate intercepts to LBR MSRs. However, there are cases where intercepts need to be up...
```diff diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 39538098002b..53201f13a43c 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -806,25 +806,29 @@ void svm_copy_lbrs(struct vmcb *to_vmcb, struct vmcb *from_vmcb) vmcb_mark_dirty(to_vmcb, VMCB_LBR); } -void svm_enable_lbrv(s...
dc55b3c3f61246e483e50c85d8d5366f9567e188
Analyze and fix the following issue in the Linux kernel code: KVM: SVM: Mark VMCB_LBR dirty when MSR_IA32_DEBUGCTLMSR is updated
Problem Details: The APM lists the DbgCtlMsr field as being tracked by the VMCB_LBR clean bit. Always clear the bit when MSR_IA32_DEBUGCTLMSR is updated. The history is complicated, it was correctly cleared for L1 before commit 1d5a1b5860ed ("KVM: x86: nSVM: correctly virtualize LBR msrs when L2 is running"). At tha...
```diff diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 76055c0ba177..39538098002b 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -3004,7 +3004,11 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr) if (data & DEBUGCTL_RESERVED_BITS) return 1; + if (s...
79b67612605096c0008e71f23f3820c7c117ba11
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: use ether_addr_copy() for MAC address copying
Problem Details: Replaces multiple memcpy() calls with ether_addr_copy() for copying MAC/Ethernet addresses in rtl8723bs. This improves readability and aligns with Linux kernel best practices for handling Ethernet addresses. Fixes the following checkpatch.pl warning: "Use ether_addr_copy() instead of memcpy() for Ethe...
```diff diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c index 63c4ebe9df12..af6cdda8238d 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c @@ -7,6 +7,7 @@ #include <drv_types.h> #include <rtl8723b_hal...
495df2da6944477d282d5cc0c13174d06e25b310
Analyze and fix the following issue in the Linux kernel code: staging: most: remove broken i2c driver
Problem Details: The MOST I2C driver has been completely broken for five years without anyone noticing so remove the driver from staging. Specifically, commit 723de0f9171e ("staging: most: remove device from interface structure") started requiring drivers to set the interface device pointer before registration, but th...
```diff diff --git a/drivers/staging/most/Kconfig b/drivers/staging/most/Kconfig index 6f420cbcdcff..e89658df6f12 100644 --- a/drivers/staging/most/Kconfig +++ b/drivers/staging/most/Kconfig @@ -24,6 +24,4 @@ source "drivers/staging/most/video/Kconfig" source "drivers/staging/most/dim2/Kconfig" -source "drivers/st...
baadf2a5c26e802a46573eaad331b427b49aaa36
Analyze and fix the following issue in the Linux kernel code: most: usb: fix double free on late probe failure
Problem Details: The MOST subsystem has a non-standard registration function which frees the interface on registration failures and on deregistration. This unsurprisingly leads to bugs in the MOST drivers, and a couple of recent changes turned a reference underflow and use-after-free in the USB driver into several dou...
```diff diff --git a/drivers/most/most_usb.c b/drivers/most/most_usb.c index 10064d7b7249..41ee169f80c5 100644 --- a/drivers/most/most_usb.c +++ b/drivers/most/most_usb.c @@ -1058,7 +1058,7 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id) ret = most_register_interface(&mdev->iface); i...
96cf8500934e0ce2a6c486f1dbc3b1fff12f7a5e
Analyze and fix the following issue in the Linux kernel code: slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
Problem Details: The function qcom_slim_ngd_notify_slaves() calls of_slim_get_device() which internally uses device_find_child() to obtain a device reference. According to the device_find_child() documentation, the caller must drop the reference with put_device() after use. Found via static analysis and this is simila...
```diff diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index 4fb66986cc22..cd40ab839c54 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1241,6 +1241,7 @@ static void qcom_slim_ngd_notify_slaves(struct qcom_slim_ngd_ctrl *ctrl) if (slim_get_logi...
23379a17334fc24c4a9cbd9967d33dcd9323cc7c
Analyze and fix the following issue in the Linux kernel code: usb: typec: ucsi: psy: Set max current to zero when disconnected
Problem Details: The ucsi_psy_get_current_max function defaults to 0.1A when it is not clear how much current the partner device can support. But this does not check the port is connected, and will report 0.1A max current when nothing is connected. Update ucsi_psy_get_current_max to report 0A when there is no connectio...
```diff diff --git a/drivers/usb/typec/ucsi/psy.c b/drivers/usb/typec/ucsi/psy.c index 62a9d68bb66d..8ae900c8c132 100644 --- a/drivers/usb/typec/ucsi/psy.c +++ b/drivers/usb/typec/ucsi/psy.c @@ -145,6 +145,11 @@ static int ucsi_psy_get_current_max(struct ucsi_connector *con, { u32 pdo; + if (!UCSI_CONSTAT(con, CON...
e4f5ce990818d37930cd9fb0be29eee0553c59d9
Analyze and fix the following issue in the Linux kernel code: usb: gadget: f_eem: Fix memory leak in eem_unwrap
Problem Details: The existing code did not handle the failure case of usb_ep_queue in the command path, potentially leading to memory leaks. Improve error handling to free all allocated resources on usb_ep_queue failure. This patch continues to use goto logic for error handling, as the existing error handling is compl...
```diff diff --git a/drivers/usb/gadget/function/f_eem.c b/drivers/usb/gadget/function/f_eem.c index 6de81ea17274..edbbadad6138 100644 --- a/drivers/usb/gadget/function/f_eem.c +++ b/drivers/usb/gadget/function/f_eem.c @@ -477,8 +477,13 @@ static int eem_unwrap(struct gether *port, req->complete = eem_cmd_complete...
40f8d17eed7533ed2bbb5e3cc680049b19411b2e
Analyze and fix the following issue in the Linux kernel code: drivers/usb/dwc3: fix PCI parent check
Problem Details: The sysdev_is_parent check was being used to infer PCI devices that have the DMA mask set from the PCI capabilities, but sysdev_is_parent is also used for non-PCI ACPI devices in which case the DMA mask would be the bus default or as set by the _DMA method. Without this fix the DMA mask would default ...
```diff diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index ae140c356295..c2ce2f5e60a1 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -25,6 +25,7 @@ #include <linux/of.h> #include <linux/of_graph.h> #include <linux/acpi.h> +#include <linux/pci.h> #include <linux/pinctrl/consu...
41e99fe2005182139b1058db71f0d241f8f0078c
Analyze and fix the following issue in the Linux kernel code: usb: storage: Fix memory leak in USB bulk transport
Problem Details: A kernel memory leak was identified by the 'ioctl_sg01' test from Linux Test Project (LTP). The following bytes were mainly observed: 0x53425355. When USB storage devices incorrectly skip the data phase with status data, the code extracts/validates the CSW from the sg buffer, but fails to clear it aft...
```diff diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index 1aa1bd26c81f..9a4bf86e7b6a 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c @@ -1200,7 +1200,23 @@ int usb_stor_Bulk_transport(struct scsi_cmnd *srb, struct us_data *us) US_BULK_CS_WRAP_...
8c13a7323b847c0370aec66f655e2596a2174a17
Analyze and fix the following issue in the Linux kernel code: xhci: sideband: Fix race condition in sideband unregister
Problem Details: Uttkarsh Aggarwal observed a kernel panic during sideband un-register and found it was caused by a race condition between sideband unregister, and creating sideband interrupters. The issue occurrs when thread T1 runs uaudio_disconnect() and released sb->xhci via sideband_unregister, while thread T2 sim...
```diff diff --git a/drivers/usb/host/xhci-sideband.c b/drivers/usb/host/xhci-sideband.c index e771a476fef2..a85f62a73313 100644 --- a/drivers/usb/host/xhci-sideband.c +++ b/drivers/usb/host/xhci-sideband.c @@ -73,9 +73,12 @@ err: return NULL; } +/* Caller must hold sb->mutex */ static void __xhci_sideband_remov...
f6bb3b67be9af0cfb90075c60850b6af5338a508
Analyze and fix the following issue in the Linux kernel code: xhci: dbgtty: Fix data corruption when transmitting data form DbC to host
Problem Details: Data read from a DbC device may be corrupted due to a race between ongoing write and write request completion handler both queuing new transfer blocks (TRBs) if there are remining data in the kfifo. TRBs may be in incorrct order compared to the data in the kfifo. Driver fails to keep lock between rea...
```diff diff --git a/drivers/usb/host/xhci-dbgcap.h b/drivers/usb/host/xhci-dbgcap.h index 47ac72c2286d..5426c971d2d3 100644 --- a/drivers/usb/host/xhci-dbgcap.h +++ b/drivers/usb/host/xhci-dbgcap.h @@ -114,6 +114,7 @@ struct dbc_port { unsigned int tx_boundary; bool registered; + bool tx_running; }; ...
b69dfcab6894b1fed5362a364411502a7469fce3
Analyze and fix the following issue in the Linux kernel code: xhci: fix stale flag preventig URBs after link state error is cleared
Problem Details: A usb device caught behind a link in ss.Inactive error state needs to be reset to recover. A VDEV_PORT_ERROR flag is used to track this state, preventing new transfers from being queued until error is cleared. This flag may be left uncleared if link goes to error state between two resets, and print th...
```diff diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 8e209aa33ea7..5bdcf9ab2b99 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -1985,6 +1985,7 @@ static void xhci_cavium_reset_phy_quirk(struct xhci_hcd *xhci) static void handle_port_status(struct xhc...
3317aaca33dc6620d3dcc46216061df33bfff7db
Analyze and fix the following issue in the Linux kernel code: parisc: remove unneeded semicolon in perf_regs.c
Problem Details: No functional modification involved. ./arch/parisc/kernel/perf_regs.c:30:2-3: Unneeded semicolon. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=26159 Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Reported-by: kernel test rob...
```diff diff --git a/arch/parisc/kernel/perf_regs.c b/arch/parisc/kernel/perf_regs.c index 68458e2f6197..10a1a5f06a18 100644 --- a/arch/parisc/kernel/perf_regs.c +++ b/arch/parisc/kernel/perf_regs.c @@ -27,7 +27,7 @@ u64 perf_reg_value(struct pt_regs *regs, int idx) return regs->ior; case PERF_REG_PARISC_IPSW: /* ...
162f24cbb0f6ec596e7e9f3e91610d79dc805229
Analyze and fix the following issue in the Linux kernel code: rtc: rx8025: fix incorrect register reference
Problem Details: This code is intended to operate on the CTRL1 register, but ctrl[1] is actually CTRL2. Correctly, ctrl[0] is CTRL1. Signed-off-by: Yuta Hayama <hayama@lineo.co.jp> Fixes: 71af91565052 ("rtc: rx8025: fix 12/24 hour mode detection on RX-8035") Cc: stable@vger.kernel.org Link: https://patch.msgid.link/ea...
```diff diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c index aabe62c283a1..7e9f7cb90c28 100644 --- a/drivers/rtc/rtc-rx8025.c +++ b/drivers/rtc/rtc-rx8025.c @@ -316,7 +316,7 @@ static int rx8025_init_client(struct i2c_client *client) return hour_reg; rx8025->is_24 = (hour_reg & RX8035_BIT_HOUR_...
07caedc6a3887938813727beafea40f07c497705
Analyze and fix the following issue in the Linux kernel code: scsi: lpfc: Fix reusing an ndlp that is marked NLP_DROPPED during FLOGI
Problem Details: It's possible for an unstable link to repeatedly bounce allowing a FLOGI retry, but then bounce again forcing an abort of the FLOGI. Ensure that the initial reference count on the FLOGI ndlp is restored in this faulty link scenario. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://pa...
```diff diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 00cfd4ac4ccd..0045c1e29619 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -934,10 +934,15 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, /* Check to see if link went down ...
23f4906729a0064e734fb9da2ed02e8fbbf8db00
Analyze and fix the following issue in the Linux kernel code: scsi: lpfc: Fix leaked ndlp krefs when in point-to-point topology
Problem Details: In point-to-point topology, the driver sometimes defers the unsolicited FLOGI LS_ACC until it sends its FLOGI to the remote port. When this happens, lpfc neglects to release the ndlp allocated for the unsolicited FLOGI. This patch adds code to release the ndlp for the deferred unsolicited FLOGI LS_AC...
```diff diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 224edacf2d8e..8459cf568c12 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -311,7 +311,6 @@ struct lpfc_defer_flogi_acc { u16 rx_id; u16 ox_id; struct lpfc_nodelist *ndlp; - }; #define LPFC_VMID_TIMER 300 ...
b518e86d1a70a88f6592a7c396cf1b93493d1aab
Analyze and fix the following issue in the Linux kernel code: scsi: smartpqi: Fix device resources accessed after device removal
Problem Details: Correct possible race conditions during device removal. Previously, a scheduled work item to reset a LUN could still execute after the device was removed, leading to use-after-free and other resource access issues. This race condition occurs because the abort handler may schedule a LUN reset concurre...
```diff diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 1cabe68dcad1..75fcc554d767 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -6427,10 +6427,22 @@ static int pqi_device_reset(struct pqi_ctrl_info *ctrl_info, struct p...
e6965188f84a7883e6a0d3448e86b0cf29b24dfc
Analyze and fix the following issue in the Linux kernel code: scsi: target: tcm_loop: Fix segfault in tcm_loop_tpg_address_show()
Problem Details: If the allocation of tl_hba->sh fails in tcm_loop_driver_probe() and we attempt to dereference it in tcm_loop_tpg_address_show() we will get a segfault, see below for an example. So, check tl_hba->sh before dereferencing it. Unable to allocate struct scsi_host BUG: kernel NULL pointer dereference,...
```diff diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index c7b7da629741..01a8e349dc4d 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c @@ -894,6 +894,9 @@ static ssize_t tcm_loop_tpg_address_show(struct config_item *item, struct tcm_loo...
20da637eb545b04753e20c675cfe97b04c7b600b
Analyze and fix the following issue in the Linux kernel code: scsi: stex: Fix reboot_notifier leak in probe error path
Problem Details: In stex_probe(), register_reboot_notifier() is called at the beginning, but if any subsequent initialization step fails, the function returns without unregistering the notifier, resulting in a resource leak. Add unregister_reboot_notifier() in the out_disable error path to ensure proper cleanup on all...
```diff diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c index d8ad02c29320..e02f28e5a104 100644 --- a/drivers/scsi/stex.c +++ b/drivers/scsi/stex.c @@ -1844,6 +1844,7 @@ out_release_regions: out_scsi_host_put: scsi_host_put(host); out_disable: + unregister_reboot_notifier(&stex_notifier); pci_disable_devic...
9517b82d8d422d426a988b213fdd45c6b417b86d
Analyze and fix the following issue in the Linux kernel code: nbd: defer config put in recv_work
Problem Details: There is one uaf issue in recv_work when running NBD_CLEAR_SOCK and NBD_CMD_RECONFIGURE: nbd_genl_connect // conf_ref=2 (connect and recv_work A) nbd_open // conf_ref=3 recv_work A done // conf_ref=2 NBD_CLEAR_SOCK // conf_ref=1 nbd_genl_reconfigure // conf_ref=2 (trigger...
```diff diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 1188f32a5e5e..0df7b33af677 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -1018,9 +1018,9 @@ static void recv_work(struct work_struct *work) nbd_mark_nsock_dead(nbd, nsock, 1); mutex_unlock(&nsock->tx_lock); - nbd_config_put(nbd);...
66768669f27d98b45b20ed401cca913c387a9934
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: vgic-v3: Release reserved slot outside of lpi_xa's lock
Problem Details: xa_release() expects to be called outside of the xa_lock. Fix vgic_add_lpi() to drop the lock before calling and restructure to get rid of the goto label. Reported-by: Zenghui Yu <yuzenghui@huawei.com> Closes: https://lore.kernel.org/kvmarm/d0853e82-7d95-5025-7abf-c6f1e0cdf7b5@huawei.com/ Fixes: 481c9...
```diff diff --git a/arch/arm64/kvm/vgic/vgic-its.c b/arch/arm64/kvm/vgic/vgic-its.c index f162206adb48..3f1c4b10fed9 100644 --- a/arch/arm64/kvm/vgic/vgic-its.c +++ b/arch/arm64/kvm/vgic/vgic-its.c @@ -115,21 +115,18 @@ static struct vgic_irq *vgic_add_lpi(struct kvm *kvm, u32 intid, /* Someone was faster with addi...
75360a9a338580990c1ee188d40a838c025bbd30
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: vgic-v3: Reinstate IRQ lock ordering for LPI xarray
Problem Details: Zenghui reports that running a KVM guest with an assigned device and lockdep enabled produces an unfriendly splat due to an inconsistent irq context when taking the lpi_xa's spinlock. This is no good as in rare cases the last reference to an LPI can get dropped after injection of a cached LPI translat...
```diff diff --git a/arch/arm64/kvm/vgic/vgic-debug.c b/arch/arm64/kvm/vgic/vgic-debug.c index 4c1209261b65..bb92853d1fd3 100644 --- a/arch/arm64/kvm/vgic/vgic-debug.c +++ b/arch/arm64/kvm/vgic/vgic-debug.c @@ -64,29 +64,37 @@ static void iter_next(struct kvm *kvm, struct vgic_state_iter *iter) static int iter_mark_lp...
af61da281f52aba0c5b090bafb3a31c5739850ff
Analyze and fix the following issue in the Linux kernel code: kbuild: Use objtree for module signing key path
Problem Details: When building out-of-tree modules with CONFIG_MODULE_SIG_FORCE=y, module signing fails because the private key path uses $(srctree) while the public key path uses $(objtree). Since signing keys are generated in the build directory during kernel compilation, both paths should use $(objtree) for consiste...
```diff diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index 1628198f3e83..9ba45e5b32b1 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst @@ -100,7 +100,7 @@ endif # Don't stop modules_install even if we can't sign external modules. # ifeq ($(filter pkcs11:%, $(CONFIG_MODULE_SIG_...
d599f571b3b42df1a4643531e27a262260296b86
Analyze and fix the following issue in the Linux kernel code: btrfs: send: make use of -fms-extensions for defining struct fs_path
Problem Details: The newly introduced -fms-extensions compiler flag allows defining struct fs_path in such a way that inline_buf becomes a proper array with a size known to the compiler. This also makes the problem fixed by commit 8aec9dbf2db2 ("btrfs: send: fix -Wflex-array-member-not-at-end warning in struct send_ct...
```diff diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 6144e66661f5..1fe4a06e6850 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -47,28 +47,30 @@ * It allows fast adding of path elements on the right side (normal path) and * fast adding to the left side (reversed path). A reversed path can also be * ...
50e7cce81b9b2fbd6f0104c1698959d45ce3cf58
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Limit clearing of ID_{AA64PFR0,PFR1}_EL1.GIC to userspace irqchip
Problem Details: Now that the idreg's GIC field is in sync with the irqchip, limit the runtime clearing of these fields to the pathological case where we do not have an in-kernel GIC. While we're at it, use the existing API instead of open-coded accessors to access the ID regs. Fixes: 5cb57a1aff755 ("KVM: arm64: Zero...
```diff diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index ad82264c6cbe..8ae2bca81614 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -5609,11 +5609,13 @@ int kvm_finalize_sys_regs(struct kvm_vcpu *vcpu) guard(mutex)(&kvm->arch.config_lock); - if (!(static_branch_un...
8a9866ff860052efc5f9766f3f87fae30c983156
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Set ID_{AA64PFR0,PFR1}_EL1.GIC when GICv3 is configured
Problem Details: Drive the idreg fields indicating the presence of GICv3 directly from the vgic code. This avoids having to do any sort of runtime clearing of the idreg. Fixes: 5cb57a1aff755 ("KVM: arm64: Zero ID_AA64PFR0_EL1.GIC when no GICv3 is presented to the guest") Reviewed-by: Oliver Upton <oupton@kernel.org> L...
```diff diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c index 1796b1a22a72..ca411cce4140 100644 --- a/arch/arm64/kvm/vgic/vgic-init.c +++ b/arch/arm64/kvm/vgic/vgic-init.c @@ -71,6 +71,7 @@ static int vgic_allocate_private_irqs_locked(struct kvm_vcpu *vcpu, u32 type); int kvm_vgic_create...
3f9eacf4f0705876a5d6526d7d320ca91d7d7a16
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Make all 32bit ID registers fully writable
Problem Details: 32bit ID registers aren't getting much love these days, and are often missed in updates. One of these updates broke restoring a GICv2 guest on a GICv3 machine. Instead of performing a piecemeal fix, just bite the bullet and make all 32bit ID regs fully writable. KVM itself never relies on them for any...
```diff diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index e67eb39ddc11..ad82264c6cbe 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -2595,19 +2595,23 @@ static bool bad_redir_trap(struct kvm_vcpu *vcpu, .val = 0, \ } -/* sys_reg_desc initialiser for known cpufea...
90e3bb44c0a86e245d8e5c6520206fa113acb1ee
Analyze and fix the following issue in the Linux kernel code: md: avoid repeated calls to del_gendisk
Problem Details: There is a uaf problem which is found by case 23rdev-lifetime: Oops: general protection fault, probably for non-canonical address 0xdead000000000122 RIP: 0010:bdi_unregister+0x4b/0x170 Call Trace: <TASK> __del_gendisk+0x356/0x3e0 mddev_unlock+0x351/0x360 rdev_attr_store+0x217/0x280 kernfs_fop_wri...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 7352e749e1b5..66219cf16a5e 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -941,7 +941,8 @@ void mddev_unlock(struct mddev *mddev) * do_md_stop. dm raid only uses md_stop to stop. So dm raid * doesn't need to check MD_DELETED when getting reconf...
0dc76205549b4c25705e54345f211b9f66e018a0
Analyze and fix the following issue in the Linux kernel code: md: fix rcu protection in md_wakeup_thread
Problem Details: We attempted to use RCU to protect the pointer 'thread', but directly passed the value when calling md_wakeup_thread(). This means that the RCU pointer has been acquired before rcu_read_lock(), which renders rcu_read_lock() ineffective and could lead to a use-after-free. Link: https://lore.kernel.org/...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 8128c8839a08..6062e0deb616 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -99,7 +99,7 @@ static int remove_and_add_spares(struct mddev *mddev, struct md_rdev *this); static void mddev_detach(struct mddev *mddev); static void export_rdev(struct ...
cc394b94dc40b661efc9895665abf03640ffff2d
Analyze and fix the following issue in the Linux kernel code: md: delete mddev kobj before deleting gendisk kobj
Problem Details: In sync del gendisk path, it deletes gendisk first and the directory /sys/block/md is removed. Then it releases mddev kobj in a delayed work. If we enable debug log in sysfs_remove_group, we can see the debug log 'sysfs group bitmap not found for kobject md'. It's the reason that the parent kobj has be...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 41c476b40c7a..8128c8839a08 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -941,8 +941,10 @@ void mddev_unlock(struct mddev *mddev) * do_md_stop. dm raid only uses md_stop to stop. So dm raid * doesn't need to check MD_DELETED when getting recon...
4b1b92bdc4ca13fd6712cfaa0084d3cfdf76e24c
Analyze and fix the following issue in the Linux kernel code: ALSA: au88x0: Fix array bounds warning in EQ drivers
Problem Details: In file included from ../sound/pci/au88x0/au8830.c:15: In function ‘vortex_Eqlzr_SetAllBandsFromActiveCoeffSet’, ../sound/pci/au88x0/au88x0_eq.c:571:9: error: ‘vortex_EqHw_SetRightGainsTarget’ reading 2 bytes from a region of size 0 [-Werror=stringop-overread] vortex_EqHw_SetRightGainsTarget(vortex, &...
```diff diff --git a/sound/pci/au88x0/au88x0_eq.c b/sound/pci/au88x0/au88x0_eq.c index 71c13100d7ef..81a63b5bb31c 100644 --- a/sound/pci/au88x0/au88x0_eq.c +++ b/sound/pci/au88x0/au88x0_eq.c @@ -568,7 +568,7 @@ static int vortex_Eqlzr_SetAllBandsFromActiveCoeffSet(vortex_t * vortex) eqlzr_t *eq = &(vortex->eq); v...
e20dfbad8aab2b7c72571ae3c3e2e646d6b04cb7
Analyze and fix the following issue in the Linux kernel code: net: fix napi_consume_skb() with alien skbs
Problem Details: There is a lack of NUMA awareness and more generally lack of slab caches affinity on TX completion path. Modern drivers are using napi_consume_skb(), hoping to cache sk_buff in per-cpu caches so that they can be recycled in RX path. Only use this if the skb was allocated on the same cpu, otherwise us...
```diff diff --git a/net/core/skbuff.c b/net/core/skbuff.c index eeddb9e737ff..7ac5f8aa1235 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -1476,6 +1476,11 @@ void napi_consume_skb(struct sk_buff *skb, int budget) DEBUG_NET_WARN_ON_ONCE(!in_softirq()); + if (skb->alloc_cpu != smp_processor_id() && !skb...
96a9178a29a6b84bb632ebeb4e84cf61191c73d5
Analyze and fix the following issue in the Linux kernel code: net: phy: micrel: lan8814 fix reset of the QSGMII interface
Problem Details: The lan8814 is a quad-phy and it is using QSGMII towards the MAC. The problem is that everytime when one of the ports is configured then the PCS is reseted for all the PHYs. Meaning that the other ports can loose traffic until the link is establish again. To fix this, do the reset one time for the enti...
```diff diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 6a1a424e3b30..01c87c9b7702 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -4380,12 +4380,6 @@ static int lan8814_config_init(struct phy_device *phydev) { struct kszphy_priv *lan8814 = phydev->priv; - /* Reset th...
ad17e7e92a7c52ce70bb764813fcf99464f96903
Analyze and fix the following issue in the Linux kernel code: net: fec: correct rx_bytes statistic for the case SHIFT16 is set
Problem Details: Two additional bytes in front of each frame received into the RX FIFO if SHIFT16 is set, so we need to subtract the extra two bytes from pkt_len to correct the statistic of rx_bytes. Fixes: 3ac72b7b63d5 ("net: fec: align IP header in hardware") Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: F...
```diff diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 1edcfaee6819..3222359ac15b 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1835,6 +1835,8 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id...
140039580efa96d18576a6c9fa6b1158be8a1d0f
Analyze and fix the following issue in the Linux kernel code: net: mana: Fix incorrect speed reported by debugfs
Problem Details: Once the netshaper is created for MANA, the current bandwidth is reported in debugfs like this: $ sudo ./tools/net/ynl/pyynl/cli.py \ --spec Documentation/netlink/specs/net_shaper.yaml \ --do set \ --json '{"ifindex":'3', "handle":{ "scope": "netdev", "id":'1' }, "bw-max": ...
```diff diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c index 739087081dfd..cccd5b63cee6 100644 --- a/drivers/net/ethernet/microsoft/mana/mana_en.c +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c @@ -854,7 +854,7 @@ static int mana_shaper_del(struct net_sha...
57531b3416448d1ced36a2a974a4085ec43d57b0
Analyze and fix the following issue in the Linux kernel code: selftests: net: local_termination: Wait for interfaces to come up
Problem Details: It seems that most of the tests prepare the interfaces once before the test run (setup_prepare()), rely on setup_wait() to wait for link and only then run the test(s). local_termination brings the physical interfaces down and up during test run but never wait for them to come up. If the auto-negotiati...
```diff diff --git a/tools/testing/selftests/net/forwarding/local_termination.sh b/tools/testing/selftests/net/forwarding/local_termination.sh index ecd34f364125..892895659c7e 100755 --- a/tools/testing/selftests/net/forwarding/local_termination.sh +++ b/tools/testing/selftests/net/forwarding/local_termination.sh @@ -1...
4da4e4bde1c453ac5cc2dce5def81d504ae257ee
Analyze and fix the following issue in the Linux kernel code: strparser: Fix signed/unsigned mismatch bug
Problem Details: The `len` member of the sk_buff is an unsigned int. This is cast to `ssize_t` (a signed type) for the first sk_buff in the comparison, but not the second sk_buff. On 32-bit systems, this can result in an integer underflow for certain values because unsigned arithmetic is being used. This appears to be...
```diff diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c index 43b1f558b33d..e659fea2da70 100644 --- a/net/strparser/strparser.c +++ b/net/strparser/strparser.c @@ -238,7 +238,7 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb, strp_parser_err(strp, -EMSGSIZE, desc); ...
dc20452e6caf962f04ede7f364267b0c37784ab4
Analyze and fix the following issue in the Linux kernel code: riscv: Fix CONFIG_AS_HAS_INSN for new .insn usage
Problem Details: After commit 44aa25c000b4 ("riscv: asm: use .insn for making custom instructions"), builds using LLVM older that 19 or binutils older than 2.38 fail with: arch/riscv/include/asm/vdso/processor.h: Assembler messages: arch/riscv/include/asm/vdso/processor.h:27: Error: unrecognized opcode `0x100000f'...
```diff diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 22cda9c452d2..fadec20b87a8 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -367,7 +367,7 @@ config RISCV_NONSTANDARD_CACHE_OPS systems to handle cache management. config AS_HAS_INSN - def_bool $(as-instr,.insn r 51$(comma) 0$(comma) 0...
3ad1b71fdc5707d14332d9ae710a237de936be9b
Analyze and fix the following issue in the Linux kernel code: riscv: Build loader.bin exclusively for Canaan K210
Problem Details: According to the explanation in commit ef10bdf9c3e6 ("riscv: Kconfig.socs: Split ARCH_CANAAN and SOC_CANAAN_K210"), loader.bin is a special feature of the Canaan K210 and is not applicable to other SoCs. Fixes: e79dfcbfb902 ("riscv: make image compression configurable") Signed-off-by: Feng Jiang <jian...
```diff diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index ecf2fcce2d92..3998d4036f15 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -159,7 +159,7 @@ boot-image-$(CONFIG_KERNEL_LZO) := Image.lzo boot-image-$(CONFIG_KERNEL_ZSTD) := Image.zst boot-image-$(CONFIG_KERNEL_XZ) := Image.xz ifdef ...
146eb58629f45f8297e83d69e64d4eea4b28d972
Analyze and fix the following issue in the Linux kernel code: io_uring: fix regbuf vector size truncation
Problem Details: There is a report of io_estimate_bvec_size() truncating the calculated number of segments that leads to corruption issues. Check it doesn't overflow "int"s used later. Rough but simple, can be improved on top. Cc: stable@vger.kernel.org Fixes: 9ef4cbbcb4ac3 ("io_uring: add infra for importing vectored...
```diff diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index d787c16dc1c3..2602d76d5ff0 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -1403,8 +1403,11 @@ static int io_estimate_bvec_size(struct iovec *iov, unsigned nr_iovs, size_t max_segs = 0; unsigned i; - for (i = 0; i < nr_iovs; i++) + for (i = 0; i <...
80b3dc0a5a2e51fb2b8f3406f5ee20ad4a652316
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: justify remaining uses of `as`
Problem Details: There are a few remaining cases where we *do* want to use `as`, because we specifically want to strip the data that does not fit into the destination type. Comment these uses to clear confusion about the intent. Acked-by: Danilo Krummrich <dakr@kernel.org> [acourbot@nvidia.com: fix merge conflicts aft...
```diff diff --git a/drivers/gpu/nova-core/falcon.rs b/drivers/gpu/nova-core/falcon.rs index 0116cb918fc8..fe5b3256d972 100644 --- a/drivers/gpu/nova-core/falcon.rs +++ b/drivers/gpu/nova-core/falcon.rs @@ -490,9 +490,13 @@ impl<E: FalconEngine + 'static> Falcon<E> { // Set up the base source DMA address. ...
84e2b401bcc551e7c2e1a995f90cce421bce5bfd
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: replace use of `as` with functions from `num`
Problem Details: Use the newly-introduced `num` module to replace the use of `as` wherever it is safe to do. This ensures that a given conversion cannot lose data if its source or destination type ever changes. Acked-by: Danilo Krummrich <dakr@kernel.org> [acourbot@nvidia.com: fix merge conflicts after rebase.] Signed...
```diff diff --git a/drivers/gpu/nova-core/falcon.rs b/drivers/gpu/nova-core/falcon.rs index 8efc910f20af..0116cb918fc8 100644 --- a/drivers/gpu/nova-core/falcon.rs +++ b/drivers/gpu/nova-core/falcon.rs @@ -22,6 +22,10 @@ use crate::{ dma::DmaObject, driver::Bar0, gpu::Chipset, + num::{ + FromS...
5525ac03ca7adec61d39f3fd3a143b5e294bdff7
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: add functions and traits for lossless integer conversions
Problem Details: The core library's `From` implementations do not cover conversions that are not portable or future-proof. For instance, even though it is safe today, `From<usize>` is not implemented for `u64` because of the possibility to support larger-than-64bit architectures in the future. However, the kernel supp...
```diff diff --git a/drivers/gpu/nova-core/nova_core.rs b/drivers/gpu/nova-core/nova_core.rs index e130166c1086..9180ec9c27ef 100644 --- a/drivers/gpu/nova-core/nova_core.rs +++ b/drivers/gpu/nova-core/nova_core.rs @@ -13,6 +13,7 @@ mod firmware; mod gfw; mod gpu; mod gsp; +mod num; mod regs; mod vbios; diff --g...
71062e282d6a662b75df9aff65702455563ff7c9
Analyze and fix the following issue in the Linux kernel code: perf tool: Add the perf_tool argument to all callbacks
Problem Details: Getting context for what a tool is doing, such as the perf_inject instance, using container_of the tool is a common pattern in the code. This isn't possible event_op2, event_op3 and event_op4 callbacks as the tool isn't passed. Add the argument and then fix function signatures to match. As tools maybe ...
```diff diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 112b15952016..9c27bb30b708 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -313,7 +313,8 @@ out_put: return ret; } -static int process_feature_event(struct perf_session *session, +static int p...
4b93d211bbffd3dce76664d95f2306d23e7215ce
Analyze and fix the following issue in the Linux kernel code: ACPI: MRRM: Fix memory leaks and improve error handling
Problem Details: Add proper error handling and resource cleanup to prevent memory leaks in add_boot_memory_ranges(). The function now checks for NULL return from kobject_create_and_add(), uses local buffer for range names to avoid dynamic allocation, and implements a cleanup path that removes previously created sysfs g...
```diff diff --git a/drivers/acpi/acpi_mrrm.c b/drivers/acpi/acpi_mrrm.c index a6dbf623e557..6d69554c940e 100644 --- a/drivers/acpi/acpi_mrrm.c +++ b/drivers/acpi/acpi_mrrm.c @@ -152,26 +152,49 @@ ATTRIBUTE_GROUPS(memory_range); static __init int add_boot_memory_ranges(void) { - struct kobject *pkobj, *kobj; + stru...
e32c402533cc68abe20fcf3246b9ff53e1f96021
Analyze and fix the following issue in the Linux kernel code: ASoC: spacemit: fix incorrect error check for sspa clock
Problem Details: Fix a wrong IS_ERR() check in spacemit_i2s_probe() where `clk` was used instead of `i2s->sspa_clk`. Signed-off-by: Goko Mell <goku.sonxin626@gmail.com> Link: https://patch.msgid.link/20251106-spacemit-i2s-fix-v1-1-ee2cedcdda23@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
```diff diff --git a/sound/soc/spacemit/k1_i2s.c b/sound/soc/spacemit/k1_i2s.c index 8af05e1604f5..1cb99f1abc7c 100644 --- a/sound/soc/spacemit/k1_i2s.c +++ b/sound/soc/spacemit/k1_i2s.c @@ -414,8 +414,9 @@ static int spacemit_i2s_probe(struct platform_device *pdev) return dev_err_probe(i2s->dev, PTR_ERR(clk), "fail...
2cf95b9baa52262bfb645cb3c04f902dd50c29e2
Analyze and fix the following issue in the Linux kernel code: EDAC/versalnet: Handle split messages for non-standard errors
Problem Details: The current code assumes that only DDR errors have split messages. Ensure proper logging of non-standard event errors that may be split across multiple messages too. [ bp: Massage, move comment too, fix it up. ] Fixes: d5fe2fec6c40 ("EDAC: Add a driver for the AMD Versal NET DDR controller") Signe...
```diff diff --git a/drivers/edac/versalnet_edac.c b/drivers/edac/versalnet_edac.c index 1ded4c3f0213..1a1092793092 100644 --- a/drivers/edac/versalnet_edac.c +++ b/drivers/edac/versalnet_edac.c @@ -605,21 +605,23 @@ static int rpmsg_cb(struct rpmsg_device *rpdev, void *data, length = result[MSG_ERR_LENGTH]; offset...
2baa33a8ddd61feb1347db95271f157fd9e9d53d
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Leave user-return notifier registered on reboot/shutdown
Problem Details: Leave KVM's user-return notifier registered in the unlikely case that the notifier is registered when disabling virtualization via IPI callback in response to reboot/shutdown. On reboot/shutdown, keeping the notifier registered is ok as far as MSR state is concerned (arguably better then restoring MSR...
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 4c089b11495a..3bc3d527f442 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -13108,7 +13108,21 @@ int kvm_arch_enable_virtualization_cpu(void) void kvm_arch_disable_virtualization_cpu(void) { kvm_x86_call(disable_virtualization_cpu)(); - ...
b371174d2fa60bbbb730a1a5292c865d12036c2a
Analyze and fix the following issue in the Linux kernel code: KVM: x86: WARN if user-return MSR notifier is registered on exit
Problem Details: When freeing the per-CPU user-return MSRs structures, WARN if any CPU has a registered notifier to help detect and/or debug potential use-after-free issues. The lifecycle of the notifiers is rather convoluted, and has several non-obvious paths where notifiers are unregistered, i.e. isn't exactly the m...
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index f4ce4292eb52..4c089b11495a 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -575,6 +575,27 @@ static inline void kvm_async_pf_hash_reset(struct kvm_vcpu *vcpu) vcpu->arch.apf.gfns[i] = ~0; } +static int kvm_init_user_return_msrs(void) +...
c0711f8c610e1634ed54fb04da1e82252730306a
Analyze and fix the following issue in the Linux kernel code: KVM: TDX: Explicitly set user-return MSRs that *may* be clobbered by the TDX-Module
Problem Details: Set all user-return MSRs to their post-TD-exit value when preparing to run a TDX vCPU to ensure the value that KVM expects to be loaded after running the vCPU is indeed the value that's loaded in hardware. If the TDX-Module doesn't actually enter the guest, i.e. doesn't do VM-Enter, then it won't "res...
```diff diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 4fbe4b7ce1da..a557c504c1a4 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -2379,7 +2379,6 @@ int kvm_pv_send_ipi(struct kvm *kvm, unsigned long ipi_bitmap_low, int kvm_add_user_return_msr...
ab4e41eb9fabd4607304fa7cfe8ec9c0bd8e1552
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Don't clear async #PF queue when CR0.PG is disabled (e.g. on #SMI)
Problem Details: Fix an interaction between SMM and PV asynchronous #PFs where an #SMI can cause KVM to drop an async #PF ready event, and thus result in guest tasks becoming permanently stuck due to the task that encountered the #PF never being resumed. Specifically, don't clear the completion queue when paging is di...
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 57ade075bae3..877c8766c551 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1045,6 +1045,13 @@ bool kvm_require_dr(struct kvm_vcpu *vcpu, int dr) } EXPORT_SYMBOL_FOR_KVM_INTERNAL(kvm_require_dr); +static bool kvm_pv_async_pf_enabled(stru...
68c35f89d016dd0ebcc4a0298e63aa7981fca9e0
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Fix a semi theoretical bug in kvm_arch_async_page_present_queued()
Problem Details: Fix a semi theoretical race condition related to a lack of memory barriers when dealing with vcpu->arch.apf.pageready_pending. In theory, the "ready" side could see a stale pageready_pending and neglect to kick the vCPU, and thus allow the vCPU to enter the guest with a pending KVM_REQ_APF_READY and n...
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index c826cd05228a..57ade075bae3 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4183,7 +4183,12 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) if (!guest_pv_has(vcpu, KVM_FEATURE_ASYNC_PF_INT)) return 1; if...
a2b0c33e9423cd06133304e2f81c713849059b10
Analyze and fix the following issue in the Linux kernel code: accel/qaic: Add qaic_ prefix to irq_polling_work
Problem Details: Rename irq_polling_work to qaic_irq_polling_work to reduce ambiguity and avoid potential naming conflicts in the future. Signed-off-by: Zack McKevitt <zachary.mckevitt@oss.qualcomm.com> Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com> Signed-off-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com> Link: http...
```diff diff --git a/drivers/accel/qaic/qaic.h b/drivers/accel/qaic/qaic.h index 4a371ddc0a55..fa7a8155658c 100644 --- a/drivers/accel/qaic/qaic.h +++ b/drivers/accel/qaic/qaic.h @@ -348,7 +348,7 @@ int qaic_partial_execute_bo_ioctl(struct drm_device *dev, void *data, struct drm int qaic_wait_bo_ioctl(struct drm_devic...
9818af18db4bfefd320d0fef41390a616365e6f7
Analyze and fix the following issue in the Linux kernel code: compiler_types: Move unused static inline functions warning to W=2
Problem Details: Per Nathan, clang catches unused "static inline" functions in C files since commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build"). Linus said: > So I entirely ignore W=1 issues, because I think so many of the extra > warnings are bogus. > > But if this one i...
```diff diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index 59288a2c1ad2..339603f05b54 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -250,10 +250,9 @@ struct ftrace_likely_data { /* * GCC does not warn about unused static inline functions for -Wunu...
9675093acea04c7b51ac3a646c7d0ba376b000d6
Analyze and fix the following issue in the Linux kernel code: accel/qaic: Implement basic SSR handling
Problem Details: Subsystem restart (SSR) for a qaic device means that a NSP has crashed, and will be restarted. However the restart process will lose any state associated with activation, so the user will need to do some recovery. While SSR has the provision to collect a crash dump, this patch does not implement supp...
```diff diff --git a/Documentation/accel/qaic/aic100.rst b/Documentation/accel/qaic/aic100.rst index 273da6192fb3..3b287c3987d2 100644 --- a/Documentation/accel/qaic/aic100.rst +++ b/Documentation/accel/qaic/aic100.rst @@ -487,8 +487,8 @@ one user crashes, the fallout of that should be limited to that workload and not ...
2308de27c03d8ed75b28dab2354eb02c5f8e69be
Analyze and fix the following issue in the Linux kernel code: f2fs: Use mapping->gfp_mask to get file cache for writing
Problem Details: On 32-bit architectures, when GFP_NOFS is used, the file cache for write operations cannot be allocated from the highmem and CMA. Since mapping->gfp_mask is set to GFP_HIGHUSER_MOVABLE during inode allocation, using mapping_gfp_mask(mapping) as the GFP flag of getting file cache for writing is more ef...
```diff diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 775aa4f63aa3..16a713013427 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -3570,7 +3570,8 @@ repeat: * Will wait that below with our IO control. */ folio = __filemap_get_folio(mapping, index, - FGP_LOCK | FGP_WRITE | FGP_CREAT, GFP_NOFS); + F...
fb1ebb10468da414d57153ddebaab29c38ef1a78
Analyze and fix the following issue in the Linux kernel code: regulator: core: disable supply if enabling main regulator fails
Problem Details: For 'always-on' and 'boot-on' regulators, the set_machine_constraints() may enable supply before enabling the main regulator, however if the latter fails, the function returns with an error but the supply remains enabled. When this happens, the regulator_register() function continues on the error path...
```diff diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 84bc38911dba..2eab56df042e 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1631,6 +1631,8 @@ static int set_machine_constraints(struct regulator_dev *rdev) * and we have control then make sure it is enabled. */...
0fce75870666b46b700cfbd3216380b422f975da
Analyze and fix the following issue in the Linux kernel code: ACPI: CPPC: Limit perf ctrs in PCC check only to online CPUs
Problem Details: per_cpu(cpc_desc_ptr, cpu) object is initialized for only the online CPU via acpi_soft_cpu_online() --> __acpi_processor_start() --> acpi_cppc_processor_probe(). However the function cppc_perf_ctrs_in_pcc() checks if the CPPC perf-ctrs are in a PCC region for all the present CPUs, which breaks when th...
```diff diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 7492c9922866..3bdeeee3414e 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -1435,7 +1435,7 @@ bool cppc_perf_ctrs_in_pcc(void) { int cpu; - for_each_present_cpu(cpu) { + for_each_online_cpu(cpu) { struct cpc_r...
8821c8e80a65bc4eb73daf63b34aac6b8ad69461
Analyze and fix the following issue in the Linux kernel code: ACPI: CPPC: Perform fast check switch only for online CPUs
Problem Details: per_cpu(cpc_desc_ptr, cpu) object is initialized for only the online CPUs via acpi_soft_cpu_online() --> __acpi_processor_start() --> acpi_cppc_processor_probe(). However the function cppc_allow_fast_switch() checks for the validity of the _CPC object for all the present CPUs. This breaks when the ker...
```diff diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index da6b35ac8c87..7492c9922866 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -476,7 +476,7 @@ bool cppc_allow_fast_switch(void) struct cpc_desc *cpc_ptr; int cpu; - for_each_present_cpu(cpu) { + for_each_online_cp...
6dd3b8a709a130a4d55c866af9804c81b8486d28
Analyze and fix the following issue in the Linux kernel code: ACPI: CPPC: Check _CPC validity for only the online CPUs
Problem Details: per_cpu(cpc_desc_ptr, cpu) object is initialized for only the online CPUs via acpi_soft_cpu_online() --> __acpi_processor_start() --> acpi_cppc_processor_probe(). However the function acpi_cpc_valid() checks for the validity of the _CPC object for all the present CPUs. This breaks when the kernel is b...
```diff diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 6c684e54fe01..da6b35ac8c87 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -460,7 +460,7 @@ bool acpi_cpc_valid(void) if (acpi_disabled) return false; - for_each_present_cpu(cpu) { + for_each_online_cpu(cpu) { ...
4fe5934db4a7187d358f1af1b3ef9b6dd59bce58
Analyze and fix the following issue in the Linux kernel code: ACPI: CPPC: Detect preferred core availability on online CPUs
Problem Details: Commit 279f838a61f9 ("x86/amd: Detect preferred cores in amd_get_boost_ratio_numerator()") introduced the ability to detect the preferred core on AMD platforms by checking if there at least two distinct highest_perf values. However, it uses for_each_present_cpu() to iterate through all the CPUs in the...
```diff diff --git a/arch/x86/kernel/acpi/cppc.c b/arch/x86/kernel/acpi/cppc.c index 7047124490f6..d7c8ef1e354d 100644 --- a/arch/x86/kernel/acpi/cppc.c +++ b/arch/x86/kernel/acpi/cppc.c @@ -196,7 +196,7 @@ int amd_detect_prefcore(bool *detected) break; } - for_each_present_cpu(cpu) { + for_each_online_cpu(cpu) ...
ed4f9638d905a97cebd49ecea85cc9b706b73761
Analyze and fix the following issue in the Linux kernel code: x86/apic: Fix frequency in apic=verbose log output
Problem Details: When apic=verbose is specified, the LAPIC timer calibration prints its results to the console. At least while debugging virtualization code, the CPU and bus frequencies are printed incorrectly. Specifically, for a 1.7 GHz CPU with 1 GHz bus frequency and HZ=1000, the log includes a superfluous 0 after...
```diff diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 680d305589a3..ca1c8b70ac44 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -173,6 +173,7 @@ static struct resource lapic_resource = { .flags = IORESOURCE_MEM | IORESOURCE_BUSY, }; +/* Measured in tick...
b6cfddd26ec55e865b4715f73e9bbb17a15091ed
Analyze and fix the following issue in the Linux kernel code: cxl: Adjust offset calculation for poison injection
Problem Details: The HPA to DPA translation for poison injection assumes that the base address starts from where the CXL region begins. When the extended linear cache is active, the offset can be within the DRAM region. Adjust the offset so that it correctly reflects the offset within the CXL region. [ dj: Add fixes t...
```diff diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index b06fee1978ba..41b64d871c5a 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -3702,6 +3702,7 @@ static int cxl_region_debugfs_poison_inject(void *data, u64 offset) if (validate_region_offset(cxlr, offset)) retu...
4012abe8a78fbb8869634130024266eaef7081fe
Analyze and fix the following issue in the Linux kernel code: smb: client: validate change notify buffer before copy
Problem Details: SMB2_change_notify called smb2_validate_iov() but ignored the return code, then kmemdup()ed using server provided OutputBufferOffset/Length. Check the return of smb2_validate_iov() and bail out on error. Discovered with help from the ZeroPath security tooling. Signed-off-by: Joshua Rogers <linux@jos...
```diff diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c index b0739a2661bf..8b4a4573e9c3 100644 --- a/fs/smb/client/smb2pdu.c +++ b/fs/smb/client/smb2pdu.c @@ -4054,9 +4054,12 @@ replay_again: smb_rsp = (struct smb2_change_notify_rsp *)rsp_iov.iov_base; - smb2_validate_iov(le16_to_cpu(smb_rsp->Ou...
0b6c10cb8479d0d1b7b208277df2e2afe082d4bd
Analyze and fix the following issue in the Linux kernel code: PM: hibernate: Fix style issues in save_compressed_image()
Problem Details: Address two issues indicated by checkpatch: - Trailing statements should be on next line. - Prefer 'unsigned int' to bare use of 'unsigned'. Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> [ rjw: Changelog edits ] Link: https://patch.msgid.link/20251106045158.3198061-4-superm1@kernel.or...
```diff diff --git a/kernel/power/swap.c b/kernel/power/swap.c index e0441483dbee..70ae21f7370d 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -689,7 +689,7 @@ static int save_compressed_image(struct swap_map_handle *handle, ktime_t start; ktime_t stop; size_t off; - unsigned thr, run_threads, nr_t...
66ededc694f1d06a71ca35a3c8e3689e9b85b3ce
Analyze and fix the following issue in the Linux kernel code: PM: hibernate: Use atomic64_t for compressed_size variable
Problem Details: `compressed_size` can overflow, showing nonsensical values. Change from `atomic_t` to `atomic64_t` to prevent overflow. Fixes: a06c6f5d3cc9 ("PM: hibernate: Move to crypto APIs for LZO compression") Reported-by: Askar Safin <safinaskar@gmail.com> Closes: https://lore.kernel.org/linux-pm/2025110518050...
```diff diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 7daa716d2cb1..e0441483dbee 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -635,7 +635,7 @@ struct cmp_data { }; /* Indicates the image size after compression */ -static atomic_t compressed_size = ATOMIC_INIT(0); +static atomic64_t c...
62b9ca1706e1bbb60d945a58de7c7b5826f6b2a2
Analyze and fix the following issue in the Linux kernel code: PM: hibernate: Emit an error when image writing fails
Problem Details: If image writing fails, a return code is passed up to the caller, but none of the callers log anything to the log and so the only record of it is the return code that userspace gets. Adjust the logging so that the image size and speed of writing is only emitted on success and if there is an error, it'...
```diff diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 0beff7eeaaba..7daa716d2cb1 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -877,11 +877,14 @@ out_finish: stop = ktime_get(); if (!ret) ret = err2; - if (!ret) + if (!ret) { + swsusp_show_speed(start, stop, nr_to_write, "Wrote");...
965930962a41cdb24a4b0e1c2f580b20b139bacb
Analyze and fix the following issue in the Linux kernel code: drm/i915/frontbuffer: Fix intel_frontbuffer lifetime handling
Problem Details: The current attempted split between xe/i915 vs. display for intel_frontbuffer is a mess: - the i915 rcu leaks through the interface to the display side - the obj->frontbuffer write-side is now protected by a display specific spinlock even though the actual obj->framebuffer pointer lives in a i915 s...
```diff diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile index 84ec79b64960..49c86a0d44f9 100644 --- a/drivers/gpu/drm/i915/Makefile +++ b/drivers/gpu/drm/i915/Makefile @@ -156,6 +156,7 @@ gem-y += \ gem/i915_gem_lmem.o \ gem/i915_gem_mman.o \ gem/i915_gem_object.o \ + gem/i915_gem_objec...
39ce15a48f6730c8e53cc8fd0f63995a5e4bb239
Analyze and fix the following issue in the Linux kernel code: Documentation: power: Correct a mistaken configuration option
Problem Details: Somehow CONFIG_PSTORE_FIRMWARE ended up in this document when I intended it to be CONFIG_CHROMEOS_PSTORE. Correct the configuration option and make it clear that not all options are required. Fixes: b1f02f005a2e ("Documentation: power: Add document on debugging shutdown hangs") Reported-by: Rodrigo S...
```diff diff --git a/Documentation/power/shutdown-debugging.rst b/Documentation/power/shutdown-debugging.rst index cdfa2cd90e5c..c510122e0bbc 100644 --- a/Documentation/power/shutdown-debugging.rst +++ b/Documentation/power/shutdown-debugging.rst @@ -24,11 +24,11 @@ following kernel configuration options: * ``CONFIG_P...
9ad648017b1813a05c4ce899e5e454ec3adb1dfe
Analyze and fix the following issue in the Linux kernel code: iommu/iommupt: Fix build error in genericpt unit-tests
Problem Details: Fix the include of iommu-pages.h in the KUnit tests for the IOMMU generic page-table code to make the tests compile again. Reported-by: Thorsten Leemhuis <linux@leemhuis.info> Closes: https://lore.kernel.org/all/9844d4cb-f517-478b-9911-b6dc1a963b8e@leemhuis.info/ Reported-by: "Longia, Amandeep Kaur" <...
```diff diff --git a/drivers/iommu/generic_pt/kunit_iommu.h b/drivers/iommu/generic_pt/kunit_iommu.h index 5d4f269627d5..22c9e4c4dd97 100644 --- a/drivers/iommu/generic_pt/kunit_iommu.h +++ b/drivers/iommu/generic_pt/kunit_iommu.h @@ -8,7 +8,7 @@ #define GENERIC_PT_KUNIT 1 #include <kunit/device.h> #include <kunit/t...
7f1635737823a6c0c412ccf3767a12bec642c10f
Analyze and fix the following issue in the Linux kernel code: arm64: proton-pack: Fix hard lockup due to print in scheduler context
Problem Details: Relocate the printk() calls from spectre_v4_mitigations_off() and spectre_v2_mitigations_off() into setup_system_capabilities() function, preventing hard lockups caused by printk calls in scheduler context: | _raw_spin_lock_nested+168 | ttwu_queue+180 (rq_lock(rq, &rf); 2nd acquiring the rq->__loc...
```diff diff --git a/arch/arm64/include/asm/spectre.h b/arch/arm64/include/asm/spectre.h index 8fef12626090..900454aaa292 100644 --- a/arch/arm64/include/asm/spectre.h +++ b/arch/arm64/include/asm/spectre.h @@ -117,6 +117,7 @@ void spectre_bhb_patch_wa3(struct alt_instr *alt, __le32 *origptr, __le32 *updptr, int...
ce2b3a50ad922abbba36425343a1bcec46903a26
Analyze and fix the following issue in the Linux kernel code: arm64: mm: Don't sleep in split_kernel_leaf_mapping() when in atomic context
Problem Details: It has been reported that split_kernel_leaf_mapping() is trying to sleep in non-sleepable context. It does this when acquiring the pgtable_split_lock mutex, when either CONFIG_DEBUG_PAGEALLOC or CONFIG_KFENCE are enabled, which change linear map permissions within softirq context during memory allocati...
```diff diff --git a/arch/arm64/include/asm/kfence.h b/arch/arm64/include/asm/kfence.h index a81937fae9f6..21dbc9dda747 100644 --- a/arch/arm64/include/asm/kfence.h +++ b/arch/arm64/include/asm/kfence.h @@ -10,8 +10,6 @@ #include <asm/set_memory.h> -static inline bool arch_kfence_init_pool(void) { return true; } -...
0ec364c0c95fc85bcbc88f1a9a06ebe83c88e18c
Analyze and fix the following issue in the Linux kernel code: arm64: kprobes: check the return value of set_memory_rox()
Problem Details: Since commit a166563e7ec3 ("arm64: mm: support large block mapping when rodata=full"), __change_memory_common has more chance to fail due to memory allocation failure when splitting page table. So check the return value of set_memory_rox(), then bail out if it fails otherwise we may have RW memory mapp...
```diff diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c index 8ab6104a4883..43a0361a8bf0 100644 --- a/arch/arm64/kernel/probes/kprobes.c +++ b/arch/arm64/kernel/probes/kprobes.c @@ -49,7 +49,10 @@ void *alloc_insn_page(void) addr = execmem_alloc(EXECMEM_KPROBES, PAGE_SIZE); if (...
eeb8c19896952e18fb538ec76e603884070a6c6a
Analyze and fix the following issue in the Linux kernel code: Revert "ACPI: Suppress misleading SPCR console message when SPCR table is absent"
Problem Details: This reverts commit bad3fa2fb9206f4dcec6ddef094ec2fbf6e8dcb2. Commit bad3fa2fb920 ("ACPI: Suppress misleading SPCR console message when SPCR table is absent") mistakenly assumes acpi_parse_spcr() returning 0 to indicate a failure to parse SPCR. While addressing the resultant incorrect logging it was d...
```diff diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index 7aca29e1d30b..fd164e8a35b2 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -197,8 +197,6 @@ out: */ void __init acpi_boot_table_init(void) { - int ret; - /* * Enable ACPI instead of device tree unless * - ...
453a73000c56d2ee21f327c0a2a3249aa359bcc9
Analyze and fix the following issue in the Linux kernel code: Documentation: nova: Update the todo list
Problem Details: This small patch updates the nova todo list to remove some tasks that have been solved lately: * COHA is solved in this patch series * TRSM was solved recently [1] [1] https://lore.kernel.org/rust-for-linux/DCEJ9SV4LBJL.11EUZVXX6EB9H@nvidia.com/ Signed-off-by: Daniel del Castillo <delcastillodelarosa...
```diff diff --git a/Documentation/gpu/nova/core/todo.rst b/Documentation/gpu/nova/core/todo.rst index c55c7bedbfdf..35cc7c31d423 100644 --- a/Documentation/gpu/nova/core/todo.rst +++ b/Documentation/gpu/nova/core/todo.rst @@ -44,25 +44,6 @@ automatically generates the corresponding mappings between a value and a numbe...
3577e265e4bdb09441941a52c1bf9dfd1e27d707
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: Simplify `DmaObject::from_data` in nova-core/dma.rs
Problem Details: This patch solves one of the existing mentions of COHA, a task in the Nova task list about improving the `CoherentAllocation` API. It uses the `write` method from `CoherentAllocation`. Signed-off-by: Daniel del Castillo <delcastillodelarosadaniel@gmail.com> [acourbot@nvidia.com: set prefix to "gpu: no...
```diff diff --git a/drivers/gpu/nova-core/dma.rs b/drivers/gpu/nova-core/dma.rs index 5b117aefdb15..7215398969da 100644 --- a/drivers/gpu/nova-core/dma.rs +++ b/drivers/gpu/nova-core/dma.rs @@ -30,20 +30,11 @@ impl DmaObject { } pub(crate) fn from_data(dev: &device::Device<device::Bound>, data: &[u8]) -> R...
571ce401a78ee9cb5992b74d36df1b6a8ffd4b16
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: Fix capitalization of some comments
Problem Details: Some comments that already existed didn't start with a capital letter, this patch fixes that. Signed-off-by: Daniel del Castillo <delcastillodelarosadaniel@gmail.com> [acourbot@nvidia.com: set prefix to "gpu: nova-core:".] Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Message-ID: <20251104193...
```diff diff --git a/drivers/gpu/nova-core/firmware/fwsec.rs b/drivers/gpu/nova-core/firmware/fwsec.rs index e06ae931bf55..cb794e406395 100644 --- a/drivers/gpu/nova-core/firmware/fwsec.rs +++ b/drivers/gpu/nova-core/firmware/fwsec.rs @@ -59,7 +59,7 @@ struct FalconAppifHdrV1 { entry_size: u8, entry_count: u8...
473f778592e499c0dd0e1dd9fce8eb80923355d9
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: Simplify `transmute` and `transmute_mut` in fwsec.rs
Problem Details: This patch solves one of the existing mentions of COHA, a task in the Nova task list about improving the `CoherentAllocation` API. It uses the new `from_bytes` method from the `FromBytes` trait as well as the `as_slice` and `as_slice_mut` methods from `CoherentAllocation`. Signed-off-by: Daniel del Ca...
```diff diff --git a/drivers/gpu/nova-core/firmware/fwsec.rs b/drivers/gpu/nova-core/firmware/fwsec.rs index 8dbc6b516d27..e06ae931bf55 100644 --- a/drivers/gpu/nova-core/firmware/fwsec.rs +++ b/drivers/gpu/nova-core/firmware/fwsec.rs @@ -12,11 +12,8 @@ use core::{ marker::PhantomData, - mem::{ - alig...
bd24f9beed591422f45fa6d8d0d3bd3a755b8a48
Analyze and fix the following issue in the Linux kernel code: perf/x86/intel: Add a check for dynamic constraints
Problem Details: The current event scheduler has a limit. If the counter constraint of an event is not a subset of any other counter constraint with an equal or higher weight. The counters may not be fully utilized. To workaround it, the commit bc1738f6ee83 ("perf, x86: Fix event scheduler for constraints with overlap...
```diff diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index cb64018321dd..93780affeec8 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -5420,6 +5420,151 @@ static void intel_pmu_check_event_constraints(struct event_constraint *event_con u64 fixed_cn...
5e4e355ae7cdeb0fef5dbe908866e1f895abfacc
Analyze and fix the following issue in the Linux kernel code: perf/x86/intel: Correct large PEBS flag check
Problem Details: current large PEBS flag check only checks if sample_regs_user contains unsupported GPRs but doesn't check if sample_regs_intr contains unsupported GPRs. Of course, currently PEBS HW supports to sample all perf supported GPRs, the missed check doesn't cause real issue. But it won't be true any more aft...
```diff diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 46a000eb0bb3..c88bcd5d2bc4 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -4029,7 +4029,9 @@ static unsigned long intel_pmu_large_pebs_flags(struct perf_event *event) if (!event->attr.exclude_kernel...
7e772a93eb61cb6265bdd1c5bde17d0f2718b452
Analyze and fix the following issue in the Linux kernel code: perf/x86: Fix NULL event access and potential PEBS record loss
Problem Details: When intel_pmu_drain_pebs_icl() is called to drain PEBS records, the perf_event_overflow() could be called to process the last PEBS record. While perf_event_overflow() could trigger the interrupt throttle and stop all events of the group, like what the below call-chain shows. perf_event_overflow() ...
```diff diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 0cf68ad9dcd0..b2868fee765b 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -1344,6 +1344,7 @@ static void x86_pmu_enable(struct pmu *pmu) hwc->state |= PERF_HES_ARCH; x86_pmu_stop(event, PERF_EF_UPDATE); + cpuc->...
7ab06ea41af53aa1713186ceaa154179e4b0d4c9
Analyze and fix the following issue in the Linux kernel code: arch_topology: Provide a stub topology_core_has_smt() for !CONFIG_GENERIC_ARCH_TOPOLOGY
Problem Details: The arm_pmu driver is using topology_core_has_smt() for retrieving the SMT implementation which depends on CONFIG_GENERIC_ARCH_TOPOLOGY. The config is optional on arm platforms so provide a !CONFIG_GENERIC_ARCH_TOPOLOGY stub for topology_core_has_smt(). Fixes: c3d78c34ad00 ("perf: arm_pmuv3: Don't use...
```diff diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h index daa1af2e8204..0c2a8b846c20 100644 --- a/include/linux/arch_topology.h +++ b/include/linux/arch_topology.h @@ -100,6 +100,10 @@ static inline bool topology_core_has_smt(int cpu) return cpu_topology[cpu].thread_id != -1; } -#end...
2d7a824807015209de4dd58c7ac240c5a276753e
Analyze and fix the following issue in the Linux kernel code: perf/arm-ni: Fix and optimise register offset calculation
Problem Details: LKP points out an operator precedence oversight in the new NoC S3 support that, annoyingly, my local W=1 build didn't flag. In fixing that, we can also take the similarly-missed opportunity to cache the version check itself at event_init time. Reported-by: kernel test robot <lkp@intel.com> Closes: htt...
```diff diff --git a/drivers/perf/arm-ni.c b/drivers/perf/arm-ni.c index aa824abc629e..66858c65215d 100644 --- a/drivers/perf/arm-ni.c +++ b/drivers/perf/arm-ni.c @@ -323,9 +323,15 @@ static int arm_ni_validate_group(struct perf_event *event) return 0; } +static bool arm_ni_is_7xx(const struct arm_ni *ni) +{ + ret...