id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
972ca7a3bc9a136b15ba698713b056a4900e2634
Analyze and fix the following issue in the Linux kernel code: tcp: do not set a zero size receive buffer
Problem Details: The nipa CI is reporting frequent failures in the mptcp_connect self-tests. In the failing scenarios (TCP -> MPTCP) the involved sockets are actually plain TCP ones, as fallback for passive socket at 2whs time cause the MPTCP listener to actually create a TCP socket. The transfer is stuck due to the ...
```diff diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 672cbfbdcec1..81b6d3770812 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -5549,6 +5549,10 @@ static int tcp_prune_queue(struct sock *sk, const struct sk_buff *in_skb) { struct tcp_sock *tp = tcp_sk(sk); + /* Do nothing if our ...
82aac553372cd201b91a8b064be0cd5a501932b2
Analyze and fix the following issue in the Linux kernel code: perf pmu: Switch FILENAME_MAX to NAME_MAX
Problem Details: FILENAME_MAX is the same as PATH_MAX (4kb) in glibc rather than NAME_MAX's 255. Switch to using NAME_MAX and ensure the '\0' is accounted for in the path's buffer size. Fixes: 754baf426e09 ("perf pmu: Change aliases from list to hashmap") Signed-off-by: Ian Rogers <irogers@google.com> Link: https://lo...
```diff diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index b09b2ea2407a..f3da6e27bfcb 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -453,7 +453,7 @@ static struct perf_pmu_alias *perf_pmu__find_alias(struct perf_pmu *pmu, { struct perf_pmu_alias *alias; bool has_sysfs_event; - cha...
478272d1cdd9959a6d638e9d81f70642f04290c9
Analyze and fix the following issue in the Linux kernel code: tools subcmd: Tighten the filename size in check_if_command_finished
Problem Details: FILENAME_MAX is often PATH_MAX (4kb), far more than needed for the /proc path. Make the buffer size sufficient for the maximum integer plus "/proc/" and "/status" with a '\0' terminator. Fixes: 5ce42b5de461 ("tools subcmd: Add non-waitpid check_if_command_finished()") Signed-off-by: Ian Rogers <iroger...
```diff diff --git a/tools/lib/subcmd/run-command.c b/tools/lib/subcmd/run-command.c index 0a764c25c384..b7510f83209a 100644 --- a/tools/lib/subcmd/run-command.c +++ b/tools/lib/subcmd/run-command.c @@ -5,6 +5,7 @@ #include <ctype.h> #include <fcntl.h> #include <string.h> +#include <linux/compiler.h> #include <linu...
5ec9d26b78c4eb7c2fab54dcec6c0eb845302a98
Analyze and fix the following issue in the Linux kernel code: cdrom: Call cdrom_mrw_exit from cdrom_release function
Problem Details: Remove the cdrom_mrw_exit call from unregister_cdrom, as it invokes block commands that can fail due to a NULL pointer dereference from the call happening too late, during the unloading of the driver (e.g. unplugging of USB optical drives). Instead perform the call inside cdrom_release, thus also remo...
```diff diff --git a/Documentation/cdrom/cdrom-standard.rst b/Documentation/cdrom/cdrom-standard.rst index 6c1303cff159..b97a4e9b9bd3 100644 --- a/Documentation/cdrom/cdrom-standard.rst +++ b/Documentation/cdrom/cdrom-standard.rst @@ -273,7 +273,6 @@ The drive-specific, minor-like information that is registered with ...
502ffa43994de8f038101e0920e8e87d9756c4d8
Analyze and fix the following issue in the Linux kernel code: tracing: Fix comment in trace_module_remove_events()
Problem Details: Fix typo "allocade" -> "allocated". Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Link: https://lore.kernel.org/20250710095628.42ed6b06@batman.local.home Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
```diff diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 0980f4def360..6c0783fc4c2c 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -3695,7 +3695,7 @@ static void trace_module_remove_events(struct module *mod) if (call->module == mod) __trace_remove_event...
07c3f391bcb217b6949b49785ccb5fee02be21fe
Analyze and fix the following issue in the Linux kernel code: tracing: Remove EVENT_FILE_FL_SOFT_MODE flag
Problem Details: When soft disabling of trace events was first created, it needed to have a way to know if a file had a user that was using it with soft disabled (for triggers that need to enable or disable events from a context that can not really enable or disable the event, it would set SOFT_DISABLED to state it is ...
```diff diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h index fa9cf4292dff..04307a19cde3 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -480,7 +480,6 @@ enum { EVENT_FILE_FL_RECORDED_TGID_BIT, EVENT_FILE_FL_FILTERED_BIT, EVENT_FILE_FL_NO_SET_FILTER_BIT, - ...
dff64b072708ffef23c117fa1ee1ea59eb417807
Analyze and fix the following issue in the Linux kernel code: rust: Add warn_on macro
Problem Details: Add warn_on macro, uses the BUG/WARN feature (lib/bug.c) via assembly for x86_64/arm64/riscv. The current Rust code simply wraps BUG() macro but doesn't provide the proper debug information. The BUG/WARN feature can only be used from assembly. This uses the assembly code exported by the C side via AR...
```diff diff --git a/rust/Makefile b/rust/Makefile index 27dec7904c3a..4e675d210dd8 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -34,6 +34,9 @@ obj-$(CONFIG_RUST_KERNEL_DOCTESTS) += doctests_kernel_generated.o obj-$(CONFIG_RUST_KERNEL_DOCTESTS) += doctests_kernel_generated_kunit.o always-$(subst y,$(CONFIG_RUS...
119a5d573622ae90ba730d18acfae9bb75d77b9a
Analyze and fix the following issue in the Linux kernel code: ring-buffer: Remove ring_buffer_read_prepare_sync()
Problem Details: When the ring buffer was first introduced, reading the non-consuming "trace" file required disabling the writing of the ring buffer. To make sure the writing was fully disabled before iterating the buffer with a non-consuming read, it would set the disable flag of the buffer and then call an RCU synchr...
```diff diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index cd7f0ae26615..bc90c3c7b5fd 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h @@ -152,9 +152,7 @@ ring_buffer_consume(struct trace_buffer *buffer, int cpu, u64 *ts, unsigned long *lost_events); struct ...
8b325091b76f7a4213d2d6b5c7717d87c2c36e62
Analyze and fix the following issue in the Linux kernel code: tpm_crb_ffa: Fix typos in function name
Problem Details: Rename *recieve as __tpm_crb_ffa_send_receive [jarkko: polished commit message] Signed-off-by: Prachotan Bathi <prachotan.bathi@arm.com> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
```diff diff --git a/drivers/char/tpm/tpm_crb_ffa.c b/drivers/char/tpm/tpm_crb_ffa.c index 9c6a2988a598..a4e7fcfa223a 100644 --- a/drivers/char/tpm/tpm_crb_ffa.c +++ b/drivers/char/tpm/tpm_crb_ffa.c @@ -189,7 +189,7 @@ int tpm_crb_ffa_init(void) } EXPORT_SYMBOL_GPL(tpm_crb_ffa_init); -static int __tpm_crb_ffa_send_...
89dd3695de4b8b17f0cded7c4b695b775b4d1d29
Analyze and fix the following issue in the Linux kernel code: tpm_crb_ffa: Remove unused export
Problem Details: Remove the export of tpm_crb_ffa_get_interface_version() as it has no callers outside tpm_crb_ffa. Fixes: eb93f0734ef1 ("tpm_crb: ffa_tpm: Implement driver compliant to CRB over FF-A") Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@opinsys.com> Reviewed-by: Yeoreum Yun <yeoreum.yun@arm.com> Signed-of...
```diff diff --git a/drivers/char/tpm/tpm_crb_ffa.c b/drivers/char/tpm/tpm_crb_ffa.c index 462fcf610020..9c6a2988a598 100644 --- a/drivers/char/tpm/tpm_crb_ffa.c +++ b/drivers/char/tpm/tpm_crb_ffa.c @@ -247,7 +247,7 @@ static int __tpm_crb_ffa_send_recieve(unsigned long func_id, * * Return: 0 on success, negative e...
5c0d0ee36f168f6962a710205436533be31c9a42
Analyze and fix the following issue in the Linux kernel code: PCI: Support Immediate Readiness on devices without PM capabilities
Problem Details: Query support for Immediate Readiness irrespective of whether or not the device supports PM capabilities, as nothing in the PCIe spec suggests that Immediate Readiness is in any way dependent on PM functionality. Fixes: d6112f8def51 ("PCI: Add support for Immediate Readiness") Signed-off-by: Sean Chri...
```diff diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index e9448d55113b..d3b059067ba0 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -3205,7 +3205,6 @@ void pci_pm_power_up_and_verify_state(struct pci_dev *pci_dev) void pci_pm_init(struct pci_dev *dev) { int pm; - u16 status; u16 pmc; device_...
54edba916e2913b0893b0f6404b73155d48374ea
Analyze and fix the following issue in the Linux kernel code: clk: thead: th1520-ap: Describe mux clocks with clk_mux
Problem Details: Mux clocks are now described with a customized ccu_mux structure consisting of ccu_internal and ccu_common substructures, and registered later with devm_clk_hw_register_mux_parent_data_table(). As this helper always allocates a new clk_hw structure, it's extremely hard to use mux clocks as parents stat...
```diff diff --git a/drivers/clk/thead/clk-th1520-ap.c b/drivers/clk/thead/clk-th1520-ap.c index 5a102beb6ac1..cf1bba58f641 100644 --- a/drivers/clk/thead/clk-th1520-ap.c +++ b/drivers/clk/thead/clk-th1520-ap.c @@ -42,8 +42,9 @@ struct ccu_common { }; struct ccu_mux { - struct ccu_internal mux; - struct ccu_common ...
826230970a44a50227d4884835ea8a0f8825fe03
Analyze and fix the following issue in the Linux kernel code: arm64/bug: Add ARCH_WARN_ASM macro for BUG/WARN asm code sharing with Rust
Problem Details: Add new ARCH_WARN_ASM macro for BUG/WARN assembly code sharing with Rust to avoid the duplication. No functional changes. Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com> Link: https://lore.kernel.org/r/20250502094537.231725-4-fujita.tomon...
```diff diff --git a/arch/arm64/include/asm/asm-bug.h b/arch/arm64/include/asm/asm-bug.h index 6e73809f6492..a5f13801b784 100644 --- a/arch/arm64/include/asm/asm-bug.h +++ b/arch/arm64/include/asm/asm-bug.h @@ -21,16 +21,21 @@ #endif #ifdef CONFIG_GENERIC_BUG - -#define __BUG_ENTRY(flags) \ +#define __BUG_ENTRY...
8ad470d4e3dcd3db95d8bda6d35909a2ce897ca7
Analyze and fix the following issue in the Linux kernel code: riscv/bug: Add ARCH_WARN_ASM macro for BUG/WARN asm code sharing with Rust
Problem Details: Add new ARCH_WARN_ASM macro for BUG/WARN assembly code sharing with Rust to avoid the duplication. No functional changes. Acked-by: Alexandre Ghiti <alexghiti@rivosinc.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com> Link: https://lore.kernel.org/r/20250502094537.231725-3-fujita.tomono...
```diff diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h index 1aaea81fb141..4c03e20ad11f 100644 --- a/arch/riscv/include/asm/bug.h +++ b/arch/riscv/include/asm/bug.h @@ -31,40 +31,45 @@ typedef u32 bug_insn_t; #ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS #define __BUG_ENTRY_ADDR RISCV_INT " ...
8c8efa93db68bb9fbdb46b93d5b66ff18bdf3d18
Analyze and fix the following issue in the Linux kernel code: x86/bug: Add ARCH_WARN_ASM macro for BUG/WARN asm code sharing with Rust
Problem Details: Add new ARCH_WARN_ASM macro for BUG/WARN assembly code sharing with Rust to avoid the duplication. No functional changes. Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com> Link: https://lore.kernel.org/r/20250502094537.231725-2-fujita.t...
```diff diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h index f0e9acf72547..20fcb8507ad1 100644 --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h @@ -32,45 +32,42 @@ #ifdef CONFIG_GENERIC_BUG #ifdef CONFIG_X86_32 -# define __BUG_REL(val) ".long " __stringify(val) +# define __BUG...
661e9cd196598c7d2502260ebbe60970546cca35
Analyze and fix the following issue in the Linux kernel code: selftests/kexec: fix test_kexec_jump build
Problem Details: The test_kexec_jump program builds correctly when invoked from the top-level selftests/Makefile, which explicitly sets the OUTPUT variable. However, building directly in tools/testing/selftests/kexec fails with: make: *** No rule to make target '/test_kexec_jump', needed by 'test_kexec_jump.sh'. St...
```diff diff --git a/tools/testing/selftests/kexec/Makefile b/tools/testing/selftests/kexec/Makefile index e3000ccb9a5d..874cfdd3b75b 100644 --- a/tools/testing/selftests/kexec/Makefile +++ b/tools/testing/selftests/kexec/Makefile @@ -12,7 +12,7 @@ include ../../../scripts/Makefile.arch ifeq ($(IS_64_BIT)$(ARCH_PROC...
912b1f2a796ec73530a709b11821cb0c249fb23e
Analyze and fix the following issue in the Linux kernel code: arm64: dts: rockchip: Drop netdev led-triggers on NanoPi R5S
Problem Details: Sometimes the netdev triggers causes tasks to get blocked for more then 120 seconds, which in turn makes the (WAN) network port on the NanoPi R5S fail to come up. This results in the following (partial) trace: INFO: task kworker/0:1:11 blocked for more than 120 seconds. Not tainted 6.16-rc6+...
```diff diff --git a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts index 3b31f0dd8f3b..539edc3c535f 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts +++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts @@ -29,7 +29,6 @@ function-enumerator...
17c1f960cbf0b93ba22e2d619718343fbdf819ab
Analyze and fix the following issue in the Linux kernel code: PCI: xgene-msi: Sanitise MSI allocation and affinity setting
Problem Details: Plugging a device that doesn't use managed affinity on an XGene-1 machine results in messages such as: genirq: irq_chip PCI-MSIX-0000:01:00.0 did not update eff. affinity mask of irq 39 As it turns out, the driver was never updated to populate the effective affinity on irq_set_affinity() call, and ...
```diff diff --git a/drivers/pci/controller/pci-xgene-msi.c b/drivers/pci/controller/pci-xgene-msi.c index cef0488749e1..954bc5513164 100644 --- a/drivers/pci/controller/pci-xgene-msi.c +++ b/drivers/pci/controller/pci-xgene-msi.c @@ -6,6 +6,7 @@ * Author: Tanmay Inamdar <tinamdar@apm.com> * Duc Dang <dhdang@apm...
ffab86698c260414bc4218e7c89dc0531d5dd159
Analyze and fix the following issue in the Linux kernel code: dt-bindings: vendor-prefixes: Add Axiado Corporation
Problem Details: Link: https://axiado.com Acked-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Harshit Shah <hshah@axiado.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
```diff diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 5d2a7a8d3ac6..5ada930c79e3 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -200,6 +200,8 @@ patte...
8c493cc91f3a1102ad2f8c75ae0cf80f0a057488
Analyze and fix the following issue in the Linux kernel code: PCI/pwrctrl: Create pwrctrl devices only when CONFIG_PCI_PWRCTRL is enabled
Problem Details: If devicetree describes power supplies related to a PCI device, we unnecessarily created a pwrctrl device even if CONFIG_PCI_PWRCTL was not enabled. We only need pci_pwrctrl_create_device() when CONFIG_PCI_PWRCTRL is enabled. Compile it out when CONFIG_PCI_PWRCTRL is not enabled. When pci_pwrctrl_cr...
```diff diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 4b8693ec9e4c..e6a34db77826 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2508,6 +2508,7 @@ bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *l, } EXPORT_SYMBOL(pci_bus_read_dev_vendor_id); +#if IS_ENABLED(CONFIG...
931837cd924048ab785eedb4cee5b276c90a2924
Analyze and fix the following issue in the Linux kernel code: ALSA: hda/realtek: Fix mute LED mask on HP OMEN 16 laptop
Problem Details: this patch is to fix my previous Commit <e5182305a519> i have fixed mute led but for by This patch corrects the coefficient mask value introduced in commit <e5182305a519>, which was intended to enable the mute LED functionality. During testing, multiple values were evaluated, and an incorrect value was...
```diff diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index b017eeabbd7e..2627e2f49316 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -4753,7 +4753,7 @@ static void alc245_fixup_hp_mute_led_v1_coefbit(struct hda_codec *codec, if (action == HDA_FIXUP_ACT_...
176f44a5ec0b074aaf44852db77d0c183c36696d
Analyze and fix the following issue in the Linux kernel code: drm/xe/uc: Fix missing unwind goto
Problem Details: Fix missing unwind goto on error handling. Fixes: b2c4ac219fa4 ("drm/xe/uc: Disable GuC communication on hardware initialization error") Signed-off-by: Zhanjun Dong <zhanjun.dong@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Li...
```diff diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c index 3e0c3af235f2..465bda355443 100644 --- a/drivers/gpu/drm/xe/xe_uc.c +++ b/drivers/gpu/drm/xe/xe_uc.c @@ -164,7 +164,7 @@ static int vf_uc_load_hw(struct xe_uc *uc) err = xe_guc_opt_in_features_enable(&uc->guc); if (err) - return er...
b43cb4ff85da5cf29c4cd351ef1d7dd8210780f7
Analyze and fix the following issue in the Linux kernel code: vt: defkeymap: Map keycodes above 127 to K_HOLE
Problem Details: The maximum number of keycodes got bumped to 256 a very long time ago, but the default keymaps were never adjusted to match. This is causing the kernel to interpret keycodes above 127 as U+0000 if the shipped generated keymap is used. Fix this by mapping all keycodes above 127 to K_HOLE so the kernel ...
```diff diff --git a/drivers/tty/vt/defkeymap.c_shipped b/drivers/tty/vt/defkeymap.c_shipped index 0c043e4f292e..6af7bf8d5460 100644 --- a/drivers/tty/vt/defkeymap.c_shipped +++ b/drivers/tty/vt/defkeymap.c_shipped @@ -23,6 +23,22 @@ unsigned short plain_map[NR_KEYS] = { 0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119...
b1cc2092ea7a52e2c435aee6d2b1bcb773202663
Analyze and fix the following issue in the Linux kernel code: vt: keyboard: Don't process Unicode characters in K_OFF mode
Problem Details: We don't process Unicode characters if the virtual terminal is in raw mode, so there's no reason why we shouldn't do the same for K_OFF (especially since people would expect K_OFF to actually turn off all VT key processing). Fixes: 9fc3de9c8356 ("vt: Add virtual console keyboard mode OFF") Signed-off-...
```diff diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c index dc585079c2fb..ee1d9c448c7e 100644 --- a/drivers/tty/vt/keyboard.c +++ b/drivers/tty/vt/keyboard.c @@ -1487,7 +1487,7 @@ static void kbd_keycode(unsigned int keycode, int down, bool hw_raw) rc = atomic_notifier_call_chain(&keyboard_notif...
a8d455db2621ff5223416ead264f346d8164c92f
Analyze and fix the following issue in the Linux kernel code: serial: 8250_dw: Fix typo "notifer"
Problem Details: There is a spelling mistake of 'notifer' in the comment which should be 'notifier'. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: WangYuli <wangyuli@uniontech.com> Link: https://lore.kernel.org/r/BD4804BF4FBA1648+20250722073431.21983-6-wangyuli@uniontech.com Signed-of...
```diff diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 0a22f0cb8896..a53ba04d9770 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -392,7 +392,7 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios, rate = cl...
35b6fc51c666fc96355be5cd633ed0fe4ccf68b2
Analyze and fix the following issue in the Linux kernel code: comedi: fix race between polling and detaching
Problem Details: syzbot reports a use-after-free in comedi in the below link, which is due to comedi gladly removing the allocated async area even though poll requests are still active on the wait_queue_head inside of it. This can cause a use-after-free when the poll entries are later triggered or removed, as the memor...
```diff diff --git a/drivers/comedi/comedi_fops.c b/drivers/comedi/comedi_fops.c index 3383a7ce27ff..3007fe946e42 100644 --- a/drivers/comedi/comedi_fops.c +++ b/drivers/comedi/comedi_fops.c @@ -787,6 +787,7 @@ static int is_device_busy(struct comedi_device *dev) struct comedi_subdevice *s; int i; + lockdep_asser...
2138e89cb066b40386b1d9ddd61253347d356474
Analyze and fix the following issue in the Linux kernel code: fs/orangefs: Allow 2 more characters in do_c_string()
Problem Details: The do_k_string() and do_c_string() functions do essentially the same thing which is they add a string and a comma onto the end of an existing string. At the end, the caller will overwrite the last comma with a newline. Later, in orangefs_kernel_debug_init(), we add a newline to the string. The chan...
```diff diff --git a/fs/orangefs/orangefs-debugfs.c b/fs/orangefs/orangefs-debugfs.c index e463d3c73533..1c375fb65018 100644 --- a/fs/orangefs/orangefs-debugfs.c +++ b/fs/orangefs/orangefs-debugfs.c @@ -769,8 +769,8 @@ static void do_k_string(void *k_mask, int index) if (*mask & s_kmod_keyword_mask_map[index].mask_...
63ce53724637e2e7ba51fe3a4f78351715049905
Analyze and fix the following issue in the Linux kernel code: sunvdc: Balance device refcount in vdc_port_mpgroup_check
Problem Details: Using device_find_child() to locate a probed virtual-device-port node causes a device refcount imbalance, as device_find_child() internally calls get_device() to increment the device’s reference count before returning its pointer. vdc_port_mpgroup_check() directly returns true upon finding a matching d...
```diff diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c index b5727dea15bd..7af21fe67671 100644 --- a/drivers/block/sunvdc.c +++ b/drivers/block/sunvdc.c @@ -957,8 +957,10 @@ static bool vdc_port_mpgroup_check(struct vio_dev *vdev) dev = device_find_child(vdev->dev.parent, &port_data, vdc_device_pro...
77de19b6867f2740cdcb6c9c7e50d522b47847a4
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to avoid out-of-boundary access in dnode page
Problem Details: As Jiaming Zhang reported: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x1c1/0x2a0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x17e/0x800 mm/kasan/report.c:480 kasan_report+0x147/0x180 mm/kasan/report.c:593 data_blkaddr fs/f2fs...
```diff diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 4b3d9070e299..76aba1961b54 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -815,6 +815,16 @@ int f2fs_get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode) for (i = 1; i <= level; i++) { bool done = false; + if (nids[i] && nids[i] == ...
1a9094b10cf7339e4aa8d8c004534200968b558c
Analyze and fix the following issue in the Linux kernel code: f2fs: Add f2fs_fs_context to record the mount options
Problem Details: At the parsing phase of mouont in the new mount api, options value will be recorded with the context, and then it will be used in fill_super and other helpers. Note that, this is a temporary status, we want remove the sb and sbi usages in handle_mount_opt. So here the f2fs_fs_context only records the ...
```diff diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 4f0cd790a24e..c84425771f0e 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -312,8 +312,56 @@ static match_table_t f2fs_checkpoint_tokens = { {Opt_err, NULL}, }; +#define F2FS_SPEC_background_gc (1 << 0) +#define F2FS_SPEC_inline_xattr_size (1 <<...
f2091cc188c60d6f9436b4da5bd75cda46665315
Analyze and fix the following issue in the Linux kernel code: f2fs: Add fs parameter specifications for mount options
Problem Details: Use an array of `fs_parameter_spec` called f2fs_param_specs to hold the mount option specifications for the new mount api. Add constant_table structures for several options to facilitate parsing. Signed-off-by: Hongbo Li <lihongbo22@huawei.com> [sandeen: forward port, minor fixes and updates, more fs...
```diff diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 73492270ea93..713dc55f086b 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -27,6 +27,7 @@ #include <linux/part_stat.h> #include <linux/zstd.h> #include <linux/lz4.h> +#include <linux/fs_parser.h> #include "f2fs.h" #include "node.h" @@ -196,9 +197...
5661998536af52848cc4d52a377e90368196edea
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to avoid out-of-boundary access in devs.path
Problem Details: - touch /mnt/f2fs/012345678901234567890123456789012345678901234567890123 - truncate -s $((1024*1024*1024)) \ /mnt/f2fs/012345678901234567890123456789012345678901234567890123 - touch /mnt/f2fs/file - truncate -s $((1024*1024*1024)) /mnt/f2fs/file - mkfs.f2fs /mnt/f2fs/012345678901234567890123456789012...
```diff diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index b2cc22b29d6a..dfddb66910b3 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1289,7 +1289,7 @@ struct f2fs_bio_info { struct f2fs_dev_info { struct file *bdev_file; struct block_device *bdev; - char path[MAX_PATH_LEN]; + char path[MAX_PATH_LEN + 1]; u...
d42e6c20de6192f8e4ab4cf10be8c694ef27e8cb
Analyze and fix the following issue in the Linux kernel code: arm64/entry: Mask DAIF in cpu_switch_to(), call_on_irq_stack()
Problem Details: `cpu_switch_to()` and `call_on_irq_stack()` manipulate SP to change to different stacks along with the Shadow Call Stack if it is enabled. Those two stack changes cannot be done atomically and both functions can be interrupted by SErrors or Debug Exceptions which, though unlikely, is very much broken :...
```diff diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index ad63457a05c5..c56c21bb1eec 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -41,6 +41,11 @@ /* * Save/restore interrupts. */ + .macro save_and_disable_daif, flags + mrs \fla...
1c20224123f41e4f7da44ae020832bdac3f30ec1
Analyze and fix the following issue in the Linux kernel code: remoteproc: xlnx: Fix kernel-doc warnings
Problem Details: Fix kernel-doc warnings generated by following command: `scripts/kernel-doc -Werror -Wshort-desc -Wall \ drivers/remoteproc/xlnx_r5_remoteproc.c > /dev/null` warning: missing initial short description on line: * struct mbox_info ... Total 8 warnings fixed Signed-off-by: Tanmay Shah <tanmay.shah@a...
```diff diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c index 0ffd26a47685..0b7b173d0d26 100644 --- a/drivers/remoteproc/xlnx_r5_remoteproc.c +++ b/drivers/remoteproc/xlnx_r5_remoteproc.c @@ -68,7 +68,7 @@ struct zynqmp_sram_bank { }; /** - * struct mbox_info + * struc...
f9db1fc56281b96fe8748632b3894de970a8a850
Analyze and fix the following issue in the Linux kernel code: ACPI: Fix typos
Problem Details: Fix typos in documentation and comments. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20250722132653.GA2781885@bhelgaas Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
```diff diff --git a/Documentation/ABI/testing/sysfs-firmware-acpi b/Documentation/ABI/testing/sysfs-firmware-acpi index f4de60c4134d..72e7c9161ce7 100644 --- a/Documentation/ABI/testing/sysfs-firmware-acpi +++ b/Documentation/ABI/testing/sysfs-firmware-acpi @@ -108,15 +108,15 @@ Description: number of a "General Pu...
5d3aeecc26bbc1321d4a1954093d6df396f80295
Analyze and fix the following issue in the Linux kernel code: ARM: sa110/gpio: convert set_multiple() to returning an integer
Problem Details: The conversion to using the new GPIO line setter callbacks missed the set_multiple() in this file. Convert it to using the new callback. Fixes: 9c3782118a57 ("ARM: sa1100/gpio: use new line value setter callbacks") Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Arnd...
```diff diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index 86b271cc29e1..d7e2ea27ce59 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c @@ -578,8 +578,8 @@ static int sa1111_gpio_set(struct gpio_chip *gc, unsigned int offset, int value) return 0; } -static void sa1111_gpio_se...
15a7ca747d9538c2ad8b0c81dd4c1261e0736c82
Analyze and fix the following issue in the Linux kernel code: drm/bridge: ti-sn65dsi86: Remove extra semicolon in ti_sn_bridge_probe()
Problem Details: As reported by the kernel test robot, a recent patch introduced an unnecessary semicolon. Remove it. Fixes: 55e8ff842051 ("drm/bridge: ti-sn65dsi86: Add HPD for DisplayPort connector type") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202506301704.0SBj6p...
```diff diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index de9c23537465..834b42a4d31f 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -1373,7 +1373,7 @@ static int ti_sn_bridge_probe(struct auxiliary_device *adev, regmap...
232b41d3c2ce8cf4641a174416676458bf0de5b2
Analyze and fix the following issue in the Linux kernel code: platform/x86: oxpec: Fix turbo register for G1 AMD
Problem Details: Turns out that the AMD variant of the G1 uses different EC registers than the Intel variant. Differentiate them and apply the correct ones to the AMD variant. Fixes: b369395c895b ("platform/x86: oxpec: Add support for the OneXPlayer G1") Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev> Link: http...
```diff diff --git a/drivers/platform/x86/oxpec.c b/drivers/platform/x86/oxpec.c index 06759036945d..9839e8cb82ce 100644 --- a/drivers/platform/x86/oxpec.c +++ b/drivers/platform/x86/oxpec.c @@ -58,7 +58,8 @@ enum oxp_board { oxp_mini_amd_a07, oxp_mini_amd_pro, oxp_x1, - oxp_g1, + oxp_g1_i, + oxp_g1_a, }; sta...
5b27388171a18cf6842c700520086ec50194e858
Analyze and fix the following issue in the Linux kernel code: drm/xe: Correct BMG VSEC header sizing
Problem Details: The intel_vsec_header information for the crashlog feature is incorrect. Update the VSEC header with correct sizing and count. Since the crashlog entries are "merged" (num_entries = 2), the separate capabilities entries must be merged as well. Fixes: 0c45e76fcc62 ("drm/xe/vsec: Support BMG devices")...
```diff diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c index 1bf7e709e110..56930ad42962 100644 --- a/drivers/gpu/drm/xe/xe_vsec.c +++ b/drivers/gpu/drm/xe/xe_vsec.c @@ -33,30 +33,19 @@ static struct intel_vsec_header bmg_telemetry = { .offset = BMG_DISCOVERY_OFFSET, }; -static struct inte...
0ba9e9cf76f2487654bc9bca38218780fa53030e
Analyze and fix the following issue in the Linux kernel code: drm/xe: Correct the rev value for the DVSEC entries
Problem Details: By definition, the Designated Vendor Specific Extended Capability (DVSEC) revision should be 1. Add the rev value to be correct. Fixes: 0c45e76fcc62 ("drm/xe/vsec: Support BMG devices") Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Reviewed-by: David E. Box <david.e.box@linux.intel.com> L...
```diff diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c index b378848d3b7b..1bf7e709e110 100644 --- a/drivers/gpu/drm/xe/xe_vsec.c +++ b/drivers/gpu/drm/xe/xe_vsec.c @@ -24,6 +24,7 @@ #define BMG_DEVICE_ID 0xE2F8 static struct intel_vsec_header bmg_telemetry = { + .rev = 1, .length = 0x10...
54d5cd4719c5e87f33d271c9ac2e393147d934f8
Analyze and fix the following issue in the Linux kernel code: platform/x86/intel/pmt: fix a crashlog NULL pointer access
Problem Details: Usage of the intel_pmt_read() for binary sysfs, requires a pcidev. The current use of the endpoint value is only valid for telemetry endpoint usage. Without the ep, the crashlog usage causes the following NULL pointer exception: BUG: kernel NULL pointer dereference, address: 0000000000000000 Oops: Oo...
```diff diff --git a/drivers/platform/x86/intel/pmt/class.c b/drivers/platform/x86/intel/pmt/class.c index a806a81ece52..5dd80109f591 100644 --- a/drivers/platform/x86/intel/pmt/class.c +++ b/drivers/platform/x86/intel/pmt/class.c @@ -99,7 +99,7 @@ intel_pmt_read(struct file *filp, struct kobject *kobj, if (count > e...
246570cd351299959822ac21e75e2975f80ce4b7
Analyze and fix the following issue in the Linux kernel code: ASoC: SDCA: Fix implicit cast from le16
Problem Details: As the HID wDescriptorLength is explicitly marked as little endian it should be converted to host endian before being used. Fixes: ac558015dfd8 ("ASoC: SDCA: add a HID device for HIDE entity") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202507221024.M18...
```diff diff --git a/sound/soc/sdca/sdca_hid.c b/sound/soc/sdca/sdca_hid.c index 2224ade59aff..967f7ec6fb79 100644 --- a/sound/soc/sdca/sdca_hid.c +++ b/sound/soc/sdca/sdca_hid.c @@ -24,7 +24,7 @@ static int sdwhid_parse(struct hid_device *hid) unsigned int rsize; int ret; - rsize = entity->hide.hid_desc.rpt_desc...
699cdd706290208d47bd858a188b030df2e90357
Analyze and fix the following issue in the Linux kernel code: remoteproc: xlnx: Disable unsupported features
Problem Details: AMD-Xilinx platform driver does not support iommu or recovery mechanism yet. Disable both features in platform driver. Signed-off-by: Tanmay Shah <tanmay.shah@amd.com> Link: https://lore.kernel.org/r/20250716213048.2316424-2-tanmay.shah@amd.com Fixes: 6b291e8020a8 ("drivers: remoteproc: Add Xilinx r5 ...
```diff diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c index a51523456c6e..0ffd26a47685 100644 --- a/drivers/remoteproc/xlnx_r5_remoteproc.c +++ b/drivers/remoteproc/xlnx_r5_remoteproc.c @@ -938,6 +938,8 @@ static struct zynqmp_r5_core *zynqmp_r5_add_rproc_core(struct dev...
ef93a685e01a281b5e2a25ce4e3428cf9371a205
Analyze and fix the following issue in the Linux kernel code: NFS: Fix filehandle bounds checking in nfs_fh_to_dentry()
Problem Details: The function needs to check the minimal filehandle length before it can access the embedded filehandle. Reported-by: zhangjian <zhangjian496@huawei.com> Fixes: 20fa19027286 ("nfs: add export operations") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
```diff diff --git a/fs/nfs/export.c b/fs/nfs/export.c index e9c233b6fd20..a10dd5f9d078 100644 --- a/fs/nfs/export.c +++ b/fs/nfs/export.c @@ -66,14 +66,21 @@ nfs_fh_to_dentry(struct super_block *sb, struct fid *fid, { struct nfs_fattr *fattr = NULL; struct nfs_fh *server_fh = nfs_exp_embedfh(fid->raw); - size_t f...
4a3556b81b99f0c8c0358f7cc6801a62b4538fe2
Analyze and fix the following issue in the Linux kernel code: phy: qcom: phy-qcom-m31: Update IPQ5332 M31 USB phy initialization sequence
Problem Details: The current configuration used for the IPQ5332 M31 USB PHY fails the Near End High Speed Signal Quality compliance test. To resolve this, update the initialization sequence as specified in the Hardware Design Document. Fixes: 08e49af50701 ("phy: qcom: Introduce M31 USB PHY driver") Cc: stable@kernel.o...
```diff diff --git a/drivers/phy/qualcomm/phy-qcom-m31.c b/drivers/phy/qualcomm/phy-qcom-m31.c index 7caeea1b109e..168ea980fda0 100644 --- a/drivers/phy/qualcomm/phy-qcom-m31.c +++ b/drivers/phy/qualcomm/phy-qcom-m31.c @@ -58,14 +58,16 @@ #define USB2_0_TX_ENABLE BIT(2) #define USB2PHY_USB_PHY_M31_XCFGI_4 0xc8 - ...
f31ac39c037a77a87e210b0f6d86fdefe8fc7258
Analyze and fix the following issue in the Linux kernel code: phy: exynos-mipi-video: correct cam0 sysreg property name for exynos7870
Problem Details: Fix the cam0 sysreg property name (samsung,cam0-sysreg), which has been erroneously declared as samsung,cam-sysreg. This follows the same name used in Exynos5433 PHY. Fixes: 543f5e314282 ("phy: exynos-mipi-video: introduce support for exynos7870") Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@...
```diff diff --git a/drivers/phy/samsung/phy-exynos-mipi-video.c b/drivers/phy/samsung/phy-exynos-mipi-video.c index b184923b9b40..be925508ed97 100644 --- a/drivers/phy/samsung/phy-exynos-mipi-video.c +++ b/drivers/phy/samsung/phy-exynos-mipi-video.c @@ -218,7 +218,7 @@ static const struct mipi_phy_device_desc exynos78...
7f5f703210109366c1e1b685086c9b0a4897ea54
Analyze and fix the following issue in the Linux kernel code: phy: qcom: phy-qcom-snps-eusb2: Add missing write from init sequence
Problem Details: As per a commit from Qualcomm's downstream 6.1 kernel[0], the init sequence is missing setting the CMN_CTRL_OVERRIDE_EN bit back to 0 at the end, as per the 'latest' HPG revision (as of November 2023). [0] https://git.codelinaro.org/clo/la/kernel/qcom/-/commit/b77774a89e3fda3246e09dd39e16e2ab43cd1329 ...
```diff diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c index 87f323e758d6..cd41d8a9f290 100644 --- a/drivers/phy/phy-snps-eusb2.c +++ b/drivers/phy/phy-snps-eusb2.c @@ -437,6 +437,9 @@ static int qcom_snps_eusb2_hsphy_init(struct phy *p) snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_HS...
67c632b4a7fbd6b76a08b86f4950f0f84de93439
Analyze and fix the following issue in the Linux kernel code: timekeeping: Zero initialize system_counterval when querying time from phc drivers
Problem Details: Most drivers only populate the fields cycles and cs_id of system_counterval in their get_time_fn() callback for get_device_system_crosststamp(), unless they explicitly provide nanosecond values. When the use_nsecs field was added to struct system_counterval, most drivers did not care. Clock sources o...
```diff diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index a009c91f7b05..83c65f3afcca 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1256,7 +1256,7 @@ int get_device_system_crosststamp(int (*get_time_fn) struct system_time_snapshot *history_begin, struct s...
dfef90f29811b5b8bc6353e259cac6134a88671f
Analyze and fix the following issue in the Linux kernel code: dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: Update pcie phy bindings for QCS615
Problem Details: QCS615 pcie phy only use 5 clocks, which are aux, cfg_ahb, ref, ref_gen, pipe. So move "qcom,qcs615-qmp-gen3x1-pcie-phy" compatible from 6 clocks' list to 5 clocks' list. Fixes: 1e889f2bd837 ("dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: Document the QCS615 QMP PCIe PHY Gen3 x1") Signed-off-by: Ziyue...
```diff diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml index 2c6c9296e4c0..a1ae8c7988c8 100644 --- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml +++ b/Documentation/devicetree/bindings/p...
708243c62efde8241e2c66e9c3f377658855149d
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: fix unassigned variable access
Problem Details: In ieee80211_latest_active_link_conn_timeout() we loop over all sta->links in order to compute the timeout expiring last across all links. Such timeout is stored in `latest_timeout` which is used in the time_after() comparison before having been initialized. Fix this behaviour by initializing the var...
```diff diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index b4b7ea52c65e..1008eb8e9b13 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -8521,7 +8521,7 @@ static void ieee80211_sta_bcn_mon_timer(struct timer_list *t) static unsigned long ieee80211_latest_active_link_conn_timeout(struct ieee80211...
1db3a48e83bb64a70bf27263b7002585574a9c2d
Analyze and fix the following issue in the Linux kernel code: NFS: Fix wakeup of __nfs_lookup_revalidate() in unblock_revalidate()
Problem Details: Use store_release_wake_up() to add the appropriate memory barrier before calling wake_up_var(&dentry->d_fsdata). Reported-by: Lukáš Hejtmánek<xhejtman@ics.muni.cz> Suggested-by: Santosh Pradhan <santosh.pradhan@gmail.com> Link: https://lore.kernel.org/all/18945D18-3EDB-4771-B019-0335CE671077@ics.muni....
```diff diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index d0e0b435a843..d81217923936 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1828,9 +1828,7 @@ static void block_revalidate(struct dentry *dentry) static void unblock_revalidate(struct dentry *dentry) { - /* store_release ensures wait_var_event() sees the update...
f06bedfa62d57f7b67d44aacd6badad2e13a803f
Analyze and fix the following issue in the Linux kernel code: pNFS/flexfiles: don't attempt pnfs on fatal DS errors
Problem Details: When an applications get killed (SIGTERM/SIGINT) while pNFS client performs a connection to DS, client ends in an infinite loop of connect-disconnect. This source of the issue, it that flexfilelayoutdev#nfs4_ff_layout_prepare_ds gets an error on nfs4_pnfs_ds_connect with status ERESTARTSYS, which is se...
```diff diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 4bea008dbebd..8dc921d83538 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -762,14 +762,14 @@ ff_layout_choose_ds_for_read(struct pnfs_layout_segment *lseg, { ...
c262b444bd0d6bfbcda65130e6137952bef422f6
Analyze and fix the following issue in the Linux kernel code: NFS: drop __exit from nfs_exit_keyring
Problem Details: Otherwise built-in NFS can lead to sectіon mismatches. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20250714062450.1468117-1-hch@lst.de Fixes: 87268f7a4f1f ("nfs: create a kernel keyring") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
```diff diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 60fa0c8ff04e..338ef77ae423 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -2663,7 +2663,7 @@ static int __init nfs_init_keyring(void) return PTR_ERR_OR_ZERO(nfs_keyring); } -static void __exit nfs_exit_keyring(void) +static void nfs_exit_keyring(void)...
270b329f7ec4e4e8dca6735bd1fe286a8e39b82d
Analyze and fix the following issue in the Linux kernel code: Revert "drm/nouveau: check ioctl command codes better"
Problem Details: My previous patch ended up causing a regression for the DRM_IOCTL_NOUVEAU_NVIF ioctl. The intention of my patch was to only pass ioctl commands that have the correct dir/type/nr bits into the nouveau_abi16_ioctl() function. This turned out to be too strict, as userspace does use at least write-only an...
```diff diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 7bb64fcdd497..1527b801f013 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -1284,9 +1284,6 @@ nouveau_ioctls[] = { DRM_IOCTL_DEF_DRV(NOUVEAU_EXEC, nouveau_exec_ioc...
4e6b5b8ab3e28148d04a63defadc29cfc771b102
Analyze and fix the following issue in the Linux kernel code: rust: sync: fix safety comment for `static_lock_class`
Problem Details: The safety comment mentions lockdep -- which from a Rust perspective isn't important -- and doesn't mention the real reason for why it's sound to create `LockClassKey` as uninitialized memory. Signed-off-by: Benno Lossin <lossin@kernel.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://...
```diff diff --git a/rust/kernel/sync.rs b/rust/kernel/sync.rs index 63c99e015ad6..096cb78c8ec3 100644 --- a/rust/kernel/sync.rs +++ b/rust/kernel/sync.rs @@ -95,8 +95,11 @@ impl PinnedDrop for LockClassKey { macro_rules! static_lock_class { () => {{ static CLASS: $crate::sync::LockClassKey = - ...
59c5dbd585a0bee70e51fcdf36185f7602b9c285
Analyze and fix the following issue in the Linux kernel code: ASoC: SDCA: Shrink detected_mode_handler() stack frame
Problem Details: The stack frame for detected_mode_handler() is a bit large. Dynamically allocate the control value struct, which is most of the size, to avoid this. Fixes: b9ab3b618241 ("ASoC: SDCA: Add some initial IRQ handlers") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuil...
```diff diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interrupts.c index d442ba2f5681..8018773ee426 100644 --- a/sound/soc/sdca/sdca_interrupts.c +++ b/sound/soc/sdca/sdca_interrupts.c @@ -144,7 +144,7 @@ static irqreturn_t detected_mode_handler(int irq, void *data) struct snd_soc_card *card = c...
5b838a24e9942d8b8da208f924701d0f989778cf
Analyze and fix the following issue in the Linux kernel code: ASoC: SDCA: Check devm_mutex_init() return value
Problem Details: Fix interaction with commit daec29dcc873 ("locking/mutex: Mark devm_mutex_init() as __must_check"), add return value check. There is no need for additional complex error handling here, failure to init the mutex means the code can't progress, so the failure just needs to be passed up to the caller. Fix...
```diff diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interrupts.c index b76512732af8..d442ba2f5681 100644 --- a/sound/soc/sdca/sdca_interrupts.c +++ b/sound/soc/sdca/sdca_interrupts.c @@ -419,7 +419,9 @@ struct sdca_interrupt_info *sdca_irq_allocate(struct device *dev, info->irq_chip = sdca_i...
0c6f0d77ab62ff557fd0cace8284bc67ef7ab79c
Analyze and fix the following issue in the Linux kernel code: rtc: Rename lib_test to test_rtc_lib
Problem Details: When compiling the RTC library functions test as a module, the module has the non-descriptive name "lib_test.ko". Fix this by renaming it to "test_rtc_lib.ko". Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/r/47019d7f8ced12107b54a372fdf34b1b8f7b6183.1751355848....
```diff diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index 4619aa2ac469..789bddfea99d 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile @@ -15,7 +15,7 @@ rtc-core-$(CONFIG_RTC_INTF_DEV) += dev.o rtc-core-$(CONFIG_RTC_INTF_PROC) += proc.o rtc-core-$(CONFIG_RTC_INTF_SYSFS) += sysfs.o -obj-$(CO...
c1f3f9797c1f44a762e6f5f72520b2e520537b52
Analyze and fix the following issue in the Linux kernel code: can: netlink: can_changelink(): fix NULL pointer deref of struct can_priv::do_set_mode
Problem Details: Andrei Lalaev reported a NULL pointer deref when a CAN device is restarted from Bus Off and the driver does not implement the struct can_priv::do_set_mode callback. There are 2 code path that call struct can_priv::do_set_mode: - directly by a manual restart from the user space, via can_changelink() ...
```diff diff --git a/drivers/net/can/dev/dev.c b/drivers/net/can/dev/dev.c index ea8c807af4d8..3913971125de 100644 --- a/drivers/net/can/dev/dev.c +++ b/drivers/net/can/dev/dev.c @@ -145,13 +145,16 @@ void can_change_state(struct net_device *dev, struct can_frame *cf, EXPORT_SYMBOL_GPL(can_change_state); /* CAN dev...
492086faa559e5b0bf776d2ade2497394d1ce151
Analyze and fix the following issue in the Linux kernel code: ACPI/PCI: Remove space before newline
Problem Details: There is an extraneous space before a newline in an acpi_handle_debug() message. Remove it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20250721145952.2601422-1-colin.i.king@gmail.com Signed-off-by: Rafael J. Wyso...
```diff diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 08e10b6226dc..e4560b33b8ad 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -268,7 +268,7 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link) link->irq.active = irq; - acpi_handle_debug(handle, "Link ...
cf074eca0065bc5142e6004ae236bb35a2687fdf
Analyze and fix the following issue in the Linux kernel code: net/sched: sch_qfq: Avoid triggering might_sleep in atomic context in qfq_delete_class
Problem Details: might_sleep could be trigger in the atomic context in qfq_delete_class. qfq_destroy_class was moved into atomic context locked by sch_tree_lock to avoid a race condition bug on qfq_aggregate. However, might_sleep could be triggered by qfq_destroy_class, which introduced sleeping in atomic context (pat...
```diff diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c index f0eb70353744..2255355e51d3 100644 --- a/net/sched/sch_qfq.c +++ b/net/sched/sch_qfq.c @@ -536,9 +536,6 @@ destroy_class: static void qfq_destroy_class(struct Qdisc *sch, struct qfq_class *cl) { - struct qfq_sched *q = qdisc_priv(sch); - - qfq_rm_f...
48915162b5ad598bc6fbf8959683f43664b4f6f1
Analyze and fix the following issue in the Linux kernel code: ALSA: usb-audio: qcom: Adjust mutex unlock order
Problem Details: The mutexes qdev_mutex and chip->mutex are acquired in that order throughout the driver. To preserve proper lock hierarchy and avoid potential deadlocks, they must be released in the reverse order of acquisition. This change reorders the unlock sequence to first release chip->mutex followed by qdev_mu...
```diff diff --git a/sound/usb/qcom/qc_audio_offload.c b/sound/usb/qcom/qc_audio_offload.c index 3543b5a53592..a25c5a531690 100644 --- a/sound/usb/qcom/qc_audio_offload.c +++ b/sound/usb/qcom/qc_audio_offload.c @@ -825,8 +825,8 @@ static int uaudio_sideband_notifier(struct usb_interface *intf, } } - mutex_unlock...
e40892214b454c8734350d82374f46c2e495a4d2
Analyze and fix the following issue in the Linux kernel code: selftests/futex: Fix spelling mistake "Succeffuly" -> "Successfully"
Problem Details: There is a spelling mistake in a ksft_exit_fail_msg() message. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20250715130627.1907017-1-colin.i.king@gmail.com
```diff diff --git a/tools/testing/selftests/futex/functional/futex_priv_hash.c b/tools/testing/selftests/futex/functional/futex_priv_hash.c index a9cedc365102..aea001ac4946 100644 --- a/tools/testing/selftests/futex/functional/futex_priv_hash.c +++ b/tools/testing/selftests/futex/functional/futex_priv_hash.c @@ -122,7...
51a486feac0ca002bee6429f03da0a6c206d0dc5
Analyze and fix the following issue in the Linux kernel code: rust: io: fix broken intra-doc links to `platform::Device`
Problem Details: `platform` is not accessible from here. Thus fix the intra-doc links by qualifying the paths a bit more. Fixes: 1d0d4b28513b ("rust: io: mem: add a generic iomem abstraction") Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Link: https://lore.kernel.org/r/20250722085500.1360401-2-ojeda@kernel.org Sign...
```diff diff --git a/rust/kernel/io/mem.rs b/rust/kernel/io/mem.rs index cc9feb2897d8..6f99510bfc3a 100644 --- a/rust/kernel/io/mem.rs +++ b/rust/kernel/io/mem.rs @@ -40,8 +40,8 @@ impl<'a> IoRequest<'a> { /// /// # Examples /// - /// The following example uses a [`platform::Device`] for illustration ...
83fb6160727874a588d70b727bc34f367362e6ed
Analyze and fix the following issue in the Linux kernel code: rust: io: fix broken intra-doc link to missing `flags` module
Problem Details: There is no `mod flags` in this case, unlike others. Instead, they are associated constants for the `Flags` type. Thus reword the sentence to fix the broken intra-doc link, providing an example of constant and linking to it to clarify which ones we are referring to. Fixes: 493fc33ec252 ("rust: io: ad...
```diff diff --git a/rust/kernel/io/resource.rs b/rust/kernel/io/resource.rs index 1d5f367a6e8a..bea3ee0ed87b 100644 --- a/rust/kernel/io/resource.rs +++ b/rust/kernel/io/resource.rs @@ -177,7 +177,8 @@ unsafe impl Sync for Resource {} /// /// They can be combined with the operators `|`, `&`, and `!`. /// -/// Value...
2ed9a9fc9976262109d04f1a3c75c46de8ce4f22
Analyze and fix the following issue in the Linux kernel code: wifi: nl80211: Set num_sub_specs before looping through sub_specs
Problem Details: The processing of the struct cfg80211_sar_specs::sub_specs flexible array requires its counter, num_sub_specs, to be assigned before the loop in nl80211_set_sar_specs(). Leave the final assignment after the loop in place in case fewer ended up in the array. Fixes: aa4ec06c455d ("wifi: cfg80211: use __...
```diff diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index b4bf44768dc8..89519aa52893 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -17559,6 +17559,7 @@ static int nl80211_set_sar_specs(struct sk_buff *skb, struct genl_info *info) if (!sar_spec) return -ENOMEM; + sar_spec->n...
a37192c432adaec9e8ef29e4ddb319ea2f443aa6
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: Write cnt before copying in ieee80211_copy_rnr_beacon()
Problem Details: While I caught the need for setting cnt early in nl80211_parse_rnr_elems() in the original annotation of struct cfg80211_rnr_elems with __counted_by, I missed a similar pattern in ieee80211_copy_rnr_beacon(). Fix this by moving the cnt assignment to before the loop. Fixes: 7b6d7087031b ("wifi: cfg8021...
```diff diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 4f20d57ab913..2ed07fa121ab 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1176,13 +1176,13 @@ ieee80211_copy_rnr_beacon(u8 *pos, struct cfg80211_rnr_elems *dst, { int i, offset = 0; + dst->cnt = src->cnt; for (i = 0; i < src->cnt; i...
4752dcc156f2090143296ff45f8e35c8ec3e1730
Analyze and fix the following issue in the Linux kernel code: kselftest/arm64: Handle attempts to disable SM on SME only systems
Problem Details: The ABI for disabling streaming mode via ptrace is to do a write via the SVE register set. Following the recent round of fixes to the ptrace code we don't support this operation on systems without SVE, which is detected as failures by fp-ptrace. Update the program so that it knows that this operation i...
```diff diff --git a/tools/testing/selftests/arm64/fp/fp-ptrace.c b/tools/testing/selftests/arm64/fp/fp-ptrace.c index a709485cf553..124bc883365e 100644 --- a/tools/testing/selftests/arm64/fp/fp-ptrace.c +++ b/tools/testing/selftests/arm64/fp/fp-ptrace.c @@ -1061,6 +1061,9 @@ static bool sve_write_supported(struct test...
aa7d3c8bc27d32dec940c924d6d270fa312e731f
Analyze and fix the following issue in the Linux kernel code: kselftest/arm64: Fix SVE write data generation for SME only systems
Problem Details: fp-ptrace does not handle SME only systems correctly when generating data, on SME only systems scenarios where we are not in streaming mode will not have an expected vector length. This leads to attempts to do memcpy()s of zero byte arrays which can crash, fix this by skipping generation of SVE data fo...
```diff diff --git a/tools/testing/selftests/arm64/fp/fp-ptrace.c b/tools/testing/selftests/arm64/fp/fp-ptrace.c index 52d4d8fa2958..a709485cf553 100644 --- a/tools/testing/selftests/arm64/fp/fp-ptrace.c +++ b/tools/testing/selftests/arm64/fp/fp-ptrace.c @@ -1151,6 +1151,9 @@ static void sve_write_expected(struct test_...
c64d6be1a6f8c93274bb861ec75c59453508093a
Analyze and fix the following issue in the Linux kernel code: s390: Handle KCOV __init vs inline mismatches
Problem Details: When KCOV is enabled all functions get instrumented, unless the __no_sanitize_coverage attribute is used. To prepare for __no_sanitize_coverage being applied to __init functions, we have to handle differences in how GCC's inline optimizations get resolved. For s390 this exposed a place where the __init...
```diff diff --git a/arch/s390/hypfs/hypfs.h b/arch/s390/hypfs/hypfs.h index 83ebf54cca6b..4dc2e068e0ff 100644 --- a/arch/s390/hypfs/hypfs.h +++ b/arch/s390/hypfs/hypfs.h @@ -48,7 +48,7 @@ void hypfs_sprp_exit(void); int __hypfs_fs_init(void); -static inline int hypfs_fs_init(void) +static __always_inline int hypf...
2424fe1cac4fc8ea0520ba22ede7544c3ddc8dd1
Analyze and fix the following issue in the Linux kernel code: arm: Handle KCOV __init vs inline mismatches
Problem Details: When KCOV is enabled all functions get instrumented, unless the __no_sanitize_coverage attribute is used. To prepare for __no_sanitize_coverage being applied to __init functions, we have to handle differences in how GCC's inline optimizations get resolved. For arm this exposed several places where __in...
```diff diff --git a/arch/arm/mm/cache-feroceon-l2.c b/arch/arm/mm/cache-feroceon-l2.c index 25dbd84a1aaf..2bfefb252ffd 100644 --- a/arch/arm/mm/cache-feroceon-l2.c +++ b/arch/arm/mm/cache-feroceon-l2.c @@ -295,7 +295,7 @@ static inline u32 read_extra_features(void) return u; } -static inline void write_extra_feat...
645d1b666498ef0d2c44c434a609b5560e9dc401
Analyze and fix the following issue in the Linux kernel code: powerpc/mm/book3s64: Move kfence and debug_pagealloc related calls to __init section
Problem Details: Move a few kfence and debug_pagealloc related functions in hash_utils.c and radix_pgtable.c to __init sections since these are only invoked once by an __init function during system initialization. i.e. - hash_debug_pagealloc_alloc_slots() - hash_kfence_alloc_pool() - hash_kfence_map_pool() The above...
```diff diff --git a/arch/powerpc/mm/book3s64/hash_utils.c b/arch/powerpc/mm/book3s64/hash_utils.c index 5158aefe4873..4693c464fc5a 100644 --- a/arch/powerpc/mm/book3s64/hash_utils.c +++ b/arch/powerpc/mm/book3s64/hash_utils.c @@ -343,7 +343,7 @@ static inline bool hash_supports_debug_pagealloc(void) static u8 *linear...
3ea3a256ed81f95ab0f3281a0e234b01a9cae605
Analyze and fix the following issue in the Linux kernel code: scsi: libiscsi: Initialize iscsi_conn->dd_data only if memory is allocated
Problem Details: In case of an ib_fast_reg_mr allocation failure during iSER setup, the machine hits a panic because iscsi_conn->dd_data is initialized unconditionally, even when no memory is allocated (dd_size == 0). This leads invalid pointer dereference during connection teardown. Fix by setting iscsi_conn->dd_dat...
```diff diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 392d57e054db..c9f410c50978 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -3185,7 +3185,8 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, int dd_size, return NULL; conn = cls_conn->dd_data; - conn->dd_d...
d2af710d6d50b3a3e691c4e2b262ed9de3038e96
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mvm/fw: Avoid -Wflex-array-member-not-at-end warnings
Problem Details: -Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. We have a flexible struct iwl_tx_cmd_v6 in the middle of a few structs, but those don't even need the flexible part. So, we add iwl_tx_cmd_v6_params, that will contain everything except the flexi...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/tdls.h b/drivers/net/wireless/intel/iwlwifi/fw/api/tdls.h index 58d5a6ef633e..08edd1d99992 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/tdls.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/tdls.h @@ -50,7 +50,7 @@ struct iwl_tdls_channel_switch_...
9296cc59b2278a30a44504fd588b119aff7896ae
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: Fix typo "ransport"
Problem Details: There is a spelling mistake of 'ransport' in comments which should be 'transport'. Link: https://lore.kernel.org/all/03DFEDFFB5729C96+20250714104736.559226-1-wangyuli@uniontech.com/ Signed-off-by: WangYuli <wangyuli@uniontech.com> Link: https://patch.msgid.link/8F065DF7EF7EEB89+20250715055828.932160-1...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/agn.h b/drivers/net/wireless/intel/iwlwifi/dvm/agn.h index f46c65d75962..9d99374ee093 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/agn.h +++ b/drivers/net/wireless/intel/iwlwifi/dvm/agn.h @@ -388,7 +388,7 @@ static inline void iwl_dvm_set_pmi(struct iwl...
7b87c542c0115726f67461a6360d2cece1d11896
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: fix cmd length when sending WOWLAN_TSC_RSC_PARAM
Problem Details: In iwl_mvm_wowlan_config_rsc_tsc() when calling iwl_mvm_send_cmd_pdu() we are accidentally passing the size of a pointer rather than the size of the object pointed by it. Fix the expression in order to pass the approriate object length. Fixes: 493681d9f95b ("wifi: iwlwifi: remove support of version 4...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c index ef9bab042902..b8754d7e51c5 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -494,7 +494,7 @@ static int iwl_mvm_wowlan_config_rsc_tsc(struct i...
8cd876e7833758f8a924db2e39530d2a9afd2703
Analyze and fix the following issue in the Linux kernel code: lib/crypto: tests: Annotate worker to be on stack
Problem Details: The following warning traceback is seen if object debugging is enabled with the new crypto test code. ODEBUG: object 9000000106237c50 is on stack 9000000106234000, but NOT annotated. ------------[ cut here ]------------ WARNING: lib/debugobjects.c:655 at lookup_object_or_alloc.part.0+0x19c/0x1f4, CPU#...
```diff diff --git a/lib/crypto/tests/hash-test-template.h b/lib/crypto/tests/hash-test-template.h index ffee1741a1b3..f437a0a9ac6c 100644 --- a/lib/crypto/tests/hash-test-template.h +++ b/lib/crypto/tests/hash-test-template.h @@ -398,7 +398,7 @@ static void run_irq_test(struct kunit *test, bool (*func)(void *), */ ...
154e56a77d81ad49eb979aa64463d5fcfad51136
Analyze and fix the following issue in the Linux kernel code: mptcp: fix typo in a comment
Problem Details: This patch fixes the follow spelling mistake in a comment: greter -> greater Signed-off-by: moyuanhao <moyuanhao3676@163.com> Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Link: https://patch.msgid.link/20250719-net-next-mptcp-tc...
```diff diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 2ad1c41e963e..6c448a0be949 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1387,7 +1387,7 @@ struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk) * - estimate the faster flow linger time * - use the above to estimate th...
b03f15c0192b184078206760c839054ae6eb4eaa
Analyze and fix the following issue in the Linux kernel code: gve: Fix stuck TX queue for DQ queue format
Problem Details: gve_tx_timeout was calculating missed completions in a way that is only relevant in the GQ queue format. Additionally, it was attempting to disable device interrupts, which is not needed in either GQ or DQ queue formats. As a result, TX timeouts with the DQ queue format likely would have triggered ear...
```diff diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c index dc35a23ec47f..d1aeb722d48f 100644 --- a/drivers/net/ethernet/google/gve/gve_main.c +++ b/drivers/net/ethernet/google/gve/gve_main.c @@ -1917,49 +1917,56 @@ static void gve_turnup_and_check_status(struct gv...
72b4612af36fec844857415f14fd07126dc4499a
Analyze and fix the following issue in the Linux kernel code: net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
Problem Details: Add PM suspend/resume callbacks for RZ/G3E SMARC EVK. The PM deep entry is executed by pressing the SLEEP button and exit from entry is by pressing the power button. Logs: root@smarc-rzg3e:~# PM: suspend entry (deep) Filesystems sync: 0.115 seconds Freezing user space processes Freezing user space pr...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c index 9a774046455b..df4ca897a60c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c @@ -136,6 +13...
6c4a92d07b0850342d3becf2e608f805e972467c
Analyze and fix the following issue in the Linux kernel code: net: appletalk: Fix use-after-free in AARP proxy probe
Problem Details: The AARP proxy‐probe routine (aarp_proxy_probe_network) sends a probe, releases the aarp_lock, sleeps, then re-acquires the lock. During that window an expire timer thread (__aarp_expire_timer) can remove and kfree() the same entry, leading to a use-after-free. race condition: cpu 0 ...
```diff diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c index 9c787e2e4b17..4744e3fd4544 100644 --- a/net/appletalk/aarp.c +++ b/net/appletalk/aarp.c @@ -35,6 +35,7 @@ #include <linux/seq_file.h> #include <linux/export.h> #include <linux/etherdevice.h> +#include <linux/refcount.h> int sysctl_aarp_expiry_...
18ff09c1b94fa1584b31d3f4e9eecdca29230ce5
Analyze and fix the following issue in the Linux kernel code: net: bcmasp: Restore programming of TX map vector register
Problem Details: On ASP versions v2.x we need to program the TX map vector register to properly exercise end-to-end flow control, otherwise the TX engine can either lock-up, or cause the hardware calculated checksum to be wrong/corrupted when multiple back to back packets are being submitted for transmission. This regi...
```diff diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c index 0d61b8580d72..f832562bd7a3 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c @@ -818,6 +818,9 @@ static void bcmasp_init_tx(st...
fdf0f60a2bb02ba581d9e71d583e69dd0714a521
Analyze and fix the following issue in the Linux kernel code: selftests: mptcp: connect: also cover checksum
Problem Details: The checksum mode has been added a while ago, but it is only validated when manually launching mptcp_connect.sh with "-C". The different CIs were then not validating these MPTCP Connect tests with checksum enabled. To make sure they do, add a new test program executing mptcp_connect.sh with the checks...
```diff diff --git a/tools/testing/selftests/net/mptcp/Makefile b/tools/testing/selftests/net/mptcp/Makefile index c6b030babba8..4c7e51336ab2 100644 --- a/tools/testing/selftests/net/mptcp/Makefile +++ b/tools/testing/selftests/net/mptcp/Makefile @@ -5,7 +5,7 @@ top_srcdir = ../../../../.. CFLAGS += -Wall -Wl,--no-as-...
37848a456fc38c191aedfe41f662cc24db8c23d9
Analyze and fix the following issue in the Linux kernel code: selftests: mptcp: connect: also cover alt modes
Problem Details: The "mmap" and "sendfile" alternate modes for mptcp_connect.sh/.c are available from the beginning, but only tested when mptcp_connect.sh is manually launched with "-m mmap" or "-m sendfile", not via the kselftests helpers. The MPTCP CI was manually running "mptcp_connect.sh -m mmap", but not "-m send...
```diff diff --git a/tools/testing/selftests/net/mptcp/Makefile b/tools/testing/selftests/net/mptcp/Makefile index e47788bfa671..c6b030babba8 100644 --- a/tools/testing/selftests/net/mptcp/Makefile +++ b/tools/testing/selftests/net/mptcp/Makefile @@ -4,7 +4,8 @@ top_srcdir = ../../../../.. CFLAGS += -Wall -Wl,--no-a...
24e066ded45b8147b79c7455ac43a5bff7b5f378
Analyze and fix the following issue in the Linux kernel code: btrfs: don't skip remaining extrefs if dir not found during log replay
Problem Details: During log replay, at add_inode_ref(), if we have an extref item that contains multiple extrefs and one of them points to a directory that does not exist in the subvolume tree, we are supposed to ignore it and process the remaining extrefs encoded in the extref item, since each extref can point to a di...
```diff diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index e3c77f3d092c..467b69a4ef3b 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -1433,6 +1433,8 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans, if (log_ref_ver) { ret = extref_get_fields(eb, ref_ptr, &name, ...
7ebf381a69421a88265d3c49cd0f007ba7336c9d
Analyze and fix the following issue in the Linux kernel code: btrfs: don't ignore inode missing when replaying log tree
Problem Details: During log replay, at add_inode_ref(), we return -ENOENT if our current inode isn't found on the subvolume tree or if a parent directory isn't found. The error comes from btrfs_iget_logging() <- btrfs_iget() <- btrfs_read_locked_inode(). The single caller of add_inode_ref(), replay_one_buffer(), ignor...
```diff diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index ab0815d9e7e5..e3c77f3d092c 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -1416,6 +1416,8 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans, dir = btrfs_iget_logging(parent_objectid, root); if (IS_ERR(dir)) { ...
4e346baee95f4688b36c9bd95664774c3d105c3d
Analyze and fix the following issue in the Linux kernel code: btrfs: reloc: unconditionally invalidate the page cache for each cluster
Problem Details: Commit 9d9ea1e68a05 ("btrfs: subpage: fix relocation potentially overwriting last page data") fixed a bug when relocating data block groups for subpage cases. However for the incoming large folios for data reloc inode, we can hit the same situation where block size is the same as page size, but the fo...
```diff diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 8a71cffb4dfb..e2197d10a1d6 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -2666,66 +2666,24 @@ static noinline_for_stack int prealloc_file_extent_cluster(struct reloc_control u64 num_bytes; int nr; int ret = 0; - u64 i_siz...
807d9023e75fc20bfd6dd2ac0408ce4af53f1648
Analyze and fix the following issue in the Linux kernel code: btrfs: fix ssd_spread overallocation
Problem Details: If the ssd_spread mount option is enabled, then we run the so called clustered allocator for data block groups. In practice, this results in creating a btrfs_free_cluster which caches a block_group and borrows its free extents for allocation. Since the introduction of allocation size classes in 6.1, t...
```diff diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 85833bf216de..97d517cdf2df 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3651,6 +3651,21 @@ btrfs_release_block_group(struct btrfs_block_group *cache, btrfs_put_block_group(cache); } +static bool find_free_extent_chec...
62be7afcc13b2727bdc6a4c91aefed6b452e6ecc
Analyze and fix the following issue in the Linux kernel code: btrfs: zoned: requeue to unused block group list if zone finish failed
Problem Details: btrfs_zone_finish() can fail for several reason. If it is -EAGAIN, we need to try it again later. So, put the block group to the retry list properly. Failing to do so will keep the removable block group intact until remount and can causes unnecessary ENOSPC. Fixes: 74e91b12b115 ("btrfs: zoned: zone f...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 3ddf9fe52b9d..47c6d040176c 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -1639,8 +1639,10 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info) ret = btrfs_zone_finish(block_group); if (ret < 0) { btrfs_d...
3061801420469610c8fa6080a950e56770773ef1
Analyze and fix the following issue in the Linux kernel code: btrfs: zoned: do not remove unwritten non-data block group
Problem Details: There are some reports of "unable to find chunk map for logical 2147483648 length 16384" error message appears in dmesg. This means some IOs are occurring after a block group is removed. When a metadata tree node is cleaned on a zoned setup, we keep that node still dirty and write it out not to create...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 1e35094b20e0..3ddf9fe52b9d 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -34,6 +34,19 @@ int btrfs_should_fragment_free_space(const struct btrfs_block_group *block_group } #endif +static inline bool has_unwritten_metada...
240fafaa4400f7c577a5e8e40c496663da0e0798
Analyze and fix the following issue in the Linux kernel code: btrfs: make btrfs_check_nocow_lock() check more than one extent
Problem Details: Currently btrfs_check_nocow_lock() stops at the first extent it finds and that extent may be smaller than the target range we want to NOCOW into. But we can have multiple consecutive extents which we can NOCOW into, so by stopping at the first one we find we just make the caller do more work by splitti...
```diff diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index c2e83babdb8d..bc1e00db96c9 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -984,8 +984,8 @@ int btrfs_check_nocow_lock(struct btrfs_inode *inode, loff_t pos, struct btrfs_root *root = inode->root; struct extent_state *cached_state = NULL; u64 lock...
6599716de2d68ab7b3c0429221deca306dbda878
Analyze and fix the following issue in the Linux kernel code: btrfs: fix -ENOSPC mmap write failure on NOCOW files/extents
Problem Details: If we attempt a mmap write into a NOCOW file or a prealloc extent when there is no more available data space (or unallocated space to allocate a new data block group) and we can do a NOCOW write (there are no reflinks for the target extent or snapshots), we always fail due to -ENOSPC, unlike for the re...
```diff diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 05b046c6806f..cb07274d4126 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1841,6 +1841,7 @@ static vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf) loff_t size; size_t fsize = folio_size(folio); int ret; + bool only_release_metadata = false; ...
f2cb97ee964a0af0e4644b1dd7556ed4b14bee06
Analyze and fix the following issue in the Linux kernel code: btrfs: index buffer_tree using node size
Problem Details: So far we've been deriving the buffer tree index using the sector size. But each extent buffer covers multiple sectors. This makes the buffer tree rather sparse. For example the typical and quite common configuration uses sector size of 4KiB and node size of 16KiB. In this case it means the buffer tre...
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 6bc7f7ac381c..44e7ae4a2e0b 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3397,6 +3397,7 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device fs_info->delalloc_batch = sectorsize * 512 * (1 + ilog2(nr_cpu_i...
9e9ff875e4174be939371667d2cc81244e31232f
Analyze and fix the following issue in the Linux kernel code: btrfs: use readahead_expand() on compressed extents
Problem Details: We recently received a report of poor performance doing sequential buffered reads of a file with compressed extents. With bs=128k, a naive sequential dd ran as fast on a compressed file as on an uncompressed (1.2GB/s on my reproducing system) while with bs<32k, this performance tanked down to ~300MB/s....
```diff diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index d277a13d7bb5..594ba0a3b6b9 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -110,6 +110,7 @@ struct btrfs_bio_ctrl { * This is to avoid touching ranges covered by compression/inline. */ unsigned long submit_bitmap; + struct re...
1ef94169db0958d6de39f9ea6e063ce887342e2d
Analyze and fix the following issue in the Linux kernel code: btrfs: populate otime when logging an inode item
Problem Details: [TEST FAILURE WITH EXPERIMENTAL FEATURES] When running test case generic/508, the test case will fail with the new btrfs shutdown support: generic/508 - output mismatch (see /home/adam/xfstests/results//generic/508.out.bad) --- tests/generic/508.out 2022-05-11 11:25:30.806666664 +0930 ++...
```diff diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 1e805dabfc4b..ab0815d9e7e5 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -4233,6 +4233,9 @@ static void fill_inode_item(struct btrfs_trans_handle *trans, btrfs_set_timespec_sec(leaf, &item->ctime, inode_get_ctime_sec(inode)); btrfs...
08530d6e638427e7e1344bd67bacc03882ba95b9
Analyze and fix the following issue in the Linux kernel code: btrfs: qgroup: fix qgroup create ioctl returning success after quotas disabled
Problem Details: When quotas are disabled qgroup ioctls are supposed to return -ENOTCONN, but the qgroup create ioctl stopped doing that when it races with a quota disable operation, returning 0 instead. This change of behaviour happened in commit 6ed05643ddb1 ("btrfs: create qgroup earlier in snapshot creation"). The...
```diff diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index eb1bb57dee7d..ae9bc7c71a34 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -1662,9 +1662,6 @@ int btrfs_create_qgroup(struct btrfs_trans_handle *trans, u64 qgroupid) struct btrfs_qgroup *prealloc = NULL; int ret = 0; - if (btrfs_qgroup_mod...
e41c75ca3189341e76e6af64b857c05b68a1d7db
Analyze and fix the following issue in the Linux kernel code: btrfs: qgroup: set quota enabled bit if quota disable fails flushing reservations
Problem Details: Before waiting for the rescan worker to finish and flushing reservations, we clear the BTRFS_FS_QUOTA_ENABLED flag from fs_info. If we fail flushing reservations we leave with the flag not set which is not correct since quotas are still enabled - we must set back the flag on error paths, such as when w...
```diff diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 42d3cfb84318..eb1bb57dee7d 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -1334,11 +1334,14 @@ int btrfs_quota_disable(struct btrfs_fs_info *fs_info) /* * We have nothing held here and no trans handle, just return the error - * if there...
ea124ec327086325fc096abf42837dac471ac7ae
Analyze and fix the following issue in the Linux kernel code: btrfs: don't skip accounting in early ENOTTY return in btrfs_uring_encoded_read()
Problem Details: btrfs_uring_encoded_read() returns early with -ENOTTY if the uring_cmd is issued with IO_URING_F_COMPAT but the kernel doesn't support compat syscalls. However, this early return bypasses the syscall accounting. Go to out_acct instead to ensure the syscall is counted. Fixes: 34310c442e17 ("btrfs: add ...
```diff diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4be09b4152f6..a48028ead359 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -4825,7 +4825,8 @@ static int btrfs_uring_encoded_read(struct io_uring_cmd *cmd, unsigned int issue #if defined(CONFIG_64BIT) && defined(CONFIG_COMPAT) copy_end = offseto...
e1249667750399a48cafcf5945761d39fa584edf
Analyze and fix the following issue in the Linux kernel code: btrfs: qgroup: fix race between quota disable and quota rescan ioctl
Problem Details: There's a race between a task disabling quotas and another running the rescan ioctl that can result in a use-after-free of qgroup records from the fs_info->qgroup_tree rbtree. This happens as follows: 1) Task A enters btrfs_ioctl_quota_rescan() -> btrfs_qgroup_rescan(); 2) Task B enters btrfs_quota_...
```diff diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index b83d9534adae..310ca2dd9f24 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -636,22 +636,30 @@ bool btrfs_check_quota_leak(const struct btrfs_fs_info *fs_info) /* * This is called from close_ctree() or open_ctree() or btrfs_quota_disable(), ...
c0d013495a80cbb53e2288af7ae0ec4170aafd7c
Analyze and fix the following issue in the Linux kernel code: btrfs: clear dirty status from extent buffer on error at insert_new_root()
Problem Details: If we failed to insert the tree mod log operation, we are not removing the dirty status from the allocated and dirtied extent buffer before we free it. Removing the dirty status is needed for several reasons such as to adjust the fs_info->dirty_metadata_bytes counter and remove the dirty status from th...
```diff diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 2997f2420719..dc21e840664b 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -2881,6 +2881,7 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans, if (ret < 0) { int ret2; + btrfs_clear_buffer_dirty(trans, c); ret2 = btrf...