id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
121df45b37a1016ee6828c2ca3ba825f3e18a8c1
Analyze and fix the following issue in the Linux kernel code: s390/entry: Fix setting _CIF_MCCK_GUEST with lowcore relocation
Problem Details: When lowcore relocation is enabled, the machine check handler doesn't use the lowcore address when setting _CIF_MCCK_GUEST. Fix this by adding the missing base register. Fixes: 0001b7bbc53a ("s390/entry: Make mchk_int_handler() ready for lowcore relocation") Reported-by: Heiko Carstens <hca@linux.ibm....
```diff diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index b0c2356697fd..dd291c9ad6a6 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S @@ -468,7 +468,7 @@ SYM_CODE_START(mcck_int_handler) clgrjl %r9,%r14, 4f larl %r14,.Lsie_leave clgrjhe %r9,%r14, 4f - lg %r10,__LC_PCPU + l...
bd496a44f041da9ef3afe14d1d6193d460424e91
Analyze and fix the following issue in the Linux kernel code: i3c: Add NULL pointer check in i3c_master_queue_ibi()
Problem Details: The I3C master driver may receive an IBI from a target device that has not been probed yet. In such cases, the master calls `i3c_master_queue_ibi()` to queue an IBI work task, leading to "Unable to handle kernel read from unreadable memory" and resulting in a kernel panic. Typical IBI handling flow: 1...
```diff diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index fd26c4bb8b34..fd81871609d9 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -2555,6 +2555,9 @@ static void i3c_master_unregister_i3c_devs(struct i3c_master_controller *master) */ void i3c_master_queue_ibi(struct i3c_dev_desc *dev, ...
c1f4534b213d7be41b5d8b815a42d201a8f2978f
Analyze and fix the following issue in the Linux kernel code: scripts: generate_rust_analyzer: fix pin-init name in kernel deps
Problem Details: Because of different crate names ("pin-init" and "pin_init") passed to "append_crate" and "append_crate_with_generated", the script fails with "KeyError: 'pin-init'". To overcome the issue, pass the same name to both functions. Signed-off-by: Andrei Lalaev <andrei.lalaev@anton-paar.com> Link: https:/...
```diff diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py index b0d7dc1e9267..cd41bc906fbd 100755 --- a/scripts/generate_rust_analyzer.py +++ b/scripts/generate_rust_analyzer.py @@ -133,7 +133,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs): append_cra...
e5182305a5199246dbcb4053299dcb1c8867b6ff
Analyze and fix the following issue in the Linux kernel code: ALSA: hda/realtek: Enable Mute LED on HP OMEN 16 Laptop xd000xx
Problem Details: This patch adds the HP OMEN 16 Laptop xd000xx to enable mute led. it uses ALC245_FIXUP_HP_MUTE_LED_COEFBIT with a slight modification setting mute_led_coef.off to 0(it was set to 4 i guess in that function) which i referred to your previous patch disscusion https://bugzilla.kernel.org/show_bug.cgi?id=2...
```diff diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index bbe22530e241..b69b659ae659 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -4743,6 +4743,22 @@ static void alc245_fixup_hp_mute_led_coefbit(struct hda_codec *codec, } } +static void alc245_fix...
fcc0f16923621e670d5ccf486160e4a1b960b17f
Analyze and fix the following issue in the Linux kernel code: ASoC: SOF: Intel: Let SND_SOF_SOF_HDA_SDW_BPT select SND_HDA_EXT_CORE
Problem Details: CONFIG_SND_HDA_EXT_CORE is required for CONFIG_SND_SOF_SOF_HDA_SDW_BPT. Fixes: 5d5cb86fb46e ("ASoC: SOF: Intel: hda-sdw-bpt: add helpers for SoundWire BPT DMA") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202503170249.iPSBJSf5-lkp@intel.com/ Closes: htt...
```diff diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig index fae3598fd601..dc1d21de4ab7 100644 --- a/sound/soc/sof/intel/Kconfig +++ b/sound/soc/sof/intel/Kconfig @@ -345,6 +345,7 @@ endif ## SND_SOC_SOF_HDA_GENERIC config SND_SOF_SOF_HDA_SDW_BPT tristate + select SND_HDA_EXT_CORE help ...
4cecf99124925bf27ed17a0f75cf44409b1ac6ae
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: regd: introduce string getter for reuse
Problem Details: Introduce a function to get the string for a given regulatory. It will be used in the following. Besides, drop similar things in debug code and use this too. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/2025032602...
```diff diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h index 8e9697679aaa..18340a9cd72b 100644 --- a/drivers/net/wireless/realtek/rtw89/core.h +++ b/drivers/net/wireless/realtek/rtw89/core.h @@ -7185,6 +7185,7 @@ void rtw89_chip_cfg_txpwr_ul_tb_offset(struct rtw89_dev...
8bde621f124b593e3d1570a40d02155690714e3f
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: fix typo of "access" in rtw89_sar_info description
Problem Details: The "acces" should be "access". So, fix it. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20250326020643.14487-2-pkshih@realtek.com
```diff diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h index 4be05d6cad18..8e9697679aaa 100644 --- a/drivers/net/wireless/realtek/rtw89/core.h +++ b/drivers/net/wireless/realtek/rtw89/core.h @@ -4631,7 +4631,7 @@ struct rtw89_sar_cfg_common { }; struct rtw89_sar_i...
e95129709a86cecdb5bea242d2ad489db2ad2ef5
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: phy: reset value of force TX power for MAC ID
Problem Details: The force TX power function is disabled, but the force TX power value is preserved, causing misunderstand the behavior in debug. Clear all values. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20250325031021.15619-1-pkshih@realtek.com
```diff diff --git a/drivers/net/wireless/realtek/rtw89/phy_be.c b/drivers/net/wireless/realtek/rtw89/phy_be.c index 37d8f254ae32..d321cf1fc485 100644 --- a/drivers/net/wireless/realtek/rtw89/phy_be.c +++ b/drivers/net/wireless/realtek/rtw89/phy_be.c @@ -362,7 +362,7 @@ static void rtw89_phy_bb_wrap_force_cr_init(struc...
650f5353dcc9b6e690a1c763754fa1e98d217bfc
Analyze and fix the following issue in the Linux kernel code: bcachefs: fix bch2_write_point_to_text() units
Problem Details: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c index 0cac65347a5d..da0d72928b5b 100644 --- a/fs/bcachefs/alloc_foreground.c +++ b/fs/bcachefs/alloc_foreground.c @@ -1560,7 +1560,7 @@ static void bch2_write_point_to_text(struct printbuf *out, struct bch_fs *c, unsigned i; prt_...
2b47102b933a5f28a08f4811835cc3a7cdb1b324
Analyze and fix the following issue in the Linux kernel code: bcachefs: Reorder error messages that include journal debug
Problem Details: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c index ecb97d435f6a..8a36d5536668 100644 --- a/fs/bcachefs/journal.c +++ b/fs/bcachefs/journal.c @@ -168,11 +168,11 @@ journal_error_check_stuck(struct journal *j, int error, unsigned flags) return stuck; } j->err_seq = journal_cur_seq(j); - spin_...
393a05a7413aa325a15c6d3b35867843f91f1646
Analyze and fix the following issue in the Linux kernel code: bcachefs: Don't use designated initializers for disk_accounting_pos
Problem Details: Not all compilers fully initialize these - they're not guaranteed to because of the union shenanigans. Fixes: https://github.com/koverstreet/bcachefs/issues/844 Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 1c6fc45e1449..0903311cc71e 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -666,9 +666,9 @@ static int bch2_trigger_stripe_ptr(struct btree_trans *trans, stripe_blockcount_get(&s->v, p.ec.block) + sectors); - struct di...
458e2ef882d2e2ac4748ca802227a5e050d6aba1
Analyze and fix the following issue in the Linux kernel code: bcachefs: fix units in rebalance_status
Problem Details: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/rebalance.c b/fs/bcachefs/rebalance.c index 29a569384146..a480c3cb6712 100644 --- a/fs/bcachefs/rebalance.c +++ b/fs/bcachefs/rebalance.c @@ -605,7 +605,7 @@ void bch2_rebalance_status_to_text(struct printbuf *out, struct bch_fs *c) bch2_accounting_mem_read(c, disk_accounting_pos_to_b...
707549600c4a012ed71c0204a7992a679880bf33
Analyze and fix the following issue in the Linux kernel code: bcachefs: bch2_ioctl_subvolume_destroy() fixes
Problem Details: bch2_evict_subvolume_inodes() was getting stuck - due to incorrectly pruning the dcache. Also, fix missing permissions checks. Reported-by: Alexander Viro <viro@zeniv.linux.org.uk> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/fs-ioctl.c b/fs/bcachefs/fs-ioctl.c index e3a3230fc652..0273130f18dc 100644 --- a/fs/bcachefs/fs-ioctl.c +++ b/fs/bcachefs/fs-ioctl.c @@ -541,10 +541,12 @@ static long bch2_ioctl_subvolume_destroy(struct bch_fs *c, struct file *filp, ret = -ENOENT; goto err; } - ret = __bch2_unl...
85a063b8b281e144ed96463936fb4e6b3d4fe9e4
Analyze and fix the following issue in the Linux kernel code: drm/i2c: tda998x: select CONFIG_DRM_KMS_HELPER
Problem Details: This fails to build without the KMS helper functions: x86_64-linux-ld: drivers/gpu/drm/bridge/tda998x_drv.o: in function `tda998x_detect_work': tda998x_drv.c:(.text+0x4e6): undefined reference to `drm_kms_helper_hotplug_event' x86_64-linux-ld: drivers/gpu/drm/bridge/tda998x_drv.o: in function `tda998x...
```diff diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index d20f1646dac2..09a1be234f71 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -91,12 +91,13 @@ config DRM_FSL_LDB Support for i.MX8MP DPI-to-LVDS on-SoC encoder. config DRM_I2C_NXP_TDA998X ...
47c03e6660e96cbba0239125b1d4a9db3c724b1d
Analyze and fix the following issue in the Linux kernel code: drm/bridge: cdns-dsi: Wait for Clk and Data Lanes to be ready
Problem Details: Once the DSI Link and DSI Phy are initialized, the code needs to wait for Clk and Data Lanes to be ready, before continuing configuration. This is in accordance with the DSI Start-up procedure, found in the Technical Reference Manual of Texas Instrument's J721E SoC[0] which houses this DSI TX controlle...
```diff diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c index 741d676b8266..93c3d5f1651d 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -776,7 +776,7 @@ static void cdns_dsi_bridge_atomic_en...
c6a7ef0d4856b9629df390e9935d7fd67fe39f81
Analyze and fix the following issue in the Linux kernel code: drm/bridge: cdns-dsi: Check return value when getting default PHY config
Problem Details: Check for the return value of the phy_mipi_dphy_get_default_config() call, and in case of an error, return back the same. Fixes: fced5a364dee ("drm/bridge: cdns: Convert to phy framework") Cc: stable@vger.kernel.org Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Dmitry Bary...
```diff diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c index 02613ba7a05b..741d676b8266 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -575,9 +575,11 @@ static int cdns_dsi_check_conf(struc...
132bdcec399be6ae947582249a134b38cf56731c
Analyze and fix the following issue in the Linux kernel code: drm/bridge: cdns-dsi: Fix the clock variable for mode_valid()
Problem Details: The crtc_* mode parameters do not get generated (duplicated in this case) from the regular parameters before the mode validation phase begins. The rest of the code conditionally uses the crtc_* parameters only during the bridge enable phase, but sticks to the regular parameters for mode validation. In...
```diff diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c index 3b15528713fe..02613ba7a05b 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -568,13 +568,14 @@ static int cdns_dsi_check_conf(stru...
fd2611c13f69cbbc6b81d9fc7502abf4f7031d21
Analyze and fix the following issue in the Linux kernel code: drm/bridge: cdns-dsi: Fix phy de-init and flag it so
Problem Details: The driver code doesn't have a Phy de-initialization path as yet, and so it does not clear the phy_initialized flag while suspending. This is a problem because after resume the driver looks at this flag to determine if a Phy re-initialization is required or not. It is in fact required because the hardw...
```diff diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c index 1cfe17865b06..3b15528713fe 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -683,6 +683,11 @@ static void cdns_dsi_bridge_atomic_p...
688eb4d465484bc2a3471a6a6f06f833b58c7867
Analyze and fix the following issue in the Linux kernel code: drm/bridge: cdns-dsi: Fix connecting to next bridge
Problem Details: Fix the OF node pointer passed to the of_drm_find_bridge() call to find the next bridge in the display chain. The code to find the next panel (and create its panel-bridge) works fine, but to find the next (non-panel) bridge does not. To find the next bridge in the pipeline, we need to pass "np" - the...
```diff diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c index 99d43944fb8f..1cfe17865b06 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -966,7 +966,7 @@ static int cdns_dsi_attach(struct mip...
60f3caff1492e5b8616b9578c4bedb5c0a88ed14
Analyze and fix the following issue in the Linux kernel code: LoongArch: BPF: Don't override subprog's return value
Problem Details: The verifier test `calls: div by 0 in subprog` triggers a panic at the ld.bu instruction. The ld.bu insn is trying to load byte from memory address returned by the subprog. The subprog actually set the correct address at the a5 register (dedicated register for BPF return values). But at commit 73c359d1...
```diff diff --git a/arch/loongarch/net/bpf_jit.c b/arch/loongarch/net/bpf_jit.c index a06bf89fed67..fa1500d4aa3e 100644 --- a/arch/loongarch/net/bpf_jit.c +++ b/arch/loongarch/net/bpf_jit.c @@ -907,7 +907,10 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext move_addr(ctx, t1, fun...
52266f1015a8b5aabec7d127f83d105f702b388e
Analyze and fix the following issue in the Linux kernel code: LoongArch: BPF: Use move_addr() for BPF_PSEUDO_FUNC
Problem Details: Vincent reported that running XDP synproxy program on LoongArch results in the following error: JIT doesn't support bpf-to-bpf calls With dmesg: multi-func JIT bug 1391 != 1390 The root cause is that verifier will refill the imm with the correct addresses of bpf_calls for BPF_PSEUDO_FUNC in...
```diff diff --git a/arch/loongarch/net/bpf_jit.c b/arch/loongarch/net/bpf_jit.c index 2346c0b55043..a06bf89fed67 100644 --- a/arch/loongarch/net/bpf_jit.c +++ b/arch/loongarch/net/bpf_jit.c @@ -932,7 +932,10 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext { const u64 imm64 = (u...
7e2586991e36663c9bc48c828b83eab180ad30a9
Analyze and fix the following issue in the Linux kernel code: LoongArch: BPF: Fix off-by-one error in build_prologue()
Problem Details: Vincent reported that running BPF progs with tailcalls on LoongArch causes kernel hard lockup. Debugging the issues shows that the JITed image missing a jirl instruction at the end of the epilogue. There are two passes in JIT compiling, the first pass set the flags and the second pass generates JIT co...
```diff diff --git a/arch/loongarch/net/bpf_jit.c b/arch/loongarch/net/bpf_jit.c index ea357a3edc09..2346c0b55043 100644 --- a/arch/loongarch/net/bpf_jit.c +++ b/arch/loongarch/net/bpf_jit.c @@ -142,6 +142,8 @@ static void build_prologue(struct jit_ctx *ctx) */ if (seen_tail_call(ctx) && seen_call(ctx)) move_re...
29c92a41c6d2879c1f62220fe4758dce191bb38f
Analyze and fix the following issue in the Linux kernel code: LoongArch: Rework the arch_kgdb_breakpoint() implementation
Problem Details: The arch_kgdb_breakpoint() function defines the kgdb_breakinst symbol using inline assembly. 1. There's a potential issue where the compiler might inline arch_kgdb_breakpoint(), which would then define the kgdb_breakinst symbol multiple times, leading to a linker error. To prevent this, declare arch_...
```diff diff --git a/arch/loongarch/kernel/kgdb.c b/arch/loongarch/kernel/kgdb.c index 445c452d72a7..7be5b4c0c900 100644 --- a/arch/loongarch/kernel/kgdb.c +++ b/arch/loongarch/kernel/kgdb.c @@ -8,6 +8,7 @@ #include <linux/hw_breakpoint.h> #include <linux/kdebug.h> #include <linux/kgdb.h> +#include <linux/objtool.h>...
2e3bc71e4f394ecf8f499d21923cf556b4bfa1e7
Analyze and fix the following issue in the Linux kernel code: LoongArch: Fix device node refcount leak in fdt_cpu_clk_init()
Problem Details: Add missing of_node_put() to properly handle the reference count of the device node obtained from of_get_cpu_node(). Fixes: 44a01f1f726a ("LoongArch: Parsing CPU-related information from DTS") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
```diff diff --git a/arch/loongarch/kernel/env.c b/arch/loongarch/kernel/env.c index 2f1f5b08638f..27144de5c5fe 100644 --- a/arch/loongarch/kernel/env.c +++ b/arch/loongarch/kernel/env.c @@ -68,6 +68,8 @@ static int __init fdt_cpu_clk_init(void) return -ENODEV; clk = of_clk_get(np, 0); + of_node_put(np); + if ...
be216cbc1ddf99a51915414ce147311c0dfd50a2
Analyze and fix the following issue in the Linux kernel code: LoongArch: Fix help text of CMDLINE_EXTEND in Kconfig
Problem Details: It is the built-in command line appended to the bootloader command line, not the bootloader command line appended to the built-in command line. Fixes: fa96b57c1490 ("LoongArch: Add build infrastructure") Signed-off-by: 谢致邦 (XIE Zhibang) <Yeking@Red54.com> Signed-off-by: Huacai Chen <chenhuacai@loongso...
```diff diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index 5e009126eaa1..02fc28020ddd 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -386,8 +386,8 @@ config CMDLINE_BOOTLOADER config CMDLINE_EXTEND bool "Use built-in to extend bootloader kernel arguments" help - The command-l...
13c23cb4ed09466d73f1beae8956810b95add6ef
Analyze and fix the following issue in the Linux kernel code: rust: Fix enabling Rust and building with GCC for LoongArch
Problem Details: This patch fixes a build issue on LoongArch when Rust is enabled and compiled with GCC by explicitly setting the bindgen target and skipping C flags that Clang doesn't support. Cc: stable@vger.kernel.org Acked-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: WANG Rui <wangrui@loongson.cn> Signed-off...
```diff diff --git a/rust/Makefile b/rust/Makefile index ea3849eb78f6..2c57c624fe7d 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -232,7 +232,8 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \ -mfunction-return=thunk-extern -mrecord-mcount -mabi=lp64 \ -mindirect-branch-cs-prefix -ms...
b3981564ca8fa341a57c16dcbed1a9bd7f4e3be1
Analyze and fix the following issue in the Linux kernel code: bcachefs: Clear fs_path_parent on subvolume unlink
Problem Details: This fixes recursive subvolume removal. Subvolume deletion is asynchronous; fs_path_parent, and thus the entry in the subvolume_children btree, need to be cleared when the subvolume is unlinked from the fs heirarchy - else we'll spuriously think a subvolume has children and deletion will fail. Signed...
```diff diff --git a/fs/bcachefs/subvolume.c b/fs/bcachefs/subvolume.c index b7b96283c316..cd0d8e5e44e7 100644 --- a/fs/bcachefs/subvolume.c +++ b/fs/bcachefs/subvolume.c @@ -561,6 +561,7 @@ int bch2_subvolume_unlink(struct btree_trans *trans, u32 subvolid) } SET_BCH_SUBVOLUME_UNLINKED(&n->v, true); + n->v.fs_pat...
63c3b8f616cc95bb1fcc6101c92485d41c535d7c
Analyze and fix the following issue in the Linux kernel code: bcachefs: Change btree_insert_node() assertion to error
Problem Details: Debug for https://github.com/koverstreet/bcachefs/issues/843 Print useful debug info and go emergency read-only. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/btree_update_interior.c b/fs/bcachefs/btree_update_interior.c index 37c4ba529e3a..987fdfc043b8 100644 --- a/fs/bcachefs/btree_update_interior.c +++ b/fs/bcachefs/btree_update_interior.c @@ -35,6 +35,8 @@ static const char * const bch2_btree_update_modes[] = { NULL }; +static void b...
59c30e31425833385e6644ad33151420e37eabe1
Analyze and fix the following issue in the Linux kernel code: exfat: fix potential wrong error return from get_block
Problem Details: If there is no error, get_block() should return 0. However, when bh_read() returns 1, get_block() also returns 1 in the same manner. Let's set err to 0, if there is no error from bh_read() Fixes: 11a347fb6cef ("exfat: change to get file size from DataLength") Cc: stable@vger.kernel.org Signed-off-by:...
```diff diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c index f3fdba9f4d21..a23677de4544 100644 --- a/fs/exfat/inode.c +++ b/fs/exfat/inode.c @@ -391,6 +391,8 @@ static int exfat_get_block(struct inode *inode, sector_t iblock, /* Zero unwritten part of a block */ memset(bh_result->b_data + size, 0, ...
1dc1e0b9d694eb9016d3105ca4ba8bd90eba888a
Analyze and fix the following issue in the Linux kernel code: srcu: Make FORCE_NEED_SRCU_NMI_SAFE depend on RCU_EXPERT
Problem Details: The FORCE_NEED_SRCU_NMI_SAFE is useful only for those wishing to test the SRCU code paths that accommodate architectures that do not have NMI-safe per-CPU operations, that is, those architectures that do not select the ARCH_HAS_NMI_SAFE_THIS_CPU_OPS Kconfig option. As such, this is a specialized Kconf...
```diff diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index aa42de4d2768..4d9b21f69eaa 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -68,6 +68,8 @@ config TREE_SRCU config FORCE_NEED_SRCU_NMI_SAFE bool "Force selection of NEED_SRCU_NMI_SAFE" depends on !TINY_SRCU + depends on RCU_EXPERT + depe...
8741d0737921ec1c03cf59aebf4d01400c2b461a
Analyze and fix the following issue in the Linux kernel code: ublk: make sure ubq->canceling is set when queue is frozen
Problem Details: Now ublk driver depends on `ubq->canceling` for deciding if the request can be dispatched via uring_cmd & io_uring_cmd_complete_in_task(). Once ubq->canceling is set, the uring_cmd can be done via ublk_cancel_cmd() and io_uring_cmd_done(). So set ubq->canceling when queue is frozen, this way makes su...
```diff diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index c060da409ed8..fbcb7c2ff851 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -1446,17 +1446,27 @@ static void ublk_abort_queue(struct ublk_device *ub, struct ublk_queue *ubq) } } +/* Must be called when queue is fr...
04491732fc996305e1de80255d64ed6d1c472df5
Analyze and fix the following issue in the Linux kernel code: io_uring/net: account memory for zc sendmsg
Problem Details: Account pinned pages for IORING_OP_SENDMSG_ZC, just as we for IORING_OP_SEND_ZC and net/ does for MSG_ZEROCOPY. Fixes: 493108d95f146 ("io_uring/net: zerocopy sendmsg") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/4f00f67ca6ac8e8ed62343ae92b5816b1e0c9c4b.174308...
```diff diff --git a/io_uring/net.c b/io_uring/net.c index 8944eb679024..228b4f13d34c 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -1303,6 +1303,7 @@ int io_send_zc_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) struct io_sr_msg *zc = io_kiocb_to_cmd(req, struct io_sr_msg); struct io_ring_ctx *ct...
4c4d9b7b6c6e676eca22585139aba5f03de74b90
Analyze and fix the following issue in the Linux kernel code: drm/nouveau: fix hibernate on disabled GPU
Problem Details: Hibernate bricks the machine if a discrete GPU was disabled via echo IGD > /sys/kernel/debug/vgaswitcheroo/switch The freeze and thaw handler lacks checking the GPU power state, as suspend and resume do. This patch add the checks and fix this issue. Signed-off-by: Christoph Rudorff <chris@rudorff.c...
```diff diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index e154d08857c5..c69139701056 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -1079,6 +1079,10 @@ nouveau_pmops_freeze(struct device *dev) { struct nouveau_drm *drm ...
f710202b2a45addea3dcdcd862770ecbaf6597ef
Analyze and fix the following issue in the Linux kernel code: x86/tools: Drop duplicate unlikely() definition in insn_decoder_test.c
Problem Details: After commit c104c16073b7 ("Kunit to check the longest symbol length"), there is a warning when building with clang because there is now a definition of unlikely from compiler.h in tools/include/linux, which conflicts with the one in the instruction decoder selftest: arch/x86/tools/insn_decoder_test...
```diff diff --git a/arch/x86/tools/insn_decoder_test.c b/arch/x86/tools/insn_decoder_test.c index 6c2986d2ad11..08cd913cbd4e 100644 --- a/arch/x86/tools/insn_decoder_test.c +++ b/arch/x86/tools/insn_decoder_test.c @@ -12,8 +12,6 @@ #include <stdarg.h> #include <linux/kallsyms.h> -#define unlikely(cond) (cond) - #...
b5322b6ec06a6c58650f52abcd2492000396363b
Analyze and fix the following issue in the Linux kernel code: x86/uaccess: Improve performance by aligning writes to 8 bytes in copy_user_generic(), on non-FSRM/ERMS CPUs
Problem Details: History of the performance regression: ====================================== Since the following series of user copy updates were merged upstream ~2 years ago via: a5624566431d ("Merge branch 'x86-rep-insns': x86 user copy clarifications") .. copy_user_generic() on x86_64 stopped doing alignment ...
```diff diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S index aa8c341b2441..06296eb69fd4 100644 --- a/arch/x86/lib/copy_user_64.S +++ b/arch/x86/lib/copy_user_64.S @@ -77,6 +77,24 @@ SYM_FUNC_START(rep_movs_alternative) _ASM_EXTABLE_UA( 0b, 1b) .Llarge_movsq: + /* Do the first possibly unali...
0fff2aa96f6be6d33b584d73b16d3672fd30fd5c
Analyze and fix the following issue in the Linux kernel code: arm64: mm: Drop dead code for pud special bit handling
Problem Details: Keith Busch observed some incorrect macros defined in arm64 code [1]. It turns out the two lines should never be needed and won't be exposed to anyone, because aarch64 doesn't select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD, hence ARCH_SUPPORTS_PUD_PFNMAP is always N. The only archs that support THP PUDs s...
```diff diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 84f05f781a70..d3b538be1500 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -633,11 +633,6 @@ static inline pud_t pud_mkhuge(pud_t pud) #define pud_pfn(pud) ((__pud_to_phys(pud) & PUD_...
a13bfa4fe0d6949cea14718df2d1fe84c38cd113
Analyze and fix the following issue in the Linux kernel code: arm64: mops: Do not dereference src reg for a set operation
Problem Details: The source register is not used for SET* and reading it can result in a UBSAN out-of-bounds array access error, specifically when the MOPS exception is taken from a SET* sequence with XZR (reg 31) as the source. Architecturally this is the only case where a src/dst/size field in the ESR can be reported...
```diff diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h index d780d1bd2eac..82cf1f879c61 100644 --- a/arch/arm64/include/asm/traps.h +++ b/arch/arm64/include/asm/traps.h @@ -109,10 +109,9 @@ static inline void arm64_mops_reset_regs(struct user_pt_regs *regs, unsigned lon int dstreg = ESR_...
89f43e1ce6f60d4f44399059595ac47f7a90a393
Analyze and fix the following issue in the Linux kernel code: arm64: mm: Correct the update of max_pfn
Problem Details: Hotplugged memory can be smaller than the original memory. For example, on my target: root@genericarmv8:~# cat /sys/kernel/debug/memblock/memory 0: 0x0000000064005000..0x0000000064023fff 0 NOMAP 1: 0x0000000064400000..0x00000000647fffff 0 NOMAP 2: 0x0000000068000000..0x000000006fffffff ...
```diff diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 3c54dea1303f..eaaa9b36202b 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1358,7 +1358,8 @@ int arch_add_memory(int nid, u64 start, u64 size, __remove_pgd_mapping(swapper_pg_dir, __phys_to_virt(start), size); else { - m...
ce22fccd0773834a0b27900395e7b4a329041b6b
Analyze and fix the following issue in the Linux kernel code: drm/xe/guc: Re-word message about ADS size changes
Problem Details: The error capture list in the ADS is initially allocated using a placeholder size. When the actual size is determinied later on, there is a debug print about the new size. However, the wording is such that some people see it as an unexpected thing and therefore a potential problem. So re-word it to be ...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_ads.c b/drivers/gpu/drm/xe/xe_guc_ads.c index e7c9e095a19f..bee4e0cfe7b8 100644 --- a/drivers/gpu/drm/xe/xe_guc_ads.c +++ b/drivers/gpu/drm/xe/xe_guc_ads.c @@ -682,8 +682,8 @@ static int guc_capture_prep_lists(struct xe_guc_ads *ads) } if (ads->capture_size != PAGE_A...
c9092257506af4985c085103714c403812a5bdcb
Analyze and fix the following issue in the Linux kernel code: drm/xe: avoid plain 64-bit division
Problem Details: Building the xe driver for i386 results in a link time warning: x86_64-linux-ld: drivers/gpu/drm/xe/xe_migrate.o: in function `xe_migrate_vram': xe_migrate.c:(.text+0x1e15): undefined reference to `__udivdi3' Avoid this by using DIV_U64_ROUND_UP() instead of DIV_ROUND_UP(). The driver is unlikely to...
```diff diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c index ff0fc2fb0eb9..c1277d599a11 100644 --- a/drivers/gpu/drm/xe/xe_migrate.c +++ b/drivers/gpu/drm/xe/xe_migrate.c @@ -1548,7 +1548,7 @@ void xe_migrate_wait(struct xe_migrate *m) static u32 pte_update_cmd_size(u64 size) { u32 n...
7c4cb50e1a39ada75aaaaaedfdaec52d0b8f8bcc
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix bch2_fs_get_tree() error path
Problem Details: When a filesystem is mounted read-only, subsequent attempts to mount it as read-write fail with EBUSY. Previously, the error path in bch2_fs_get_tree() would unconditionally call __bch2_fs_stop(), improperly freeing resources for a filesystem that was still actively mounted. This change modifies the er...
```diff diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index fbca200f7636..89a30bde1220 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -2290,7 +2290,8 @@ err_stop_fs: goto err; err_put_super: - __bch2_fs_stop(c); + if (!sb->s_root) + __bch2_fs_stop(c); deactivate_locked_super(sb); goto err; } ```
9c565428788fb9b49066f94ab7b10efc686a0a4c
Analyze and fix the following issue in the Linux kernel code: dm-ebs: fix prefetch-vs-suspend race
Problem Details: There's a possible race condition in dm-ebs - dm bufio prefetch may be in progress while the device is suspended. Fix this by calling dm_bufio_client_reset in the postsuspend hook. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@vger.kernel.org
```diff diff --git a/drivers/md/dm-ebs-target.c b/drivers/md/dm-ebs-target.c index 18ae45dcbfb2..b19b0142a690 100644 --- a/drivers/md/dm-ebs-target.c +++ b/drivers/md/dm-ebs-target.c @@ -390,6 +390,12 @@ static int ebs_map(struct dm_target *ti, struct bio *bio) return DM_MAPIO_REMAPPED; } +static void ebs_postsusp...
2de510fccbca3d1906b55f4be5f1de83fa2424ef
Analyze and fix the following issue in the Linux kernel code: dm-verity: fix prefetch-vs-suspend race
Problem Details: There's a possible race condition in dm-verity - the prefetch work item may race with suspend and it is possible that prefetch continues to run while the device is suspended. Fix this by calling flush_workqueue and dm_bufio_client_reset in the postsuspend hook. Signed-off-by: Mikulas Patocka <mpatocka...
```diff diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c index 40448a8c74b1..3c427f18a04b 100644 --- a/drivers/md/dm-verity-target.c +++ b/drivers/md/dm-verity-target.c @@ -836,6 +836,13 @@ static int verity_map(struct dm_target *ti, struct bio *bio) return DM_MAPIO_SUBMITTED; } +static v...
8bde1033f9cfc1c08628255cc434c6cf39c9d9ba
Analyze and fix the following issue in the Linux kernel code: dm-integrity: fix non-constant-time tag verification
Problem Details: When using dm-integrity in standalone mode with a keyed hmac algorithm, integrity tags are calculated and verified internally. Using plain memcmp to compare the stored and computed tags may leak the position of the first byte mismatch through side-channel analysis, allowing to brute-force expected tag...
```diff diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index f41e64f1dab2..516822007921 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -21,6 +21,7 @@ #include <linux/reboot.h> #include <crypto/hash.h> #include <crypto/skcipher.h> +#include <crypto/utils.h> #include <li...
6b1e0b9e182e4f2117a1c72947d4ab26f43533d8
Analyze and fix the following issue in the Linux kernel code: bcachefs: fix logging in journal_entry_err_msg()
Problem Details: We want to log errors all at once, not spread across multiple printks. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c index 4ed6137f0439..bce4fa2648a2 100644 --- a/fs/bcachefs/journal_io.c +++ b/fs/bcachefs/journal_io.c @@ -308,8 +308,8 @@ static void journal_entry_err_msg(struct printbuf *out, break; \ case WRITE: \ bch2_sb_error_count(c, BCH...
35a11506a341cca48900570f68abdaefc9b84646
Analyze and fix the following issue in the Linux kernel code: bcachefs: print_string_as_lines: fix extra newline
Problem Details: Don't print a newline on empty string; this was causing us to also print an extra newline when we got to the end of th string. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index 553de8d8e3e5..87af551692f4 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -270,7 +270,7 @@ static void __bch2_print_string_as_lines(const char *prefix, const char *lines, locked = console_trylock(); } - while (1) { + while (*lines) {...
3c72d3eea97ba6cd41486b1c4ba2c69342b003c2
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix WARN() in bch2_bkey_pick_read_device()
Problem Details: syzbot discovered that this one is possible: we have pointers, but none of them are to valid devices. Reported-by: syzbot+336a6e6a2dbb7d4dba9a@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/errcode.h b/fs/bcachefs/errcode.h index 5c8e40dea711..c8696f01eb14 100644 --- a/fs/bcachefs/errcode.h +++ b/fs/bcachefs/errcode.h @@ -310,6 +310,7 @@ x(BCH_ERR_data_write, data_write_misaligned) \ x(BCH_ERR_decompress, data_read) \ x(BCH_ERR_data_read, no_device_to_read_fr...
0b50eb7f3aa3d7cd67689aa4ea2d04f86cdf0eff
Analyze and fix the following issue in the Linux kernel code: drm/nouveau/outp: Avoid -Wflex-array-member-not-at-end warning
Problem Details: -Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of a flexible structure where the size of the flexible-array member is known at compile-time, and refactor the rest of the code, accor...
```diff diff --git a/drivers/gpu/drm/nouveau/nvif/outp.c b/drivers/gpu/drm/nouveau/nvif/outp.c index 6daeb7f0b09b..1ea20b2bdd29 100644 --- a/drivers/gpu/drm/nouveau/nvif/outp.c +++ b/drivers/gpu/drm/nouveau/nvif/outp.c @@ -195,20 +195,17 @@ nvif_outp_dp_aux_pwr(struct nvif_outp *outp, bool enable) int nvif_outp_hda_e...
f945dd89fa8da3f662508165453dafdb4035d9d3
Analyze and fix the following issue in the Linux kernel code: drm/xe/d3cold: Set power state to D3Cold during s2idle/s3
Problem Details: According to pci core guidelines, pci_save_config is recommended when the driver explicitly needs to set the pci power state. As of now xe kmd is only doing pci_save_config while entering to s2idle/s3 state, which makes pci core think that device driver has already applied required pci power state. Thi...
```diff diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c index 88138a3fcf50..58347fa91841 100644 --- a/drivers/gpu/drm/xe/xe_pci.c +++ b/drivers/gpu/drm/xe/xe_pci.c @@ -924,6 +924,7 @@ static int xe_pci_suspend(struct device *dev) pci_save_state(pdev); pci_disable_device(pdev); + pci_set_pow...
1f4bb8254c6f12c306604a627b9968fc312fe5b0
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix bch2_seek_hole() locking
Problem Details: We can't call bch2_seek_pagecache_hole(), and block on page locks, with btree locks held. This is easily fixed because we're at the end of the transaction - we can just unlock, we don't need a drop_locks_do(). Reported-by: https://github.com/nagalun Signed-off-by: Kent Overstreet <kent.overstreet@lin...
```diff diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c index 717e7b94c66f..cc366786f0f9 100644 --- a/fs/bcachefs/fs-io.c +++ b/fs/bcachefs/fs-io.c @@ -999,17 +999,19 @@ static loff_t bch2_seek_hole(struct file *file, u64 offset) POS(inode->v.i_ino, offset >> 9), POS(inode->v.i_ino, U64_MAX), ...
8226bc5ac857ab681a3e81a7a6f7da46a447f3df
Analyze and fix the following issue in the Linux kernel code: drm/nouveau/conn: Avoid -Wflex-array-member-not-at-end warning
Problem Details: -Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of a flexible structure where the size of the flexible-array member is known at compile-time, and refactor the rest of the code, accor...
```diff diff --git a/drivers/gpu/drm/nouveau/nvif/conn.c b/drivers/gpu/drm/nouveau/nvif/conn.c index 9ee18cb99264..5a1a83c62a2a 100644 --- a/drivers/gpu/drm/nouveau/nvif/conn.c +++ b/drivers/gpu/drm/nouveau/nvif/conn.c @@ -30,17 +30,17 @@ int nvif_conn_event_ctor(struct nvif_conn *conn, const char *name, nvif_event_fu...
c6c6a391097a6367cdbc663957010f03d9dbb361
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix permissions on version modparam
Problem Details: There's no reason for this not to be world readable - it provides the currently supported on disk format version. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index 99f9a0aaa380..64432233303a 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -2259,7 +2259,7 @@ BCH_DEBUG_PARAMS() __maybe_unused static unsigned bch2_metadata_version = bcachefs_metadata_version_current; -module_param_named(version, b...
7be11d34f660bfa6583f3d6e2032d5dcbff56081
Analyze and fix the following issue in the Linux kernel code: iommufd: Test attach before detaching pasid
Problem Details: Check if the pasid has been attached before going further in the detach path. This fixes a crash found by syzkaller. Add a selftest as well. Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASI KASAN: null-ptr-deref in range [0x000000000000000...
```diff diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c index 2307daad65c0..2111bad72c72 100644 --- a/drivers/iommu/iommufd/device.c +++ b/drivers/iommu/iommufd/device.c @@ -644,6 +644,11 @@ iommufd_hw_pagetable_detach(struct iommufd_device *idev, ioasid_t pasid) mutex_lock(&igroup->loc...
ae958b12940bcd4ffa32c44684e4f2878bc5e140
Analyze and fix the following issue in the Linux kernel code: objtool, drm/vmwgfx: Don't ignore vmw_send_msg() for ORC
Problem Details: The following commit: 0b0d81e3b733 ("objtool, drm/vmwgfx: Fix "duplicate frame pointer save" warning") ... marked vmw_send_msg() STACK_FRAME_NON_STANDARD because it uses RBP in a non-standard way which violates frame pointer convention. That issue only affects the frame pointer unwinder. Remove t...
```diff diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c index 1f15990d3934..1d9a42cbc88f 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c @@ -289,7 +289,7 @@ static int vmw_send_msg(struct rpc_channel *channel, const char *msg) return ...
b5e2cc57f551a1a1e2c0ea36f77c1e26d3d13c35
Analyze and fix the following issue in the Linux kernel code: objtool: Fix STACK_FRAME_NON_STANDARD for cold subfunctions
Problem Details: The recent STACK_FRAME_NON_STANDARD refactoring forgot about .cold subfunctions. They must also be ignored. Fixes the following warning: drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool: vmw_recv_msg.cold+0x0: unreachable instruction Fixes: c84301d706c5 ("objtool: Ignore entire functions rat...
```diff diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 29de1709ea00..fff9d7a2947a 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1014,6 +1014,8 @@ static int add_ignores(struct objtool_file *file) } func->ignore = true; + if (func->cfunc) + func->cfunc->ignore = true; ...
69d41d6dafff0967565b971d950bd10443e4076c
Analyze and fix the following issue in the Linux kernel code: objtool: Fix segfault in ignore_unreachable_insn()
Problem Details: Check 'prev_insn' before dereferencing it. Fixes: bd841d6154f5 ("objtool: Fix CONFIG_UBSAN_TRAP unreachable warnings") Reported-by: Arnd Bergmann <arnd@arndb.de> Reported-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org...
```diff diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 3bf29923d5c0..29de1709ea00 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -4037,7 +4037,7 @@ static bool ignore_unreachable_insn(struct objtool_file *file, struct instructio * It may also insert a UD2 after calling a __noretu...
d9a595c3850ea4383628115df2bb533af3b29f4f
Analyze and fix the following issue in the Linux kernel code: objtool: Fix NULL printf() '%s' argument in builtin-check.c:save_argv()
Problem Details: It's probably not the best idea to pass a string pointer to printf() right after confirming said pointer is NULL. Fix the typo and use argv[i] instead. Fixes: c5995abe1547 ("objtool: Improve error handling") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Josh Poimboeuf <jpoimboe@...
```diff diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index 2bdff910430e..e364ab6345d3 100644 --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -238,7 +238,7 @@ static void save_argv(int argc, const char **argv) for (int i = 0; i < argc; i++) { orig_argv[i] = s...
05026ea01e95ffdeb0e5ac8fb7fb1b551e3a8726
Analyze and fix the following issue in the Linux kernel code: objtool, lkdtm: Obfuscate the do_nothing() pointer
Problem Details: If execute_location()'s memcpy of do_nothing() gets inlined and unrolled by the compiler, it copies one word at a time: mov 0x0(%rip),%rax R_X86_64_PC32 .text+0x1374 mov %rax,0x38(%rbx) mov 0x0(%rip),%rax R_X86_64_PC32 .text+0x136c mov %rax,0x30(%rbx) ... T...
```diff diff --git a/drivers/misc/lkdtm/perms.c b/drivers/misc/lkdtm/perms.c index 5b861dbff27e..6c24426104ba 100644 --- a/drivers/misc/lkdtm/perms.c +++ b/drivers/misc/lkdtm/perms.c @@ -28,6 +28,13 @@ static const unsigned long rodata = 0xAA55AA55; /* This is marked __ro_after_init, so it should ultimately be .rodata...
858c9c10c123b7b04bba12c689db675c18d48bda
Analyze and fix the following issue in the Linux kernel code: iommufd: Fix iommu_vevent_header tables markup
Problem Details: Stephen Rothwell reports htmldocs warnings on iommufd_vevent_header tables: Documentation/userspace-api/iommufd:323: ./include/uapi/linux/iommufd.h:1048: CRITICAL: Unexpected section title or transition. ------------------------------------------------------------------------- [docutils] WARNING: ker...
```diff diff --git a/include/uapi/linux/iommufd.h b/include/uapi/linux/iommufd.h index e2c04e58a997..f29b6c44655e 100644 --- a/include/uapi/linux/iommufd.h +++ b/include/uapi/linux/iommufd.h @@ -1045,21 +1045,26 @@ enum iommu_veventq_flag { * [0, INT_MAX] where the following index of INT_MAX is 0 * * E...
3a2ffd3f3e1b6df4ed7b35f98565c1ad0fe54840
Analyze and fix the following issue in the Linux kernel code: iommu: Convert unreachable() to BUG()
Problem Details: Bare unreachable() should be avoided as it generates undefined behavior, e.g. falling through to the next function. Use BUG() instead so the error is defined. Fixes the following warnings: drivers/iommu/dma-iommu.o: warning: objtool: iommu_dma_sw_msi+0x92: can't find jump dest instruction at .text...
```diff diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 2bd9f80a83fe..8cc5397d7dfc 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -1762,7 +1762,7 @@ static size_t cookie_msi_granule(const struct iommu_domain *domain) case IOMMU_COOKIE_DMA_MSI: return PAGE_SIZE; ...
6fc85bbbeaeae39c61d230ce279c0b0d0952d3e3
Analyze and fix the following issue in the Linux kernel code: iommufd: Balance veventq->num_events inc/dec
Problem Details: iommufd_veventq_fops_read() decrements veventq->num_events when a vevent is read out. However, the report path ony increments veventq->num_events for normal events. To be balanced, make the read path decrement num_events only for normal vevents. Fixes: e36ba5ab808e ("iommufd: Add IOMMUFD_OBJ_VEVENTQ a...
```diff diff --git a/drivers/iommu/iommufd/eventq.c b/drivers/iommu/iommufd/eventq.c index 4c43ace8c725..f39cf0797347 100644 --- a/drivers/iommu/iommufd/eventq.c +++ b/drivers/iommu/iommufd/eventq.c @@ -385,7 +385,8 @@ static ssize_t iommufd_veventq_fops_read(struct file *filep, char __user *buf, break; } spi...
41464a4628f3b15988bdc3dcd824c2e91064fc6f
Analyze and fix the following issue in the Linux kernel code: iommufd: Initialize the flags of vevent in iommufd_viommu_report_event()
Problem Details: The vevent->header.flags is not initialized per allocation, hence the vevent read path may treat the vevent as lost_events_header wrongly. Use kzalloc() to alloc memory for new vevent. Fixes: e8e1ef9b77a7 ("iommufd/viommu: Add iommufd_viommu_report_event helper") Link: https://patch.msgid.link/r/20250...
```diff diff --git a/drivers/iommu/iommufd/driver.c b/drivers/iommu/iommufd/driver.c index a08ff0f37fc6..922cd1fe7ec2 100644 --- a/drivers/iommu/iommufd/driver.c +++ b/drivers/iommu/iommufd/driver.c @@ -102,7 +102,7 @@ int iommufd_viommu_report_event(struct iommufd_viommu *viommu, goto out_set_header; } - vevent...
40780b9760b561e093508d07b8b9b06c94ab201e
Analyze and fix the following issue in the Linux kernel code: drm/xe/hw_engine: define sysfs_ops on all directories
Problem Details: Sysfs_ops needs to be defined on all directories which can have attr files with set/get method. Add sysfs_ops to even those directories which is currently empty but would have attr files with set/get method in future. Leave .default with default sysfs_ops as it will never have setter method. V2(Himal/...
```diff diff --git a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c index e238c0e9fdd0..640950172088 100644 --- a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c +++ b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c @@ -32,14 +32,61 @@ bool xe_hw_engine_timeout_in_range(u64 ti...
de48d7fff7b4668a61c3c1d13ca0f6a6b3995519
Analyze and fix the following issue in the Linux kernel code: ring-buffer: Remove the unused variable bmeta
Problem Details: Variable bmeta is not effectively used, so delete it. kernel/trace/ring_buffer.c:1952:27: warning: variable ‘bmeta’ set but not used. Link: https://lore.kernel.org/20250317015524.3902-1-jiapeng.chong@linux.alibaba.com Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openano...
```diff diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index b981eb20c206..f25966b3a1fc 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -1949,7 +1949,6 @@ static void rb_meta_validate_events(struct ring_buffer_per_cpu *cpu_buffer) static void rb_range_meta_init(struct ...
f00c9201f942dddb58617c881ffd4e4a1a1c49ab
Analyze and fix the following issue in the Linux kernel code: tracing: Fix a compilation error without CONFIG_MODULES
Problem Details: There are some code which depends on CONFIG_MODULES. #ifdef to enclose it. Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Link: https://lore.kernel.org/174230515367.2909896.8132122175220657625.stgit@mhiramat.tok.corp.google.com Fixes: dca91c1c5468 ("tracing: Have persistent trace instances sav...
```diff diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index e7a14bb7d7aa..7f8b0c43d2a5 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -6001,6 +6001,7 @@ struct trace_scratch { static DEFINE_MUTEX(scratch_mutex); +#ifdef CONFIG_MODULES static int save_mod(struct module *mod, void *data)...
4af0a9c518522892b36cb7ecedf0c6004dc0a581
Analyze and fix the following issue in the Linux kernel code: ring-buffer: Add ring_buffer_meta_scratch()
Problem Details: Now that there's one meta data at the start of the persistent memory used by the ring buffer, allow the caller to request some memory right after that data that it can use as its own persistent memory. Also fix some white space issues with ring_buffer_alloc(). Cc: Mark Rutland <mark.rutland@arm.com> ...
```diff diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index 8de035f4f0d9..019b59a0bbc9 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h @@ -92,9 +92,11 @@ __ring_buffer_alloc(unsigned long size, unsigned flags, struct lock_class_key *k struct trace_buffer *__ring_buff...
c73f0b69648501978e8b3e8fa7eef7f4197d0481
Analyze and fix the following issue in the Linux kernel code: ring-buffer: Fix bytes_dropped calculation issue
Problem Details: The calculation of bytes-dropped and bytes_dropped_nested is reversed. Although it does not affect the final calculation of total_dropped, it should still be modified. Link: https://lore.kernel.org/20250223070106.6781-1-yangfeng59949@163.com Fixes: 6c43e554a2a5 ("ring-buffer: Add ring buffer startup s...
```diff diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index bb6089c2951e..510409f97992 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -7411,9 +7411,9 @@ static __init int rb_write_something(struct rb_test_data *data, bool nested) /* Ignore dropped events before tes...
bd67c1c3c353b6560f2983bdd23c665e26cf83f9
Analyze and fix the following issue in the Linux kernel code: vsnprintf: Silence false positive GCC warning for va_format()
Problem Details: va_format() is using vsnprintf(), and GCC compiler (Debian 14.2.0-17) is not happy about this: lib/vsprintf.c:1704:9: error: function ‘va_format’ might be a candidate for ‘gnu_print ’ format attribute [-Werror=suggest-attribute=format] Fix the compilation errors (`make W=1` when CONFIG_WERROR=y, whic...
```diff diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 4a04828916e2..a2195bc81723 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1699,6 +1699,10 @@ char *escaped_string(char *buf, char *end, u8 *addr, struct printf_spec spec, return buf; } +#pragma GCC diagnostic push +#ifndef __clang__ +#pragma GCC diag...
7bf819aa992faee980610e9021aec0c38aac53be
Analyze and fix the following issue in the Linux kernel code: vsnprintf: Mark binary printing functions with __printf() attribute
Problem Details: Binary printf() functions are using printf() type of format, and compiler is not happy about them as is: lib/vsprintf.c:3130:47: error: function ‘vbin_printf’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format] lib/vsprintf.c:3298:33: error: function ‘bstr_printf’...
```diff diff --git a/include/linux/string.h b/include/linux/string.h index 0403a4ca4c11..01621ad0f598 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -336,8 +336,8 @@ int __sysfs_match_string(const char * const *array, size_t n, const char *s); #define sysfs_match_string(_a, _s) __sysfs_match_strin...
196a062641fe68d9bfe0ad36b6cd7628c99ad22c
Analyze and fix the following issue in the Linux kernel code: tracing: Mark binary printing functions with __printf() attribute
Problem Details: Binary printing functions are using printf() type of format, and compiler is not happy about them as is: kernel/trace/trace.c:3292:9: error: function ‘trace_vbprintk’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format] kernel/trace/trace_seq.c:182:9: error: functi...
```diff diff --git a/include/linux/trace.h b/include/linux/trace.h index fdcd76b7be83..7eaad857dee0 100644 --- a/include/linux/trace.h +++ b/include/linux/trace.h @@ -72,8 +72,8 @@ static inline int unregister_ftrace_export(struct trace_export *export) static inline void trace_printk_init_buffers(void) { } -static i...
6b2c1e30ad6846624d935a7ea98dae60458126b8
Analyze and fix the following issue in the Linux kernel code: seq_file: Mark binary printing functions with __printf() attribute
Problem Details: Binary printing functions are using printf() type of format, and compiler is not happy about them as is: fs/seq_file.c:418:35: error: function ‘seq_bprintf’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format] Fix the compilation errors by adding __printf() attrib...
```diff diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 2fb266ea69fa..d6ebf0596510 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h @@ -181,6 +181,7 @@ int seq_open_private(struct file *, const struct seq_operations *, int); int seq_release_private(struct inode *, struct file...
079a206f51f0c183be96a2f78f183dee42df1d4a
Analyze and fix the following issue in the Linux kernel code: seq_buf: Mark binary printing functions with __printf() attribute
Problem Details: Binary printing functions are using printf() type of format, and compiler is not happy about them as is: lib/seq_buf.c:162:17: error: function ‘seq_buf_bprintf’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format] Fix the compilation errors by adding __printf() at...
```diff diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h index fe41da005970..52791e070506 100644 --- a/include/linux/seq_buf.h +++ b/include/linux/seq_buf.h @@ -167,8 +167,8 @@ extern int seq_buf_hex_dump(struct seq_buf *s, const char *prefix_str, const void *buf, size_t len, bool ascii); #ifde...
31ab12df723543047c3fc19cb8f8c4498ec6267f
Analyze and fix the following issue in the Linux kernel code: x86/microcode/AMD: Fix __apply_microcode_amd()'s return value
Problem Details: When verify_sha256_digest() fails, __apply_microcode_amd() should propagate the failure by returning false (and not -1 which is promoted to true). Fixes: 50cef76d5cb0 ("x86/microcode/AMD: Load only SHA256-checksummed patches") Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: ...
```diff diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index 138689b8e1d8..b61028cf5c8a 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -600,7 +600,7 @@ static bool __apply_microcode_amd(struct microcode_amd *mc, u32 *cur_rev, unsig...
2ea396448f26d0d7d66224cb56500a6789c7ed07
Analyze and fix the following issue in the Linux kernel code: net: usb: usbnet: restore usb%d name exception for local mac addresses
Problem Details: commit 8a7d12d674ac ("net: usb: usbnet: fix name regression") assumed that local addresses always came from the kernel, but some devices hand out local mac addresses so we ended up with point-to-point devices with a mac set by the driver, renaming to eth%d when they used to be named usb%d. Userspace s...
```diff diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 44179f4e807f..aeab2308b150 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -178,6 +178,17 @@ int usbnet_get_ethernet_addr(struct usbnet *dev, int iMACAddress) } EXPORT_SYMBOL_GPL(usbnet_get_ethernet_addr); +static...
fab05835688526f9de123d1e98e4d1f838da4e22
Analyze and fix the following issue in the Linux kernel code: net/mlx5e: SHAMPO, Make reserved size independent of page size
Problem Details: When hw-gro is enabled, the maximum number of header entries that are needed per wqe (hd_per_wqe) is calculated based on the size of the reservations among other parameters. Miscalculation of the size of reservations leads to incorrect calculation of hd_per_wqe as 0, particularly in the case of large ...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c index aa36670d9a36..58ec5e44aa7a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c @@ -430,7 +430,7 @@ u8 mlx5e_shampo_g...
fa37a8849634db2dd3545116873da8cf4b1e67c6
Analyze and fix the following issue in the Linux kernel code: net: mana: Switch to page pool for jumbo frames
Problem Details: Frag allocators, such as netdev_alloc_frag(), were not designed to work for fragsz > PAGE_SIZE. So, switch to page pool for jumbo frames instead of using page frag allocators. This driver is using page pool for smaller MTUs already. Cc: stable@vger.kernel.org Fixes: 80f6215b450e ("net: mana: Add supp...
```diff diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c index e190d5ee5154..3ac73d97337e 100644 --- a/drivers/net/ethernet/microsoft/mana/mana_en.c +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c @@ -661,30 +661,16 @@ int mana_pre_alloc_rxbufs(struct mana_p...
923936efeb74b3f42e5ad283a0b9110bda102601
Analyze and fix the following issue in the Linux kernel code: iomap: Fix conflicting values of iomap flags
Problem Details: IOMAP_F_ATOMIC_BIO mistakenly took the same value as of IOMAP_F_SIZE_CHANGED in patch '370a6de7651b ("iomap: rework IOMAP atomic flags")'. Let's fix this and let's also create some more space for filesystem reported flags to avoid this in future. This patch makes the core iomap flags to start from bit ...
```diff diff --git a/include/linux/iomap.h b/include/linux/iomap.h index 02fe001feebb..68416b135151 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -78,6 +78,11 @@ struct vm_fault; #define IOMAP_F_ANON_WRITE (1U << 7) #define IOMAP_F_ATOMIC_BIO (1U << 8) +/* + * Flag reserved for file system speci...
9e6901f17a719650be376f04d742bdbe1d7094ce
Analyze and fix the following issue in the Linux kernel code: fs: namespace: Avoid -Wflex-array-member-not-at-end warning
Problem Details: -Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Move the conflicting declaration to the end of the structure. Notice that `struct statmount` is a flexible structure --a structure that contains a flexible-array member. Fix the following warning...
```diff diff --git a/fs/namespace.c b/fs/namespace.c index 6100e5b962a6..16292ff760c9 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -5326,8 +5326,10 @@ struct kstatmount { struct mnt_idmap *idmap; u64 mask; struct path root; - struct statmount sm; struct seq_file seq; + + /* Must be last --ends in a flexi...
ddb7ea36ba7129c2ed107e2186591128618864e1
Analyze and fix the following issue in the Linux kernel code: ksmbd: fix r_count dec/increment mismatch
Problem Details: r_count is only increased when there is an oplock break wait, so r_count inc/decrement are not paired. This can cause r_count to become negative, which can lead to a problem where the ksmbd thread does not terminate. Fixes: 3aa660c05924 ("ksmbd: prevent connection release during oplock break notificat...
```diff diff --git a/fs/smb/server/oplock.c b/fs/smb/server/oplock.c index 894b53b0cf8c..f103b1bd0400 100644 --- a/fs/smb/server/oplock.c +++ b/fs/smb/server/oplock.c @@ -724,8 +724,8 @@ static int smb2_oplock_break_noti(struct oplock_info *opinfo) work->conn = conn; work->sess = opinfo->sess; + ksmbd_conn_r_coun...
c1883049aa9b2b7dffd3a68c5fc67fa92c174bd9
Analyze and fix the following issue in the Linux kernel code: ksmbd: fix multichannel connection failure
Problem Details: ksmbd check that the session of second channel is in the session list of first connection. If it is in session list, multichannel connection should not be allowed. Fixes: b95629435b84 ("ksmbd: fix racy issue from session lookup and expire") Reported-by: Sean Heelan <seanheelan@gmail.com> Signed-off-by...
```diff diff --git a/fs/smb/server/mgmt/user_session.c b/fs/smb/server/mgmt/user_session.c index 1ecca6785ed0..53d308f331af 100644 --- a/fs/smb/server/mgmt/user_session.c +++ b/fs/smb/server/mgmt/user_session.c @@ -259,6 +259,22 @@ void ksmbd_sessions_deregister(struct ksmbd_conn *conn) up_write(&sessions_table_lock)...
15a9605f8d69dc85005b1a00c31a050b8625e1aa
Analyze and fix the following issue in the Linux kernel code: ksmbd: fix use-after-free in ksmbd_sessions_deregister()
Problem Details: In multichannel mode, UAF issue can occur in session_deregister when the second channel sets up a session through the connection of the first channel. session that is freed through the global session table can be accessed again through ->sessions of connection. Cc: stable@vger.kernel.org Reported-by: ...
```diff diff --git a/fs/smb/server/mgmt/user_session.c b/fs/smb/server/mgmt/user_session.c index 71c6939dfbf1..1ecca6785ed0 100644 --- a/fs/smb/server/mgmt/user_session.c +++ b/fs/smb/server/mgmt/user_session.c @@ -230,6 +230,9 @@ void ksmbd_sessions_deregister(struct ksmbd_conn *conn) if (!ksmbd_chann_del(conn, se...
6171063e9d046ffa46f51579b2ca4a43caef581a
Analyze and fix the following issue in the Linux kernel code: ksmbd: use aead_request_free to match aead_request_alloc
Problem Details: Use aead_request_free() instead of kfree() to properly free memory allocated by aead_request_alloc(). This ensures sensitive crypto data is zeroed before being freed. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Acked-by: Namjae Je...
```diff diff --git a/fs/smb/server/auth.c b/fs/smb/server/auth.c index 2a5b4a96bf99..00b31cf86462 100644 --- a/fs/smb/server/auth.c +++ b/fs/smb/server/auth.c @@ -1218,7 +1218,7 @@ free_iv: free_sg: kfree(sg); free_req: - kfree(req); + aead_request_free(req); free_ctx: ksmbd_release_crypto_ctx(ctx); return rc;...
1a81ea738c030dfa83929a954e8c2cd15a91a883
Analyze and fix the following issue in the Linux kernel code: Revert "ksmbd: fix missing RDMA-capable flag for IPoIB device in ksmbd_rdma_capable_netdev()"
Problem Details: This reverts commit ecce70cf17d91c3dd87a0c4ea00b2d1387729701. Revert the GUID trick code causing the layering violation. I will try to allow the users to turn RDMA-capable on/off via sysfs later Cc: Kangjing Huang <huangkangjing@gmail.com> Cc: Leon Romanovsky <leon@kernel.org> Signed-off-by: Namjae J...
```diff diff --git a/fs/smb/server/transport_rdma.c b/fs/smb/server/transport_rdma.c index 1b9f3aee8b4b..9837a41641ce 100644 --- a/fs/smb/server/transport_rdma.c +++ b/fs/smb/server/transport_rdma.c @@ -2142,7 +2142,8 @@ static int smb_direct_ib_client_add(struct ib_device *ib_dev) if (ib_dev->node_type != RDMA_NODE_...
1dfa44db967c5c4f73ba5c9177aeaf2dddaff574
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: Refactor the monitor channel context procedure
Problem Details: Currently, the monitor start procedure use the iteration callback to pick the last available channel definition in the mac80211 hardware. This approach is incorrect for the single wiphy model, as it holds multiple radio/link channel contexts within the same mac80211 hardware. To fix this, change the it...
```diff diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index d4fb776767a9..a5ed74428f23 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -1336,19 +1336,9 @@ static int ath12k_mac_monitor_vdev_delete(struct ath12k *ar) return ...
ea24531d00f782f4e659e8c74578b7ac144720ca
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: fix NULL access in assign channel context handler
Problem Details: Currently, when ath12k_mac_assign_vif_to_vdev() fails, the radio handle (ar) gets accessed from the link VIF handle (arvif) for debug logging, This is incorrect. In the fail scenario, radio handle is NULL. Fix the NULL access, avoid radio handle access by moving to the hardware debug logging helper fun...
```diff diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 245adb73df04..d4fb776767a9 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -9614,8 +9614,8 @@ ath12k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw, ar = ath1...
2826139f9295821fe2b049318a1cc057ec003131
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: fix link valid field initialization in the monitor Rx
Problem Details: Currently, the link_valid field is not initialized in the monitor Rx path. This can result in random values for the link_valid and link_id leads to undefined behaviour in mac80211. Therefore, initialize the link_valid field in the monitor Rx path. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAH...
```diff diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c index d22800e89485..b1350e60e213 100644 --- a/drivers/net/wireless/ath/ath12k/dp_mon.c +++ b/drivers/net/wireless/ath/ath12k/dp_mon.c @@ -1970,6 +1970,8 @@ static void ath12k_dp_mon_rx_deliver_msdu(struct ath12k *ar...
762b7e95362170b3e13a8704f38d5e47eca4ba74
Analyze and fix the following issue in the Linux kernel code: drm/xe: Use local fence in error path of xe_migrate_clear
Problem Details: The intent of the error path in xe_migrate_clear is to wait on locally generated fence and then return. The code is waiting on m->fence which could be the local fence but this is only stable under the job mutex leading to a possible UAF. Fix code to wait on local fence. Fixes: dd08ebf6c352 ("drm/xe: I...
```diff diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c index f64530a64b01..ff0fc2fb0eb9 100644 --- a/drivers/gpu/drm/xe/xe_migrate.c +++ b/drivers/gpu/drm/xe/xe_migrate.c @@ -1177,7 +1177,7 @@ err: err_sync: /* Sync partial copies if any. FIXME: job_mutex? */ if (fence) { - dma_...
12468e519f98e4d93370712e3607fab61df9dae9
Analyze and fix the following issue in the Linux kernel code: drm/xe: Ensure fixed_slice_mode gets set after ccs_mode change
Problem Details: The RCU_MODE_FIXED_SLICE_CCS_MODE setting is not getting invoked in the gt reset path after the ccs_mode setting by the user. Add it to engine register update list (in hw_engine_setup_default_state()) which ensures it gets set in the gt reset and engine reset paths. v2: Add register update to engine l...
```diff diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c index 8c05fd30b7df..93241fd0a4ba 100644 --- a/drivers/gpu/drm/xe/xe_hw_engine.c +++ b/drivers/gpu/drm/xe/xe_hw_engine.c @@ -389,12 +389,6 @@ xe_hw_engine_setup_default_lrc_state(struct xe_hw_engine *hwe) blit_cctl_val, ...
2fa87c71d2adb4b82c105f9191e6120340feff00
Analyze and fix the following issue in the Linux kernel code: ACPI: x86: Extend Lenovo Yoga Tab 3 quirk with skip GPIO event-handlers
Problem Details: Depending on the secureboot signature on EFI\BOOT\BOOTX86.EFI the Lenovo Yoga Tab 3 UEFI will switch its OSID ACPI variable between 1 (Windows) and 4 (Android(GMIN)). In Windows mode a GPIO event handler gets installed for GPO1 pin 5, causing Linux' x86-android-tables code which deals with the general...
```diff diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c index 068c1612660b..4ee30c2897a2 100644 --- a/drivers/acpi/x86/utils.c +++ b/drivers/acpi/x86/utils.c @@ -374,7 +374,8 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = { DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"), }, ...
2da31ea2a085cd189857f2db0f7b78d0162db87a
Analyze and fix the following issue in the Linux kernel code: ACPI: resource: Skip IRQ override on ASUS Vivobook 14 X1404VAP
Problem Details: Like the ASUS Vivobook X1504VAP and Vivobook X1704VAP, the ASUS Vivobook 14 X1404VAP has its keyboard IRQ (1) described as ActiveLow in the DSDT, which the kernel overrides to EdgeHigh breaking the keyboard. $ sudo dmidecode […] System Information Manufacturer: ASUSTeK COMPUTER...
```diff diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index b4cd14e7fa76..14c7bac4100b 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -440,6 +440,13 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = { DMI_MATCH(DMI_BOARD_NAME, "S5602ZA"), }, }, + { + ...
40369bfe717e96e26650eeecfa5a6363563df6e4
Analyze and fix the following issue in the Linux kernel code: spi: fsl-qspi: use devm function instead of driver remove
Problem Details: Driver use devm APIs to manage clk/irq/resources and register the spi controller, but the legacy remove function will be called first during device detach and trigger kernel panic. Drop the remove function and use devm_add_action_or_reset() for driver cleanup to ensure the release sequence. Trigger ke...
```diff diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c index 355e6a39fb41..5c59fddb32c1 100644 --- a/drivers/spi/spi-fsl-qspi.c +++ b/drivers/spi/spi-fsl-qspi.c @@ -844,6 +844,19 @@ static const struct spi_controller_mem_caps fsl_qspi_mem_caps = { .per_op_freq = true, }; +static void fsl_qspi...
7eccc86e90f04a0d758d16c08627a620ac59604d
Analyze and fix the following issue in the Linux kernel code: ASoC: qdsp6: q6asm-dai: fix q6asm_dai_compr_set_params error path
Problem Details: In case of attempts to compress playback something, for instance, when audio routing is not set up correctly, the audio DSP is left in inconsistent state because we are not doing the correct things in the error path of q6asm_dai_compr_set_params(). So, when routing is not set up and compress playback ...
```diff diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c index 045100c94352..a400c9a31fea 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -892,9 +892,7 @@ static int q6asm_dai_compr_set_params(struct snd_soc_component *component, if (ret < 0) ...
4c8c0ffd41d16cf08ccb0d3626beb54adfe5450a
Analyze and fix the following issue in the Linux kernel code: PCI: layerscape: Fix arg_count to syscon_regmap_lookup_by_phandle_args()
Problem Details: The arg_count parameter to syscon_regmap_lookup_by_phandle_args() represents the number of argument cells following the phandle. In this case, the number of arguments should be 1 instead of 2 since the dt property looks like this: fsl,pcie-scfg = <&scfg 0>; Without this fix, layerscape-pcie fails w...
```diff diff --git a/drivers/pci/controller/dwc/pci-layerscape.c b/drivers/pci/controller/dwc/pci-layerscape.c index 239a05b36e8e..a44b5c256d6e 100644 --- a/drivers/pci/controller/dwc/pci-layerscape.c +++ b/drivers/pci/controller/dwc/pci-layerscape.c @@ -356,7 +356,7 @@ static int ls_pcie_probe(struct platform_device *...
2eb6c6a34cb1c22b09b219390cdff0f02cd90258
Analyze and fix the following issue in the Linux kernel code: net: move replay logic to tc_modify_qdisc
Problem Details: Eric reports that by the time we call netdev_lock_ops after rtnl_unlock/rtnl_lock, the dev might point to an invalid device. As suggested by Jakub in [0], move rtnl lock/unlock and request_module outside of qdisc_create. This removes extra complexity with relocking the netdev. 0: https://lore.kernel.o...
```diff diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index defb05c1fba4..f74a097f54ae 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1267,38 +1267,8 @@ static struct Qdisc *qdisc_create(struct net_device *dev, struct qdisc_size_table *stab; ops = qdisc_lookup_ops(kind); -#ifdef CONFIG_MO...
67d1a8956d2d62fe6b4c13ebabb57806098511d8
Analyze and fix the following issue in the Linux kernel code: rndis_host: Flag RNDIS modems as WWAN devices
Problem Details: Set FLAG_WWAN instead of FLAG_ETHERNET for RNDIS interfaces on Mobile Broadband Modems, as opposed to regular Ethernet adapters. Otherwise NetworkManager gets confused, misjudges the device type, and wouldn't know it should connect a modem to get the device to work. What would be the result depends on...
```diff diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index 7b3739b29c8f..bb0bf1415872 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c @@ -630,6 +630,16 @@ static const struct driver_info zte_rndis_info = { .tx_fixup = rndis_tx_fixup, }; +static const struct ...
23f00807619d15063d676218f36c5dfeda1eb420
Analyze and fix the following issue in the Linux kernel code: rtnetlink: Allocate vfinfo size for VF GUIDs when supported
Problem Details: Commit 30aad41721e0 ("net/core: Add support for getting VF GUIDs") added support for getting VF port and node GUIDs in netlink ifinfo messages, but their size was not taken into consideration in the function that allocates the netlink message, causing the following warning when a netlink message is fil...
```diff diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 5a24a30dfc2d..334db17be37d 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -1177,6 +1177,9 @@ static inline int rtnl_vfinfo_size(const struct net_device *dev, /* IFLA_VF_STATS_TX_DROPPED */ nla_total_size_64bit(sizeof(__u...
4bb5d82b66002b770f8917d68ab4fbefcb7f5f9b
Analyze and fix the following issue in the Linux kernel code: Documentation/rv: Add sched pages to the indices
Problem Details: The pages Documentation/tools/rv/rv-mon-sched.rst and Documentation/trace/rv/monitor_sched.rst were introduced but not included in any index. Add them to the respective indices. Cc: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/20250327081240.46422-1-gmonaco@redhat.com Reported-by: S...
```diff diff --git a/Documentation/tools/rv/index.rst b/Documentation/tools/rv/index.rst index 8fd16d91d639..64ba2efe2e85 100644 --- a/Documentation/tools/rv/index.rst +++ b/Documentation/tools/rv/index.rst @@ -15,6 +15,7 @@ Runtime verification (rv) tool rv-mon rv-mon-wip rv-mon-wwnr + rv-mon-sched .....
f8ae35071bfdbc0e992181d267d0de14ccbdb312
Analyze and fix the following issue in the Linux kernel code: drm/panic: add missing Markdown code span
Problem Details: Add missing Markdown code span. This was found using the Clippy `doc_markdown` lint, which we may want to enable. Fixes: cb5164ac43d0 ("drm/panic: Add a QR code panic screen") Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Benno Lossin <...
```diff diff --git a/drivers/gpu/drm/drm_panic_qr.rs b/drivers/gpu/drm/drm_panic_qr.rs index 8d369a5ecf4a..10b94ac18532 100644 --- a/drivers/gpu/drm/drm_panic_qr.rs +++ b/drivers/gpu/drm/drm_panic_qr.rs @@ -876,7 +876,7 @@ impl QrImage<'_> { /// will be encoded as binary segment, otherwise it will be encoded /// ...
7e5f61c1bb26e7928a922702d581eaf0cb449609
Analyze and fix the following issue in the Linux kernel code: drm/panic: add missing space
Problem Details: Add missing space in sentence. This was found using the Clippy `doc_markdown` lint, which we may want to enable. Fixes: cb5164ac43d0 ("drm/panic: Add a QR code panic screen") Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Benno Lossin <b...
```diff diff --git a/drivers/gpu/drm/drm_panic_qr.rs b/drivers/gpu/drm/drm_panic_qr.rs index 3b0dd59781d4..8d369a5ecf4a 100644 --- a/drivers/gpu/drm/drm_panic_qr.rs +++ b/drivers/gpu/drm/drm_panic_qr.rs @@ -5,7 +5,7 @@ //! It is called from a panic handler, so it should't allocate memory and //! does all the work on ...
b88f48f86500bc0b44b4f73ac66d500a40d320ad
Analyze and fix the following issue in the Linux kernel code: drm/xe: Fix an out-of-bounds shift when invalidating TLB
Problem Details: When the size of the range invalidated is larger than rounddown_pow_of_two(ULONG_MAX), The function macro roundup_pow_of_two(length) will hit an out-of-bounds shift [1]. Use a full TLB invalidation for such cases. v2: - Use a define for the range size limit over which we use a full TLB invalidation....
```diff diff --git a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c index 03072e094991..084cbdeba8ea 100644 --- a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +++ b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c @@ -322,6 +322,13 @@ int xe_gt_tlb_invalidation_ggtt(struct xe_gt *gt...