id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
41460a19654c32d39fd0e3a3671cd8d4b7b8479f
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: fix null dereference in find_network
Problem Details: The variable pwlan has the possibility of being NULL when passed into rtw_free_network_nolock() which would later dereference the variable. Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver") Cc: stable@vger.kernel.org Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com> Link: https://p...
```diff diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index b3a9e40054a7..8e98344951ac 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -826,8 +826,10 @@ static void find_network(struct adapter *adapter) stru...
1585cf83e98db32463e5d54161b06a5f01fe9976
Analyze and fix the following issue in the Linux kernel code: ALSA: hda/conexant: Add quirk for HP ZBook Studio G4
Problem Details: It was reported that we need the same quirk for HP ZBook Studio G4 (SSID 103c:826b) as other HP models to make the mute-LED working. Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/64d78753-b9ff-4c64-8920-64d8d31cd20c@gmail.com Link: https://bugzilla.kernel.org/show_bug.cgi?id=221002 Link: ...
```diff diff --git a/sound/hda/codecs/conexant.c b/sound/hda/codecs/conexant.c index 2384e64eada3..5623d8c0a0f7 100644 --- a/sound/hda/codecs/conexant.c +++ b/sound/hda/codecs/conexant.c @@ -1081,6 +1081,7 @@ static const struct hda_quirk cxt5066_fixups[] = { SND_PCI_QUIRK(0x103c, 0x8174, "HP Spectre x360", CXT_FIXUP...
02df7c635bd3463abcd92414e32a2cb906089e72
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: fix potential race in expire_timeout_chk
Problem Details: The expire_timeout_chk function currently do lock and unlock inside the loop before calling rtw_free_stainfo(). This can be risky as the list might be changed when the lock is briefly released. To fix this, move expired sta_info entries into a local free_list while holding the lock, and then perform ...
```diff diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c index 477fe238add4..2900ff476fc1 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ap.c +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c @@ -178,6 +178,8 @@ void expire_timeout_chk(struct adapter *padapter) struct sta_pr...
8ae0398e70d9d64309708471cf7747097a5f755e
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: remove dead debugging code in rtw_mlme_ext.c
Problem Details: Remove the unused local variable 'pattrib' and the unreachable 'if (0)' debug block in OnAction_sa_query to clean up the driver code. Signed-off-by: Luka Gejak <lukagejak5@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/20260130185658.207785-6-lukagejak5...
```diff diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index c04899de2c02..7fb7cdd6e018 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -1838,7 +1838,6 @@ exit: unsigned int OnAction_sa_query(s...
908c03bf95eb8977afd4fdf5a5338fd1077968e4
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: fix spacing around operators
Problem Details: Fix coding style issues by adding missing spaces around operators. Signed-off-by: Luka Gejak <lukagejak5@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/20260130185658.207785-4-lukagejak5@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundatio...
```diff diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c index babb83bc68f9..0065226c9bd2 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c @@ -17,8 +17,8 @@ static void _FWDownloadEnab...
7de30d5d76aa614777a02a9807d29ed65b0704a0
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: remove unused private debug counters
Problem Details: The driver maintains a private `struct debug_priv` embedded within `struct dvobj_priv` to track various error counters (e.g., suspend errors, alloc failures, RX drops). These counters are incremented in various files but the data is never read or exposed to userspace. Remove the unused `debug_priv` s...
```diff diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index 8e1e1c97f0c4..5693afabda2e 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -819,15 +819,6 @@ static void free_scanqueue(struct mlme_priv *pmlmepriv) ...
c41ac3530710e9d49e0ddd5e6f338407f6d4ab00
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: remove thread wraper functions and add IS_ERR() check
Problem Details: The rtl8723b_start_thread() and rtl8723b_stop_thread() functions are wrappers that are only called from one place each. Remove these wrapper functions and inline the thread handling directly in rtw_start_drv_threads() and rtw_stop_drv_threads(). This also fixes a bug where kthread_run() was not checke...
```diff diff --git a/drivers/staging/rtl8723bs/hal/hal_intf.c b/drivers/staging/rtl8723bs/hal/hal_intf.c index 4ca950ff20ad..27c0c0198714 100644 --- a/drivers/staging/rtl8723bs/hal/hal_intf.c +++ b/drivers/staging/rtl8723bs/hal/hal_intf.c @@ -218,17 +218,6 @@ void rtw_hal_add_ra_tid(struct adapter *padapter, u32 bitmap...
4dba9d6c691327f06276619ae97bab8aa48b2dbe
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: fix firmware memory leak on error
Problem Details: After successfully calling request_firmware(), if the firmware size check fails or if kmemdup() fails, the code jumps to the exit label without calling release_firmware(), causing a memory leak. Call release_firmware() directly in each error path before jumping to cleanup label. Signed-off-by: Samasth...
```diff diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c index 054e2c2eab02..528bc05169de 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c @@ -346,12 +346,14 @@ s32 rtl8723b_FirmwareDo...
500cf758c865fb6fb8c1f70e6b020729928647c1
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: standardize comment style in HAL
Problem Details: The kernel coding style for comments requires a single space after the "/*". Currently, many files in HAL contain two spaces after the "/*", or use irregular indentation. The modified files also suffer from this. Fix line comment style inconsistencies by removing additional space after "/*" to adhere ...
```diff diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c index 988636a16112..4666b2ff3157 100644 --- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c +++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c @@ -11,11 +11,11 @@ static bool CheckPositive(st...
d4f0c3edccddc0af112714f73c35a58892d31b03
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: fix line length check
Problem Details: Fix checkpatch.pl check regarding: - Line length of X exceeds 100 columns Redistribute comments to multiple lines to adhere to kernel coding standards. Signed-off-by: Mahad Ibrahim <mahad.ibrahim.dev@gmail.com> Link: https://patch.msgid.link/20260129160426.13737-5-mahad.ibrahim.dev@gmail.com Signed-o...
```diff diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c index b7176a992518..e428884335a8 100644 --- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c +++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c @@ -60,7 +60,8 @@ static bool CheckPositive(s...
ce154efc0463707ecac422750f6ecf0fb199f97b
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: fix missing blank line after declaration
Problem Details: Fix checkpatch.pl warning regarding: - Missing a blank line after declarations Adhere to kernel coding standards by adding a blank line after variable declaration. Signed-off-by: Mahad Ibrahim <mahad.ibrahim.dev@gmail.com> Link: https://patch.msgid.link/20260129160426.13737-4-mahad.ibrahim.dev@gmail....
```diff diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c index 1fbb71149cc7..b7176a992518 100644 --- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c +++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c @@ -47,6 +47,7 @@ static bool CheckPositive(s...
d868ba303275e6454f38f71799d4e0c26fe786b2
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: fix multiple blank line check
Problem Details: Fix checkpatch.pl check regarding: - Please don't use multiple blank lines Remove multiple blank lines to adhere to kernel coding standards. Signed-off-by: Mahad Ibrahim <mahad.ibrahim.dev@gmail.com> Link: https://patch.msgid.link/20260129160426.13737-3-mahad.ibrahim.dev@gmail.com Signed-off-by: Greg...
```diff diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c index ab5af96c335f..988636a16112 100644 --- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c +++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c @@ -31,7 +31,6 @@ static bool CheckPositive(struc...
2a9fa972e3082343e0bb103bb272b7c604fa303a
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: fix open parenthesis alignment
Problem Details: Fix checkpatch.pl check regarding: - Lines should not end with a '(' Collapse the multi-line function signature of CheckPositive() into a single line to adhere to kernel coding standards. Signed-off-by: Mahad Ibrahim <mahad.ibrahim.dev@gmail.com> Link: https://patch.msgid.link/20260129160426.13737-2-...
```diff diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c index 5fcb9420fb3d..ab5af96c335f 100644 --- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c +++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c @@ -8,9 +8,7 @@ #include <linux/kernel.h> #incl...
54911107352dfe04b56828dd9f81fd570c1b76b0
Analyze and fix the following issue in the Linux kernel code: staging: most: video: fix potential race in list iteration
Problem Details: There is a pattern in the loops where the lock is dropped to call a specific function and then re-acquired. The list can be exposed during this short gap, creating a potential race condition. This patch fixes the problem by replacing the list head with a local free list using list_replace_init(), inst...
```diff diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c index 32f71d9a9cf7..8eeae209ff1c 100644 --- a/drivers/staging/most/video/video.c +++ b/drivers/staging/most/video/video.c @@ -121,6 +121,7 @@ static int comp_vdev_close(struct file *filp) struct comp_fh *fh = to_comp_fh(filp)...
ad3521dc9c2f9b369f57de1bbcc14f85458a3828
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: constify _action_public_str array
Problem Details: This array is never modified. Add a second const to make the array itself be placed in read-only .rodata instead of just the strings it points to. Fix a WARNING issued by scripts/checkpatch.pl. Signed-off-by: Tanjim Kamal <tanjimkamal1@gmail.com> Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com> ...
```diff diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c index 92b12a13d27c..febc14de6bc0 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c @@ -1139,7 +1139,7 @@ int rtw_action_frame_parse(const u8...
6d2f142b1e4b203387a92519d9d2e34752a79dbb
Analyze and fix the following issue in the Linux kernel code: net: hns3: fix double free issue for tx spare buffer
Problem Details: In hns3_set_ringparam(), a temporary copy (tmp_rings) of the ring structure is created for rollback. However, the tx_spare pointer in the original ring handle is incorrectly left pointing to the old backup memory. Later, if memory allocation fails in hns3_init_all_ring() during the setup, the error pa...
```diff diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 7a9573dcab74..e879b04e21b0 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -1048,13 +1048,13 @@ static void hns3_init_tx_spar...
5d41f95f5d0bd9db02f3f16a649d0631f71e9fdb
Analyze and fix the following issue in the Linux kernel code: dpll: zl3073x: Fix output pin phase adjustment sign
Problem Details: The output pin phase adjustment functions incorrectly negate the phase compensation value. Per the ZL3073x datasheet, the output phase compensation register is simply a signed two's complement integer where: - Positive values move the phase later in time - Negative values move the phase earlier in t...
```diff diff --git a/drivers/dpll/zl3073x/dpll.c b/drivers/dpll/zl3073x/dpll.c index 9879d85d29af..a8001c976038 100644 --- a/drivers/dpll/zl3073x/dpll.c +++ b/drivers/dpll/zl3073x/dpll.c @@ -1039,10 +1039,8 @@ zl3073x_dpll_output_pin_phase_adjust_get(const struct dpll_pin *dpll_pin, out_id = zl3073x_output_pin_out_ge...
53e553369167d361bdd550d194122ac7cdb00f3c
Analyze and fix the following issue in the Linux kernel code: selftests: mptcp: connect: fix maybe-uninitialize warn
Problem Details: This warning can be seen with GCC 15.2: mptcp_connect.c: In function ‘main_loop’: mptcp_connect.c:1422:37: warning: ‘peer’ may be used uninitialized [-Wmaybe-uninitialized] 1422 | if (connect(fd, peer->ai_addr, peer->ai_addrlen)) | ~~~~^~~...
```diff diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c index 10f6f99cfd4e..24b4abac8687 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -1296,8 +1296,8 @@ void xdisconnect(int fd...
136f1e168f4941021565f8c10ff4bb81b1f13f2c
Analyze and fix the following issue in the Linux kernel code: mptcp: fix kdoc warnings
Problem Details: The following warnings were visible: $ ./scripts/kernel-doc -Wall -none \ net/mptcp/ include/net/mptcp.h include/uapi/linux/mptcp*.h \ include/trace/events/mptcp.h Warning: net/mptcp/token.c:108 No description found for return value of 'mptcp_token_new_request' Warning: net/mptcp...
```diff diff --git a/Documentation/netlink/specs/mptcp_pm.yaml b/Documentation/netlink/specs/mptcp_pm.yaml index ba30a40b9dbf..39f3facc38e5 100644 --- a/Documentation/netlink/specs/mptcp_pm.yaml +++ b/Documentation/netlink/specs/mptcp_pm.yaml @@ -15,6 +15,7 @@ definitions: type: enum name: event-type enu...
364a7084df9f6f1f9383c0c90bb68f9fa49447cd
Analyze and fix the following issue in the Linux kernel code: mptcp: pm: in-kernel: clarify mptcp_pm_remove_anno_addr()
Problem Details: The variable 'ret' was used, but it was not cleared what it was, and probably led to an issue [1]. Rename it to 'announced' to avoid confusions. While at it, remove the returned value of the helper: it is only used in one place, and the returned value is not used. Link: https://github.com/multipath-...
```diff diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c index 4972c19fc73e..b5316a6c7d1b 100644 --- a/net/mptcp/pm_kernel.c +++ b/net/mptcp/pm_kernel.c @@ -1044,24 +1044,23 @@ out_free: return ret; } -static bool mptcp_pm_remove_anno_addr(struct mptcp_sock *msk, +static void mptcp_pm_remove_anno_addr(st...
d191101dee25567c2af3b28565f45346c33d65f5
Analyze and fix the following issue in the Linux kernel code: mptcp: pm: in-kernel: always set ID as avail when rm endp
Problem Details: Syzkaller managed to find a combination of actions that was generating this warning: WARNING: net/mptcp/pm_kernel.c:1074 at __mark_subflow_endp_available net/mptcp/pm_kernel.c:1074 [inline], CPU#1: syz.7.48/2535 WARNING: net/mptcp/pm_kernel.c:1074 at mptcp_pm_nl_fullmesh net/mptcp/pm_kernel.c:1446...
```diff diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c index b26675054b0d..4972c19fc73e 100644 --- a/net/mptcp/pm_kernel.c +++ b/net/mptcp/pm_kernel.c @@ -1056,10 +1056,8 @@ static bool mptcp_pm_remove_anno_addr(struct mptcp_sock *msk, ret = mptcp_remove_anno_list_by_saddr(msk, addr); if (ret || force) ...
fd24173439c033ffb3c2a2628fcbc9cb65e62bdb
Analyze and fix the following issue in the Linux kernel code: myri10ge: avoid uninitialized variable use
Problem Details: While compile testing on less common architectures, I noticed that gcc-10 on s390 finds a bug that all other configurations seem to miss: drivers/net/ethernet/myricom/myri10ge/myri10ge.c: In function 'myri10ge_set_multicast_list': drivers/net/ethernet/myricom/myri10ge/myri10ge.c:391:25: error: 'cmd.da...
```diff diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c index 7be30a8df268..2f0cdbd4e2ac 100644 --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c @@ -688,6 +688,9 @@ static int myri10ge_get_firmw...
2d593cf146706b9a5fc6d8107859e02a8bb17a43
Analyze and fix the following issue in the Linux kernel code: hinic3: select CONFIG_DIMLIB
Problem Details: The driver started using dimlib but fails to select the corresponding symbol, which results in a link failure: x86_64-linux-ld: drivers/net/ethernet/huawei/hinic3/hinic3_irq.o: in function `hinic3_poll': hinic3_irq.c:(.text+0x179): undefined reference to `net_dim' x86_64-linux-ld: drivers/net/ethernet...
```diff diff --git a/drivers/net/ethernet/huawei/hinic3/Kconfig b/drivers/net/ethernet/huawei/hinic3/Kconfig index ce4331d1387b..02d6f91a7f4a 100644 --- a/drivers/net/ethernet/huawei/hinic3/Kconfig +++ b/drivers/net/ethernet/huawei/hinic3/Kconfig @@ -11,6 +11,7 @@ config HINIC3 depends on X86 || ARM64 || COMPILE_TEST...
abf981bb8de6185b2ac80ebc40224d5028e4f8b4
Analyze and fix the following issue in the Linux kernel code: net: skb: allow up to 8 skb extension ids
Problem Details: The skb extension ids range from 0 .. 7 to fit their bits as flags into a single byte. The ids are automatically enumnerated in enum skb_ext_id in skbuff.h, where SKB_EXT_NUM is defined as the last value. When having 8 skb extension ids (0 .. 7), SKB_EXT_NUM becomes 8 which is a valid value for SKB_EX...
```diff diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 45809986dfe1..699c401a5eae 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -5158,7 +5158,7 @@ static __always_inline unsigned int skb_ext_total_length(void) static void skb_extensions_init(void) { - BUILD_BUG_ON(SKB_EXT_NUM >= 8); + BUILD_BU...
dddb0198c2a887c2eba1a8b0113b46b648163048
Analyze and fix the following issue in the Linux kernel code: net: marvell: prestera: fix FEC error message for SFP ports
Problem Details: In prestera_ethtool_set_fecparam(), the error message is opposite of the condition checking PRESTERA_PORT_TCVR_SFP. FEC configuration is not allowed on SFP ports, but the message says "non-SFP ports", which does not match the condition. However, FEC may be required depending on the transceiver, cable, ...
```diff diff --git a/drivers/net/ethernet/marvell/prestera/prestera_ethtool.c b/drivers/net/ethernet/marvell/prestera/prestera_ethtool.c index 2f52daba58e6..750c72f628e5 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_ethtool.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_ethtool.c @@ -717,11 +717,6...
5669645c052f235726a85f443769b6fc02f66762
Analyze and fix the following issue in the Linux kernel code: pstore/ram: fix buffer overflow in persistent_ram_save_old()
Problem Details: persistent_ram_save_old() can be called multiple times for the same persistent_ram_zone (e.g., via ramoops_pstore_read -> ramoops_get_next_prz for PSTORE_TYPE_DMESG records). Currently, the function only allocates prz->old_log when it is NULL, but it unconditionally updates prz->old_log_size to the cu...
```diff diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c index f8b9b47e8b24..7b6d6378a3b8 100644 --- a/fs/pstore/ram_core.c +++ b/fs/pstore/ram_core.c @@ -298,6 +298,17 @@ void persistent_ram_save_old(struct persistent_ram_zone *prz) if (!size) return; + /* + * If the existing buffer is differently size...
05363abc7625cf18c96e67f50673cd07f11da5e9
Analyze and fix the following issue in the Linux kernel code: pstore: ram_core: fix incorrect success return when vmap() fails
Problem Details: In persistent_ram_vmap(), vmap() may return NULL on failure. If offset is non-zero, adding offset_in_page(start) causes the function to return a non-NULL pointer even though the mapping failed. persistent_ram_buffer_map() therefore incorrectly returns success. Subsequent access to prz->buffer may der...
```diff diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c index f1848cdd6d34..f8b9b47e8b24 100644 --- a/fs/pstore/ram_core.c +++ b/fs/pstore/ram_core.c @@ -446,6 +446,13 @@ static void *persistent_ram_vmap(phys_addr_t start, size_t size, vaddr = vmap(pages, page_count, VM_MAP | VM_IOREMAP, prot); kfree(pages...
ba268514ea14b44570030e8ed2aef92a38679e85
Analyze and fix the following issue in the Linux kernel code: rust: devres: fix race condition due to nesting
Problem Details: Commit f5d3ef25d238 ("rust: devres: get rid of Devres' inner Arc") did attempt to optimize away the internal reference count of Devres. However, without an internal reference count, we can't support cases where Devres is indirectly nested, resulting into a deadlock. Such indirect nesting easily happe...
```diff diff --git a/rust/kernel/devres.rs b/rust/kernel/devres.rs index cdc49677022a..6afe196be42c 100644 --- a/rust/kernel/devres.rs +++ b/rust/kernel/devres.rs @@ -21,30 +21,11 @@ use crate::{ sync::{ aref::ARef, rcu, - Completion, // - }, - types::{ - ForeignOwnable, - ...
ad1e0c44a41562cb4f17ba3b6818b19a32702198
Analyze and fix the following issue in the Linux kernel code: mm/readahead: fix typo in comment
Problem Details: Fix a typo in a comment: max_readhead -> max_readahead. Link: https://lkml.kernel.org/r/20260127152535.321951-1-cheng20011202@gmail.com Signed-off-by: Wilson Zeng <cheng20011202@gmail.com> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org...
```diff diff --git a/mm/readahead.c b/mm/readahead.c index b415c9969176..6f231a283f89 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -436,7 +436,7 @@ static unsigned long get_next_ra_size(struct file_ra_state *ra, * based on I/O request size and the max_readahead. * * The code ramps up the readahead size agg...
4188b2592ff646b2c7eacfb9327dc6977187ceab
Analyze and fix the following issue in the Linux kernel code: mm: khugepaged: fix NR_FILE_PAGES and NR_SHMEM in collapse_file()
Problem Details: In META's fleet, we observed high-level cgroups showing zero file memcg stats while their descendants had non-zero values. Investigation using drgn revealed that these parent cgroups actually had negative file stats, aggregated from their children. This issue became more frequent after deploying thp-...
```diff diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 3ba6dcea5993..1b8faae5b448 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -2195,16 +2195,13 @@ immap_locked: xas_lock_irq(&xas); } - if (is_shmem) + if (is_shmem) { + lruvec_stat_mod_folio(new_folio, NR_SHMEM, HPAGE_PMD_NR); lruvec_stat_mod_...
1651d69443c3a5fc12f1dee1229d526e7af9020a
Analyze and fix the following issue in the Linux kernel code: parisc: lba_pci: Add debug code to show IO and PA ranges
Problem Details: Add more code to debug the PAT PDC firmware. Signed-off-by: Helge Deller <deller@gmx.de>
```diff diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 3fc3765fddaa..1d29fa13650b 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -1066,6 +1066,10 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) p = (void *) &(pa_pdc_cell->mod[2+i*3]); ...
e3217ddf29cb2fe7c9c12978aac89ee1651599f1
Analyze and fix the following issue in the Linux kernel code: parisc: Fix minor printk issues in iosapic debug code
Problem Details: Signed-off-by: Helge Deller <deller@gmx.de>
```diff diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index a4011461189b..a42552608fe4 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c @@ -262,9 +262,9 @@ iosapic_load_irt(unsigned long cell_num, struct irt_entry **irt) if (is_pdc_pat()) { /* Use pat pdc routine to get int...
db7e826030dc6775b862468476c1fd08b10f0799
Analyze and fix the following issue in the Linux kernel code: parisc: Enhance debug code for PAT firmware
Problem Details: Enhance output when running PAT firmware, which is helpful when developing the QEMU emulator. The added code is behind an ifdef, so no performance overhead for normal kernels. Signed-off-by: Helge Deller <deller@gmx.de>
```diff diff --git a/arch/parisc/kernel/inventory.c b/arch/parisc/kernel/inventory.c index 7ab2f2a54400..05798355cff4 100644 --- a/arch/parisc/kernel/inventory.c +++ b/arch/parisc/kernel/inventory.c @@ -207,6 +207,19 @@ pat_query_module(ulong pcell_loc, ulong mod_index) return status; } +#ifdef DEBUG_PAT + pr_de...
5ff7842103f60b29b9907d25b371f65d5b40bbe4
Analyze and fix the following issue in the Linux kernel code: parisc: Fix module path output in qemu tables
Problem Details: Signed-off-by: Helge Deller <deller@gmx.de>
```diff diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c index ae201b95829d..7707158a7840 100644 --- a/arch/parisc/kernel/drivers.c +++ b/arch/parisc/kernel/drivers.c @@ -1040,14 +1040,14 @@ static __init int qemu_print_iodc_data(struct device *lin_dev, void *data) "mod_path_hpa_%08lx = {\n",...
ba74652c30606f22e4db44cb0164ab567486abdb
Analyze and fix the following issue in the Linux kernel code: parisc: Print hardware IDs as 4 digit hex strings
Problem Details: The hardware IDs are 32-bit unsigned integers, so print them as 4-digit hex numbers. Additionally fix some whitespace glitches. Signed-off-by: Helge Deller <deller@gmx.de>
```diff diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c index bf73562706b2..beb30c5de097 100644 --- a/arch/parisc/kernel/processor.c +++ b/arch/parisc/kernel/processor.c @@ -3,7 +3,7 @@ * Initial setup-routines for HP 9000 based hardware. * * Copyright (C) 1991, 1992, 1995 Linu...
dcf69599c47f29ce0a99117eb3f9ddcd2c4e78b6
Analyze and fix the following issue in the Linux kernel code: parisc: kernel: replace kfree() with put_device() in create_tree_node()
Problem Details: If device_register() fails, put_device() is the correct way to drop the device reference. Found by code review. Fixes: 1070c9655b90 ("[PA-RISC] Fix must_check warnings in drivers.c") Cc: stable@vger.kernel.org Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn> Signed-off-by: Helge Deller <delle...
```diff diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c index 8d23fe42b0ce..809e3c171ad5 100644 --- a/arch/parisc/kernel/drivers.c +++ b/arch/parisc/kernel/drivers.c @@ -435,7 +435,7 @@ static struct parisc_device * __init create_tree_node(char id, dev->dev.dma_mask = &dev->dma_mask; dev->d...
5907a90551e9f7968781f3a6ab8684458959beb3
Analyze and fix the following issue in the Linux kernel code: PCI: Add ACS quirk for Pericom PI7C9X2G404 switches [12d8:b404]
Problem Details: 12d8:b404 is apparently another PCI ID for Pericom PI7C9X2G404 (as identified by the chip silkscreen and lspci). It is also affected by the PI7C9X2G errata (e.g. a network card attached to it fails under load when P2P Redirect Request is enabled), so apply the same quirk to this PCI ID too. PCI bridg...
```diff diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index eff77433fbc1..9bd9048af856 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -6210,6 +6210,10 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_PERICOM, 0x2303, pci_fixup_pericom_acs_store_forward); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID...
183c291caa34cc1e721a571058a3f972c5b35122
Analyze and fix the following issue in the Linux kernel code: PCI: Use lockdep_assert_held(pci_bus_sem) to verify lock is held
Problem Details: The function comment for pci_bus_max_d3cold_delay() declares pci_bus_sem must be held while calling the function which can be automatically checked. Add lockdep_assert_held(pci_bus_sem) to confirm pci_bus_sem is held. Also mark the comment line with Context prefix. Signed-off-by: Ilpo Järvinen <ilpo....
```diff diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 57a5b205175f..edcc22dc95d3 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -13,6 +13,7 @@ #include <linux/delay.h> #include <linux/dmi.h> #include <linux/init.h> +#include <linux/lockdep.h> #include <linux/msi.h> #include <linux/of.h> #inc...
1f5e57c622b4dc9b8e7d291d560138d92cfbe5bf
Analyze and fix the following issue in the Linux kernel code: PCI: Fix pci_slot_lock () device locking
Problem Details: Like pci_bus_lock(), pci_slot_lock() needs to lock the bridge device to prevent warnings like: pcieport 0000:e2:05.0: unlocked secondary bus reset via: pciehp_reset_slot+0x55/0xa0 Take and release the lock for the bridge providing the slot for the lock/trylock and unlock routines. Signed-off-by: K...
```diff diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 59319e08fca6..57a5b205175f 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -5290,10 +5290,9 @@ unlock: /* Do any devices on or below this slot prevent a bus reset? */ static bool pci_slot_resettable(struct pci_slot *slot) { - struct pci_dev *...
9368d1ee62829b08aa31836b3ca003803caf0b72
Analyze and fix the following issue in the Linux kernel code: PCI: Fix pci_slot_trylock() error handling
Problem Details: Commit a4e772898f8b ("PCI: Add missing bridge lock to pci_bus_lock()") delegates the bridge device's pci_dev_trylock() to pci_bus_trylock() in pci_slot_trylock(), but it forgets to remove the corresponding pci_dev_unlock() when pci_bus_trylock() fails. Before a4e772898f8b, the code did: if (!pci_de...
```diff diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 13dbb405dc31..59319e08fca6 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -5346,10 +5346,8 @@ static int pci_slot_trylock(struct pci_slot *slot) if (!dev->slot || dev->slot != slot) continue; if (dev->subordinate) { - if (!pci_bus_t...
2687c848e57820651b9f69d30c4710f4219f7dbf
Analyze and fix the following issue in the Linux kernel code: x86/vmware: Fix hypercall clobbers
Problem Details: Fedora QA reported the following panic: BUG: unable to handle page fault for address: 0000000040003e54 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS edk2-20251119-3.fc43 11/19/2025 RIP: 0010:vmw...
```diff diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h index c9cf43d5ef23..4220dae14a2d 100644 --- a/arch/x86/include/asm/vmware.h +++ b/arch/x86/include/asm/vmware.h @@ -140,7 +140,7 @@ unsigned long vmware_hypercall3(unsigned long cmd, unsigned long in1, "b" (in1), "c" (cmd), ...
97b859b5ed04dbbe99be19895d8498009a19553f
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix outdated test on storage->smap
Problem Details: bpf_local_storage_free() already does not rely on local_storage->smap since switching to kmalloc_nolock(). As local_storage->smap is removed, fix the outdated test by dropping the local_storage->smap check. Keep the second map in task local storage map test to test that multiple elements can be added t...
```diff diff --git a/tools/testing/selftests/bpf/progs/local_storage.c b/tools/testing/selftests/bpf/progs/local_storage.c index 637e75df2e14..d0be77011a84 100644 --- a/tools/testing/selftests/bpf/progs/local_storage.c +++ b/tools/testing/selftests/bpf/progs/local_storage.c @@ -62,7 +62,6 @@ SEC("lsm/inode_unlink") in...
902a79b6389ff39fd736c6fd1581ded1372adbf5
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Update task_local_storage/task_storage_nodeadlock test
Problem Details: Adjust the error code we are checking against as bpf_task_storage_delete() now returns -EDEADLK or -ETIMEDOUT when deadlock happens. Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Amery Hung <ameryhung@gmail.com> Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Link: https://patch...
```diff diff --git a/tools/testing/selftests/bpf/progs/task_storage_nodeadlock.c b/tools/testing/selftests/bpf/progs/task_storage_nodeadlock.c index 986829aaf73a..6ce98fe9f387 100644 --- a/tools/testing/selftests/bpf/progs/task_storage_nodeadlock.c +++ b/tools/testing/selftests/bpf/progs/task_storage_nodeadlock.c @@ -1...
e4772031d1053e7640e3094834916ee2605f288f
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Update task_local_storage/recursion test
Problem Details: Update the expected result of the selftest as recursion of task local storage syscall and helpers have been relaxed. Now that the percpu counter is removed, task local storage helpers, bpf_task_storage_get() and bpf_task_storage_delete() can now run on the same CPU at the same time unless they cause de...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/task_local_storage.c b/tools/testing/selftests/bpf/prog_tests/task_local_storage.c index 42e822ea352f..7bee33797c71 100644 --- a/tools/testing/selftests/bpf/prog_tests/task_local_storage.c +++ b/tools/testing/selftests/bpf/prog_tests/task_local_storage.c @@ -1...
5d800f87d0a5ea1b156c47a4b9fd128479335153
Analyze and fix the following issue in the Linux kernel code: bpf: Support lockless unlink when freeing map or local storage
Problem Details: Introduce bpf_selem_unlink_nofail() to properly handle errors returned from rqspinlock in bpf_local_storage_map_free() and bpf_local_storage_destroy() where the operation must succeeds. The idea of bpf_selem_unlink_nofail() is to allow an selem to be partially linked and use atomic operation on a bit ...
```diff diff --git a/include/linux/bpf_local_storage.h b/include/linux/bpf_local_storage.h index a34ed7fa81d8..69a5d8aa765d 100644 --- a/include/linux/bpf_local_storage.h +++ b/include/linux/bpf_local_storage.h @@ -68,6 +68,11 @@ struct bpf_local_storage_data { u8 data[] __aligned(8); }; +#define SELEM_MAP_UNLINKE...
5254de7b9607dd341795cd693185f719a9e7298a
Analyze and fix the following issue in the Linux kernel code: bpf: Remove cgroup local storage percpu counter
Problem Details: The percpu counter in cgroup local storage is no longer needed as the underlying bpf_local_storage can now handle deadlock with the help of rqspinlock. Remove the percpu counter and related migrate_{disable, enable}. Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Amery Hung <ameryhung@gm...
```diff diff --git a/kernel/bpf/bpf_cgrp_storage.c b/kernel/bpf/bpf_cgrp_storage.c index 8fef24fcac68..4d84611d8222 100644 --- a/kernel/bpf/bpf_cgrp_storage.c +++ b/kernel/bpf/bpf_cgrp_storage.c @@ -11,29 +11,6 @@ DEFINE_BPF_STORAGE_CACHE(cgroup_cache); -static DEFINE_PER_CPU(int, bpf_cgrp_storage_busy); - -static...
4a98c2efa613f0b01bc3aa0acb8c3ff7ae29b6f9
Analyze and fix the following issue in the Linux kernel code: bpf: Remove task local storage percpu counter
Problem Details: The percpu counter in task local storage is no longer needed as the underlying bpf_local_storage can now handle deadlock with the help of rqspinlock. Remove the percpu counter and related migrate_{disable, enable}. Since the percpu counter is removed, merge back bpf_task_storage_get() and bpf_task_sto...
```diff diff --git a/kernel/bpf/bpf_task_storage.c b/kernel/bpf/bpf_task_storage.c index ab902364ac23..dd858226ada2 100644 --- a/kernel/bpf/bpf_task_storage.c +++ b/kernel/bpf/bpf_task_storage.c @@ -20,29 +20,6 @@ DEFINE_BPF_STORAGE_CACHE(task_cache); -static DEFINE_PER_CPU(int, bpf_task_storage_busy); - -static v...
2ecc1bf14e2fdaff78bd1b8e7ed3dba336a3fad5
Analyze and fix the following issue in the Linux kernel code: PCI: Don't claim disabled bridge windows
Problem Details: The commit 8278c6914306 ("PCI: Preserve bridge window resource type flags") changed bridge window resource behavior such that flags are no longer zero if the bridge window is not valid or is disabled (mainly to preserve the type flags for later use). If a bridge window has its limit smaller than base a...
```diff diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index e680f75a5b5e..69abb11b7e47 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -1549,6 +1549,8 @@ static void pci_claim_bridge_resources(struct pci_dev *dev) if (!r->flags || resource_assigned(r)) continue; + if (r-...
e43e2aa557040bbcc5de0eaa1c59ee3ae9e31793
Analyze and fix the following issue in the Linux kernel code: PCI: rzg3s-host: Fix device node reference leak in rzg3s_pcie_host_parse_port()
Problem Details: In rzg3s_pcie_host_parse_port(), of_get_next_child() returns a device node with an incremented reference count that must be released with of_node_put(). The current code fails to call of_node_put() which causes a reference leak. Use the __free(device_node) attribute to ensure automatic cleanup when th...
```diff diff --git a/drivers/pci/controller/pcie-rzg3s-host.c b/drivers/pci/controller/pcie-rzg3s-host.c index 5aa58638903f..2809112e6317 100644 --- a/drivers/pci/controller/pcie-rzg3s-host.c +++ b/drivers/pci/controller/pcie-rzg3s-host.c @@ -1142,7 +1142,8 @@ static int rzg3s_pcie_resets_prepare_and_get(struct rzg3s_p...
4479884d1fe4d0746a59fb86eaf925478092e7ed
Analyze and fix the following issue in the Linux kernel code: perf lock contention: fix segfault in `lock contention -b/--use-bpf`
Problem Details: When run on a kernel without BTF info, perf crashes: libbpf: kernel BTF is missing at '/sys/kernel/btf/vmlinux', was CONFIG_DEBUG_INFO_BTF enabled? libbpf: failed to find valid kernel BTF Program received signal SIGSEGV, Segmentation fault. 0x00005555556915b7 in btf.type_cnt () (g...
```diff diff --git a/tools/perf/util/bpf_lock_contention.c b/tools/perf/util/bpf_lock_contention.c index 788d30be2058..cbd7435579fe 100644 --- a/tools/perf/util/bpf_lock_contention.c +++ b/tools/perf/util/bpf_lock_contention.c @@ -117,6 +117,9 @@ static void init_numa_data(struct lock_contention *con) long last = -1;...
c73a56ed3c97ae6571c2c50e6bc8772b1cee42e0
Analyze and fix the following issue in the Linux kernel code: perf test: Fix test case Leader sampling on s390
Problem Details: The subtest 'Leader sampling' some time fails on s390. - for z/VM guest: Disable the test for z/VM guest. There is no CPU Measurement facility to run the test successfully. - for LPAR: Use correct event names. A detailed analysis follows here: Now to the debugging and investigation: 1. With command ...
```diff diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh index 0f5841c479e7..46b96d565680 100755 --- a/tools/perf/tests/shell/record.sh +++ b/tools/perf/tests/shell/record.sh @@ -260,7 +260,21 @@ test_uid() { test_leader_sampling() { echo "Basic leader sampling test" - if ! perf r...
64ea7a4620008652c7f72065ae61efbde7af3ea0
Analyze and fix the following issue in the Linux kernel code: perf annotate: Fix register usage in data type profiling
Problem Details: On data type profiling, it tried to match register name with a partial string. For example, it allowed to match with "%rbp)" or "%rdi,8)". But with recent change in the area, it doesn't match anymore and break the data type profiling. Let's pass the correct register name by removing the unwanted par...
```diff diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 880b1bd300c2..2e3522905046 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -2447,6 +2447,29 @@ int annotate_check_args(void) return 0; } +static int arch__dwarf_regnum(const struct arch *arch, const char ...
a724a8fce5e25b45b2146abea61d22d6634dde59
Analyze and fix the following issue in the Linux kernel code: perf kvm stat: Fix build error
Problem Details: Since commit ceea279f9376 ("perf kvm stat: Remove use of the arch directory"), a native build on Arm64 machine reports: util/kvm-stat-arch/kvm-stat-x86.c:7:10: fatal error: asm/svm.h: No such file or directory 7 | #include <asm/svm.h> | ^~~~~~~~~~~ compilation terminated. The b...
```diff diff --git a/tools/perf/util/kvm-stat-arch/kvm-stat-x86.c b/tools/perf/util/kvm-stat-arch/kvm-stat-x86.c index 1cf541385a4b..43275d25b6cb 100644 --- a/tools/perf/util/kvm-stat-arch/kvm-stat-x86.c +++ b/tools/perf/util/kvm-stat-arch/kvm-stat-x86.c @@ -4,9 +4,9 @@ #include "../kvm-stat.h" #include "../evsel.h" ...
0528a348b04b327a4611e29589beb4c9ae81304a
Analyze and fix the following issue in the Linux kernel code: cache: ax45mp: Fix device node reference leak in ax45mp_cache_init()
Problem Details: In ax45mp_cache_init(), of_find_matching_node() returns a device node with an incremented reference count that must be released with of_node_put(). The current code fails to call of_node_put() which causes a reference leak. Use the __free(device_node) attribute to ensure automatic cleanup when the var...
```diff diff --git a/drivers/cache/ax45mp_cache.c b/drivers/cache/ax45mp_cache.c index 1d7dd3d2c101..934c5087ec2b 100644 --- a/drivers/cache/ax45mp_cache.c +++ b/drivers/cache/ax45mp_cache.c @@ -178,11 +178,11 @@ static const struct of_device_id ax45mp_cache_ids[] = { static int __init ax45mp_cache_init(void) { - s...
3c85234b979af71cb9db5eb976ea08a468415767
Analyze and fix the following issue in the Linux kernel code: cache: starfive: fix device node leak in starlink_cache_init()
Problem Details: of_find_matching_node() returns a device_node with refcount incremented. Use __free(device_node) attribute to automatically call of_node_put() when the variable goes out of scope, preventing the refcount leak. Fixes: cabff60ca77d ("cache: Add StarFive StarLink cache management") Signed-off-by: Felix ...
```diff diff --git a/drivers/cache/starfive_starlink_cache.c b/drivers/cache/starfive_starlink_cache.c index 24c7d078ca22..3a25d2d7c70c 100644 --- a/drivers/cache/starfive_starlink_cache.c +++ b/drivers/cache/starfive_starlink_cache.c @@ -102,11 +102,11 @@ static const struct of_device_id starlink_cache_ids[] = { st...
66fb10bc5c25c83ab268be0390863dd4299d063c
Analyze and fix the following issue in the Linux kernel code: rust: dma: add missing __rust_helper annotations
Problem Details: The commit d8932355f8c5 ("rust: dma: add helpers for architectures without CONFIG_HAS_DMA") missed adding the __rust_helper annotations. Add them. Reported-by: Gary Guo <gary@garyguo.net> Closes: https://lore.kernel.org/rust-for-linux/DFW4F5OSDO7A.TBUOX6RCN8G7@garyguo.net/ Signed-off-by: Dirk Behme <d...
```diff diff --git a/rust/helpers/dma.c b/rust/helpers/dma.c index 20232ac64850..9fbeb507b08c 100644 --- a/rust/helpers/dma.c +++ b/rust/helpers/dma.c @@ -23,23 +23,23 @@ __rust_helper int rust_helper_dma_set_mask_and_coherent(struct device *dev, return dma_set_mask_and_coherent(dev, mask); } -int rust_helper_dma_...
88af9fefed412e4bea9a1a771cbe6fe347fa3507
Analyze and fix the following issue in the Linux kernel code: selftests/xsk: fix number of Tx frags in invalid packet
Problem Details: The issue occurs in TOO_MANY_FRAGS test case when xdp_zc_max_segs is set to an odd number. TOO_MANY_FRAGS test case contains an invalid packet consisting of (xdp_zc_max_segs) frags. Every frag, even the last one has XDP_PKT_CONTD flag set. This packet is expected to be dropped. After that, there is a ...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/test_xsk.c b/tools/testing/selftests/bpf/prog_tests/test_xsk.c index 69a5a9a5189b..bab4a31621c7 100644 --- a/tools/testing/selftests/bpf/prog_tests/test_xsk.c +++ b/tools/testing/selftests/bpf/prog_tests/test_xsk.c @@ -433,7 +433,7 @@ static u32 pkt_nb_frags(u...
42e41b2a0afa04ca49ee2725aadf90ccb058ed28
Analyze and fix the following issue in the Linux kernel code: selftests/xsk: properly handle batch ending in the middle of a packet
Problem Details: Referenced commit reduced the scope of the variable pkt, so now it has to be reinitialized via pkt_stream_get_next_rx_pkt(), which also increments some counters. When the packet is interrupted by the batch ending, pkt stream therefore proceeds to the next packet, while xsk ring still contains the previ...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/test_xsk.c b/tools/testing/selftests/bpf/prog_tests/test_xsk.c index 5af28f359cfd..69a5a9a5189b 100644 --- a/tools/testing/selftests/bpf/prog_tests/test_xsk.c +++ b/tools/testing/selftests/bpf/prog_tests/test_xsk.c @@ -1090,6 +1090,8 @@ static int __receive_pk...
c3bb3295637cc9bf514f690941ca9a385bf30113
Analyze and fix the following issue in the Linux kernel code: ipmi:si: Use a long timeout when the BMC is misbehaving
Problem Details: If the driver goes into HOSED state, don't reset the timeout to the short timeout in the timeout handler. Reported-by: Igor Raits <igor@gooddata.com> Closes: https://lore.kernel.org/linux-acpi/CAK8fFZ58fidGUCHi5WFX0uoTPzveUUDzT=k=AAm4yWo3bAuCFg@mail.gmail.com/ Fixes: bc3a9d217755 ("ipmi:si: Gracefully...
```diff diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index ff159b1162b9..0049e3792ba1 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -1119,7 +1119,9 @@ static void smi_timeout(struct timer_list *t) * SI_USEC_PER_JIFFY); smi_result = ...
de4b09abf088ba0a6a0bebb8b618fd29b9ce5c35
Analyze and fix the following issue in the Linux kernel code: landlock: Document audit blocker field format
Problem Details: Add comprehensive documentation for the ``blockers`` field format in AUDIT_LANDLOCK_ACCESS records, including all possible prefixes (fs., net., scope.) and their meanings. Also fix a typo and update the documentation date to reflect these changes. Signed-off-by: Samasth Norway Ananda <samasth.norway....
```diff diff --git a/Documentation/admin-guide/LSM/landlock.rst b/Documentation/admin-guide/LSM/landlock.rst index 9e61607def08..9923874e2156 100644 --- a/Documentation/admin-guide/LSM/landlock.rst +++ b/Documentation/admin-guide/LSM/landlock.rst @@ -6,7 +6,7 @@ Landlock: system-wide management =======================...
fe72ce6710cba088b67e3279de87d7341fafc357
Analyze and fix the following issue in the Linux kernel code: landlock: Add errata documentation section
Problem Details: Add errata section with code examples for querying errata and a warning that most applications should not check errata. Use kernel-doc directives to include errata descriptions from the header files instead of manual links. Also enhance existing DOC sections in security/landlock/errata/abi-*.h files w...
```diff diff --git a/Documentation/userspace-api/landlock.rst b/Documentation/userspace-api/landlock.rst index 2c1af0c930d4..13134bccdd39 100644 --- a/Documentation/userspace-api/landlock.rst +++ b/Documentation/userspace-api/landlock.rst @@ -445,9 +445,68 @@ system call: printf("Landlock supports LANDLOCK_ACC...
6100f2904e0ea1f2c832ab6e93573fae47d3b13e
Analyze and fix the following issue in the Linux kernel code: landlock: Add backwards compatibility for restrict flags
Problem Details: Add backwards compatibility handling for the restrict flags introduced in ABI version 7. This is shown as a separate code block (similar to the ruleset_attr handling in the switch statement) because restrict flags are passed to landlock_restrict_self() rather than being part of the ruleset attributes. ...
```diff diff --git a/Documentation/userspace-api/landlock.rst b/Documentation/userspace-api/landlock.rst index 90bb0778666d..2c1af0c930d4 100644 --- a/Documentation/userspace-api/landlock.rst +++ b/Documentation/userspace-api/landlock.rst @@ -8,7 +8,7 @@ Landlock: unprivileged access control ==========================...
50c058e3eafe31a5197d4cffb599f2f5f165d4eb
Analyze and fix the following issue in the Linux kernel code: selftests/landlock: Add LANDLOCK_RESTRICT_SELF_TSYNC tests
Problem Details: Exercise various scenarios where Landlock domains are enforced across all of a processes' threads. Test coverage for security/landlock is 91.6% of 2130 lines according to LLVM 21. Cc: Andrew G. Morgan <morgan@kernel.org> Cc: John Johansen <john.johansen@canonical.com> Cc: Paul Moore <paul@paul-moore....
```diff diff --git a/tools/testing/selftests/landlock/base_test.c b/tools/testing/selftests/landlock/base_test.c index fdbb672009ac..0fea236ef4bd 100644 --- a/tools/testing/selftests/landlock/base_test.c +++ b/tools/testing/selftests/landlock/base_test.c @@ -288,7 +288,7 @@ TEST(restrict_self_fd) EXPECT_EQ(EBADFD, er...
42fc7e6543f6d17d2cf9ed3e5021f103a3d11182
Analyze and fix the following issue in the Linux kernel code: landlock: Multithreading support for landlock_restrict_self()
Problem Details: Introduce the LANDLOCK_RESTRICT_SELF_TSYNC flag. With this flag, a given Landlock ruleset is applied to all threads of the calling process, instead of only the current one. Without this flag, multithreaded userspace programs currently resort to using the nptl(7)/libpsx hack for multithreaded policy e...
```diff diff --git a/include/uapi/linux/landlock.h b/include/uapi/linux/landlock.h index 75fd7f5e6cc3..d5081ab4e5ef 100644 --- a/include/uapi/linux/landlock.h +++ b/include/uapi/linux/landlock.h @@ -117,11 +117,24 @@ struct landlock_ruleset_attr { * future nested domains, not the one being created. It can also be...
52c9ee202edd21d0599ac3b5a6fe1da2a2f053e5
Analyze and fix the following issue in the Linux kernel code: ipmi:si: Handle waiting messages when BMC failure detected
Problem Details: If a BMC failure is detected, the current message is returned with an error. However, if there was a waiting message, it would not be handled. Add a check for the waiting message after handling the current message. Suggested-by: Guenter Roeck <linux@roeck-us.net> Reported-by: Rafael J. Wysocki <rafa...
```diff diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 5459ffdde8dc..ff159b1162b9 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -809,6 +809,12 @@ restart: */ return_hosed_msg(smi_info, IPMI_BUS_ERR); } + if (smi_info->waiting...
c2e28ae2946f473d6c340ebbeac0cf87be46d582
Analyze and fix the following issue in the Linux kernel code: perf regs: Fix abort for "-I" or "--user-regs" options
Problem Details: Fix an issue where the `perf` tool aborts unexpectedly when running the following command: ``` perf record -e cycles -I -- true Usage: perf record [<options>] [<command>] or: perf record [<options>] -- <command> [<options>] -I, --intr-regs[=<any register>] sample selected machine regist...
```diff diff --git a/tools/perf/util/parse-regs-options.c b/tools/perf/util/parse-regs-options.c index 8dd35f50f644..b44b47d9059f 100644 --- a/tools/perf/util/parse-regs-options.c +++ b/tools/perf/util/parse-regs-options.c @@ -66,12 +66,14 @@ __parse_regs(const struct option *opt, const char *str, int unset, bool intr)...
21bab791346e5b7902a04709231c0642ff6d69bc
Analyze and fix the following issue in the Linux kernel code: Revert "revocable: Revocable resource management"
Problem Details: This reverts commit 62eb557580eb2177cf16c3fd2b6efadff297b29a. The revocable implementation uses two separate abstractions, struct revocable_provider and struct revocable, in order to store the SRCU read lock index which must be passed unaltered to srcu_read_unlock() in the same context when a resource...
```diff diff --git a/Documentation/driver-api/driver-model/index.rst b/Documentation/driver-api/driver-model/index.rst index 8e1ee21185df..4831bdd92e5c 100644 --- a/Documentation/driver-api/driver-model/index.rst +++ b/Documentation/driver-api/driver-model/index.rst @@ -14,7 +14,6 @@ Driver Model overview platf...
cee275edcdb1acfdc8270f80e96f30750b633220
Analyze and fix the following issue in the Linux kernel code: perf metricgroup: Don't early exit if no CPUID table exists
Problem Details: The failure to find a table of metrics with a CPUID shouldn't early exit as the metric code will now also consider the default table. When searching for a metric or metric group, pmu_metrics_table__for_each_metric() considers all tables and so the caller doesn't need to switch the table to do this. F...
```diff diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c index 40a1e14de418..46bf4dfeebc8 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -1562,8 +1562,6 @@ int metricgroup__parse_groups(struct evlist *perf_evlist, { const struct pmu_metrics_table *table = ...
6c7860aa28b81b7e909b8d2072ed76fa22db6eda
Analyze and fix the following issue in the Linux kernel code: mtd: spi-nor: hisi-sfc: fix refcounting bug in hisi_spi_nor_register_all()
Problem Details: This was converted to a _scoped() loop but this of_node_put() was accidentally left behind which is a double free. Fixes: aa8cb72c2018 ("mtd: spi-nor: hisi-sfc: Simplify with scoped for each OF child loop") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Pratyush Yadav <pratyush@k...
```diff diff --git a/drivers/mtd/spi-nor/controllers/hisi-sfc.c b/drivers/mtd/spi-nor/controllers/hisi-sfc.c index 54c49a8423a2..6897ced2d57b 100644 --- a/drivers/mtd/spi-nor/controllers/hisi-sfc.c +++ b/drivers/mtd/spi-nor/controllers/hisi-sfc.c @@ -403,7 +403,6 @@ static int hisi_spi_nor_register_all(struct hifmc_hos...
9796ba918e58f170df5cff337be316a2f7cf1e58
Analyze and fix the following issue in the Linux kernel code: sparc64: fix unused variable warning
Problem Details: arch/sparc/mm/init_64.c: In function 'arch_hugetlb_valid_size': arch/sparc/mm/init_64.c:361:24: warning: variable 'hv_pgsz_idx' set but not used [-Wunused-but-set-variable] 361 | unsigned short hv_pgsz_idx; | ^~~~~~~~~~~ Reported-by: kernel test rob...
```diff diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index df9f7c444c39..ba19d23d4040 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -358,30 +358,24 @@ static void __init pud_huge_patch(void) bool __init arch_hugetlb_valid_size(unsigned long size) { unsigned int hugepage_shi...
be0bccffcde3308150d2a90e55fc10e249098909
Analyze and fix the following issue in the Linux kernel code: sparc: don't reference obsolete termio struct for TC* constants
Problem Details: Similar in nature to commit ab107276607a ("powerpc: Fix struct termio related ioctl macros"). glibc-2.42 drops the legacy termio struct, but the ioctls.h header still defines some TC* constants in terms of termio (via sizeof). Hardcode the values instead. This fixes building Python for example, which...
```diff diff --git a/arch/sparc/include/uapi/asm/ioctls.h b/arch/sparc/include/uapi/asm/ioctls.h index 7fd2f5873c9e..a8bbdf9877a4 100644 --- a/arch/sparc/include/uapi/asm/ioctls.h +++ b/arch/sparc/include/uapi/asm/ioctls.h @@ -5,10 +5,10 @@ #include <asm/ioctl.h> /* Big T */ -#define TCGETA _IOR('T', 1, struct ter...
e38eba3b77878ada327a572a41596a3b0b44e522
Analyze and fix the following issue in the Linux kernel code: sparc: Synchronize user stack on fork and clone
Problem Details: Flush all uncommitted user windows before calling the generic syscall handlers for clone, fork, and vfork. Prior to entering the arch common handlers sparc_{clone|fork|vfork}, the arch-specific syscall wrappers for these syscalls will attempt to flush all windows (including user windows). In the wind...
```diff diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c index 0442ab00518d..7d69877511fa 100644 --- a/arch/sparc/kernel/process.c +++ b/arch/sparc/kernel/process.c @@ -17,14 +17,18 @@ asmlinkage long sparc_fork(struct pt_regs *regs) { - unsigned long orig_i1 = regs->u_regs[UREG_I1]; + unsigne...
ee1afacc356c84bba4b89e0655ffdcfa84d4f714
Analyze and fix the following issue in the Linux kernel code: ALSA: oss: delete self assignment
Problem Details: No need to assign "uctl" to itself. Delete it. Fixes: 55f98ece9939 ("ALSA: oss: Relax __free() variable declarations") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/aYXvm2YoV2yRimhk@stanley.mountain Signed-off-by: Takashi Iwai <tiwai@suse.de>
```diff diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c index 69422ab2d808..8d2d46d03301 100644 --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c @@ -792,7 +792,7 @@ static int snd_mixer_oss_get_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned struct snd_ctl_elem_info *uinfo __...
003b9dae53ae795930c54945e0b0a41bbd527b44
Analyze and fix the following issue in the Linux kernel code: RISC-V: KVM: Skip IMSIC update if vCPU IMSIC state is not initialized
Problem Details: kvm_riscv_vcpu_aia_imsic_update() assumes that the vCPU IMSIC state has already been initialized and unconditionally accesses imsic->vsfile_lock. However, in fuzzed ioctl sequences, the AIA device may be initialized at the VM level while the per-vCPU IMSIC state is still NULL. This leads to invalid ac...
```diff diff --git a/arch/riscv/kvm/aia_imsic.c b/arch/riscv/kvm/aia_imsic.c index 7edfd129242f..60da5fa155a6 100644 --- a/arch/riscv/kvm/aia_imsic.c +++ b/arch/riscv/kvm/aia_imsic.c @@ -797,6 +797,10 @@ int kvm_riscv_vcpu_aia_imsic_update(struct kvm_vcpu *vcpu) if (kvm->arch.aia.mode == KVM_DEV_RISCV_AIA_MODE_EMUL) ...
aeb1d17d1af5924f7357d7204a293bd8fc06ea13
Analyze and fix the following issue in the Linux kernel code: RISC-V: KVM: Fix null pointer dereference in kvm_riscv_aia_imsic_rw_attr()
Problem Details: Add a null pointer check for imsic_state before dereferencing it in kvm_riscv_aia_imsic_rw_attr(). While the function checks that the vcpu exists, it doesn't verify that the vcpu's imsic_state has been initialized, leading to a null pointer dereference when accessed. The crash manifests as: Unable t...
```diff diff --git a/arch/riscv/kvm/aia_imsic.c b/arch/riscv/kvm/aia_imsic.c index cd070d83663a..7edfd129242f 100644 --- a/arch/riscv/kvm/aia_imsic.c +++ b/arch/riscv/kvm/aia_imsic.c @@ -952,8 +952,10 @@ int kvm_riscv_aia_imsic_rw_attr(struct kvm *kvm, unsigned long type, if (!vcpu) return -ENODEV; - isel = KVM_...
11366ead4f1412befea660777576c89a1bac0c1e
Analyze and fix the following issue in the Linux kernel code: RISC-V: KVM: Fix null pointer dereference in kvm_riscv_aia_imsic_has_attr()
Problem Details: Add a null pointer check for imsic_state before dereferencing it in kvm_riscv_aia_imsic_has_attr(). While the function checks that the vcpu exists, it doesn't verify that the vcpu's imsic_state has been initialized, leading to a null pointer dereference when accessed. This issue was discovered during ...
```diff diff --git a/arch/riscv/kvm/aia_imsic.c b/arch/riscv/kvm/aia_imsic.c index e597e86491c3..cd070d83663a 100644 --- a/arch/riscv/kvm/aia_imsic.c +++ b/arch/riscv/kvm/aia_imsic.c @@ -993,8 +993,11 @@ int kvm_riscv_aia_imsic_has_attr(struct kvm *kvm, unsigned long type) if (!vcpu) return -ENODEV; - isel = KVM...
1c0180cd42839fe7a60a61412b7c28cd43553c6b
Analyze and fix the following issue in the Linux kernel code: RISC-V: KVM: Remove unnecessary 'ret' assignment
Problem Details: If execution reaches "ret = 0" assignment in kvm_riscv_vcpu_pmu_event_info() then it means kvm_vcpu_write_guest() returned 0 hence ret is already zero and does not need to be assigned 0. Fixes: e309fd113b9f ("RISC-V: KVM: Implement get event info function") Signed-off-by: Qiang Ma <maqianga@uniontech....
```diff diff --git a/arch/riscv/kvm/vcpu_pmu.c b/arch/riscv/kvm/vcpu_pmu.c index a2fae70ee174..4d8d5e9aa53d 100644 --- a/arch/riscv/kvm/vcpu_pmu.c +++ b/arch/riscv/kvm/vcpu_pmu.c @@ -494,12 +494,9 @@ int kvm_riscv_vcpu_pmu_event_info(struct kvm_vcpu *vcpu, unsigned long saddr_low } ret = kvm_vcpu_write_guest(vcpu...
648946966a08e4cb1a71619e3d1b12bd7642de7b
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_set_rbtree: validate open interval overlap
Problem Details: Open intervals do not have an end element, in particular an open interval at the end of the set is hard to validate because of it is lacking the end element, and interval validation relies on such end element to perform the checks. This patch adds a new flag field to struct nft_set_elem, this is not a...
```diff diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index 31906f90706e..426534a711b0 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h @@ -277,6 +277,8 @@ struct nft_userdata { unsigned char data[]; }; +#define NFT_SET_ELEM_INTERNAL_LAST ...
782f2688128eca6d05a48be1c247f68d86afc168
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_set_rbtree: validate element belonging to interval
Problem Details: The existing partial overlap detection does not check if the elements belong to the interval, eg. add element inet x y { 1.1.1.1-2.2.2.2, 4.4.4.4-5.5.5.5 } add element inet x y { 1.1.1.1-5.5.5.5 } => this should fail: ENOENT Similar situation occurs with deletions: add element inet x y { 1.1.1...
```diff diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c index 14b4256bb00d..a4fb5b517d9d 100644 --- a/net/netfilter/nft_set_rbtree.c +++ b/net/netfilter/nft_set_rbtree.c @@ -33,8 +33,10 @@ struct nft_rbtree { rwlock_t lock; struct nft_array __rcu *array; struct nft_array *array_next;...
4780ec142cbb24b794129d3080eee5cac2943ffc
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_set_rbtree: check for partial overlaps in anonymous sets
Problem Details: Userspace provides an optimized representation in case intervals are adjacent, where the end element is omitted. The existing partial overlap detection logic skips anonymous set checks on start elements for this reason. However, it is possible to add intervals that overlap to this anonymous where two...
```diff diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c index 2c240b0ade87..14b4256bb00d 100644 --- a/net/netfilter/nft_set_rbtree.c +++ b/net/netfilter/nft_set_rbtree.c @@ -251,11 +251,23 @@ static bool nft_rbtree_update_first(const struct nft_set *set, return false; } +/* Only for an...
7f9203f41aae8eea74fba6a3370da41332eabcda
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_set_rbtree: fix bogus EEXIST with NLM_F_CREATE with null interval
Problem Details: Userspace adds a non-matching null element to the kernel for historical reasons. This null element is added when the set is populated with elements. Inclusion of this element is conditional, therefore, userspace needs to dump the set content to check for its presence. If the NLM_F_CREATE flag is turne...
```diff diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 58d9940a596a..d7773c9bbcff 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -7636,6 +7636,11 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set, * and an existing one. ...
1e13f27e0675552161ab1778be9a23a636dde8a7
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_counter: fix reset of counters on 32bit archs
Problem Details: nft_counter_reset() calls u64_stats_add() with a negative value to reset the counter. This will work on 64bit archs, hence the negative value added will wrap as a 64bit value which then can wrap the stat counter as well. On 32bit archs, the added negative value will wrap as a 32bit value and _not_ wra...
```diff diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h index 849ff6e159c6..f47cf4d78ad7 100644 --- a/include/linux/u64_stats_sync.h +++ b/include/linux/u64_stats_sync.h @@ -97,6 +97,11 @@ static inline void u64_stats_add(u64_stats_t *p, unsigned long val) local64_add(val, &p->v); } +s...
2f635adbe2642d398a0be3ab245accd2987be0c3
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_set_hash: fix get operation on big endian
Problem Details: tests/shell/testcases/packetpath/set_match_nomatch_hash_fast fails on big endian with: Error: Could not process rule: No such file or directory reset element ip test s { 244.147.90.126 } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Fatal: Cannot fetch element "244.147.90.126" ... because the wrong buc...
```diff diff --git a/net/netfilter/nft_set_hash.c b/net/netfilter/nft_set_hash.c index ba01ce75d6de..739b992bde59 100644 --- a/net/netfilter/nft_set_hash.c +++ b/net/netfilter/nft_set_hash.c @@ -619,15 +619,20 @@ static struct nft_elem_priv * nft_hash_get(const struct net *net, const struct nft_set *set, const ...
1d79ae50e310092182a0a8450292ee1c2f99efcf
Analyze and fix the following issue in the Linux kernel code: selftests: netfilter: add IPV6_TUNNEL to config
Problem Details: The script now requires IPV6 tunnel support, enable this. This should have caught by CI, but as the config option is missing, the tunnel interface isn't added. This results in an error cascade that ends with "route change default" failure. That in turn means the "ipv6 tunnel" test re-uses the previou...
```diff diff --git a/tools/testing/selftests/net/netfilter/config b/tools/testing/selftests/net/netfilter/config index 12ce61fa15a8..979cff56e1f5 100644 --- a/tools/testing/selftests/net/netfilter/config +++ b/tools/testing/selftests/net/netfilter/config @@ -29,6 +29,7 @@ CONFIG_IP_NF_RAW=m CONFIG_IP_SCTP=m CONFIG_IP...
207b3ebacb6113acaaec0d171d5307032c690004
Analyze and fix the following issue in the Linux kernel code: netfilter: nfnetlink_queue: do shared-unconfirmed check before segmentation
Problem Details: Ulrich reports a regression with nfqueue: If an application did not set the 'F_GSO' capability flag and a gso packet with an unconfirmed nf_conn entry is received all packets are now dropped instead of queued, because the check happens after skb_gso_segment(). In that case, we did have exclusive owne...
```diff diff --git a/include/net/netfilter/nf_queue.h b/include/net/netfilter/nf_queue.h index e6803831d6af..45eb26b2e95b 100644 --- a/include/net/netfilter/nf_queue.h +++ b/include/net/netfilter/nf_queue.h @@ -21,6 +21,7 @@ struct nf_queue_entry { struct net_device *physout; #endif struct nf_hook_state state; + b...
35f83a75529a829b0939708b003652f7b4f3df9a
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_set_rbtree: don't gc elements on insert
Problem Details: During insertion we can queue up expired elements for garbage collection. In case of later abort, the commit hook will never be called. Packet path and 'get' requests will find free'd elements in the binary search blob: nft_set_ext_key include/net/netfilter/nf_tables.h:800 [inline] nft_array_get_cm...
```diff diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c index 7598c368c4e5..0efaa8c3f31b 100644 --- a/net/netfilter/nft_set_rbtree.c +++ b/net/netfilter/nft_set_rbtree.c @@ -34,11 +34,15 @@ struct nft_rbtree { struct nft_array __rcu *array; struct nft_array *array_next; unsigned long ...
cc2f39d6ac48e6e3cb2d6240bc0d6df839dd0828
Analyze and fix the following issue in the Linux kernel code: hwrng: core - use RCU and work_struct to fix race condition
Problem Details: Currently, hwrng_fill is not cleared until the hwrng_fillfn() thread exits. Since hwrng_unregister() reads hwrng_fill outside the rng_mutex lock, a concurrent hwrng_unregister() may call kthread_stop() again on the same task. Additionally, if hwrng_unregister() is called immediately after hwrng_regist...
```diff diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 96d7fe41b373..aba92d777f72 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c @@ -20,23 +20,25 @@ #include <linux/miscdevice.h> #include <linux/module.h> #include <linux/random.h> +#include <linux/rcu...
ccb679fdae2e62ed92fd9acb25ed809c0226fcc6
Analyze and fix the following issue in the Linux kernel code: crypto: starfive - Fix memory leak in starfive_aes_aead_do_one_req()
Problem Details: The starfive_aes_aead_do_one_req() function allocates rctx->adata with kzalloc() but fails to free it if sg_copy_to_buffer() or starfive_aes_hw_init() fails, which lead to memory leaks. Since rctx->adata is unconditionally freed after the write_adata operations, ensure consistent cleanup by freeing th...
```diff diff --git a/drivers/crypto/starfive/jh7110-aes.c b/drivers/crypto/starfive/jh7110-aes.c index 426b24889af8..01195664cc7c 100644 --- a/drivers/crypto/starfive/jh7110-aes.c +++ b/drivers/crypto/starfive/jh7110-aes.c @@ -669,8 +669,10 @@ static int starfive_aes_aead_do_one_req(struct crypto_engine *engine, void *...
cd576c831e86f48f7cdc7a658d6596fe7be46ae2
Analyze and fix the following issue in the Linux kernel code: crypto: xilinx - Fix inconsistant indentation
Problem Details: Fix smatch inconsistant code warning. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202601251908.baMDVVgW-lkp@intel.com/ Signed-off-by: Harsh Jain <h.jain@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
```diff diff --git a/drivers/crypto/xilinx/zynqmp-aes-gcm.c b/drivers/crypto/xilinx/zynqmp-aes-gcm.c index 53c9cb2224bd..2421bf30556d 100644 --- a/drivers/crypto/xilinx/zynqmp-aes-gcm.c +++ b/drivers/crypto/xilinx/zynqmp-aes-gcm.c @@ -984,7 +984,7 @@ static void xilinx_aes_aead_remove(struct platform_device *pdev) fo...
f7ab71f178d56447e5efb55b65436feb68662f8f
Analyze and fix the following issue in the Linux kernel code: KVM: s390: Add explicit padding to struct kvm_s390_keyop
Problem Details: The newly added structure causes a warning about implied padding: ./usr/include/linux/kvm.h:1247:1: error: padding struct size to alignment boundary with 6 bytes [-Werror=padded] The padding can lead to leaking kernel data and ABI incompatibilies when used on x86. Neither of these is a problem in thi...
```diff diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index ab3d3d96e75f..d4250ab662fe 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -1227,6 +1227,7 @@ struct kvm_s390_keyop { __u64 guest_addr; __u8 key; __u8 operation; + __u8 pad[6]; }; /* ```
b3f9d6e491fda73c319547881b78cdd2a222b293
Analyze and fix the following issue in the Linux kernel code: usb: typec: hd3ss3220: Check if regulator needs to be switched
Problem Details: Check regulator state as peripheral and detach can disable vbus. Without this check we will try to disable the regulator twice if we disconnect host and then connect as device. Fixes: 27fbc19e52b9 ("usb: typec: hd3ss3220: Enable VBUS based on role state") Signed-off-by: Jan Remmet <j.remmet@phytec.de>...
```diff diff --git a/drivers/usb/typec/hd3ss3220.c b/drivers/usb/typec/hd3ss3220.c index a7c54aa8635f..3e39b800e6b5 100644 --- a/drivers/usb/typec/hd3ss3220.c +++ b/drivers/usb/typec/hd3ss3220.c @@ -208,6 +208,9 @@ static void hd3ss3220_regulator_control(struct hd3ss3220 *hd3ss3220, bool on) { int ret; + if (regul...
02f9d76a76adb5ea16b4e3b403496c42033f8fd1
Analyze and fix the following issue in the Linux kernel code: iommu/vt-d: Treat PAGE_SNOOP and PWSNP separately
Problem Details: The PASID_FLAG_PAGE_SNOOP and PASID_FLAG_PWSNP constants are identical. This will cause the pasid code to always set both or neither of the PGSNP and PWSNP bits in PASID table entries. However, PWSNP is a reserved bit if SMPWC is not set in the IOMMU's extended capability register, even if SC is suppor...
```diff diff --git a/drivers/iommu/intel/pasid.h b/drivers/iommu/intel/pasid.h index b4c85242dc79..3809793e0259 100644 --- a/drivers/iommu/intel/pasid.h +++ b/drivers/iommu/intel/pasid.h @@ -24,7 +24,7 @@ #define PASID_FLAG_NESTED BIT(1) #define PASID_FLAG_PAGE_SNOOP BIT(2) -#define PASID_FLAG_PWSNP BIT(2) +#def...
b07829d546c83134629591f02c5348d57cea0c1e
Analyze and fix the following issue in the Linux kernel code: vsnprintf: drop __printf() attributes on binary printing functions
Problem Details: The printf() format attributes are applied inconsistently for the binary printf helpers, which causes warnings for the bpf_trace code using them from functions that pass down format strings: kernel/trace/bpf_trace.c: In function '____bpf_trace_printk': kernel/trace/bpf_trace.c:377:9: error: fu...
```diff diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index d6ebf0596510..2fb266ea69fa 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h @@ -181,7 +181,6 @@ int seq_open_private(struct file *, const struct seq_operations *, int); int seq_release_private(struct inode *, struct file...
e82269e7cb93a2d33368418be4ee56015b4adc27
Analyze and fix the following issue in the Linux kernel code: mtd: spinand: fix NULL pointer dereference in spinand_support_vendor_ops()
Problem Details: The spinand_support_vendor_ops() helper unconditionally dereferences info->vendor_ops. For chips that do not define vendor_ops, this pointer is NULL, leading to a kernel panic during probe: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 Add a guard to return earl...
```diff diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index 514f653f27f3..29fb2ac19569 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -1435,6 +1435,8 @@ static int spinand_support_vendor_ops(struct spinand_device *spinand, { int i; + if (!info->vendor_ops) + ...
e6c53ead2d8fa73206e0a63e9cd9aea6bc929837
Analyze and fix the following issue in the Linux kernel code: mm/slab: Add alloc_tagging_slab_free_hook for memcg_alloc_abort_single
Problem Details: When CONFIG_MEM_ALLOC_PROFILING_DEBUG is enabled, the following warning may be noticed: [ 3959.023862] ------------[ cut here ]------------ [ 3959.023891] alloc_tag was not cleared (got tag for lib/xarray.c:378) [ 3959.023947] WARNING: ./include/linux/alloc_tag.h:155 at alloc_tag_add+0x128/0x178, CPU#...
```diff diff --git a/mm/slub.c b/mm/slub.c index f77b7407c51b..cdc1e652ec52 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -6689,8 +6689,12 @@ void slab_free(struct kmem_cache *s, struct slab *slab, void *object, static noinline void memcg_alloc_abort_single(struct kmem_cache *s, void *object) { + struct slab *slab = vir...
1caf50ce4af096d0280d59a31abdd85703cd995c
Analyze and fix the following issue in the Linux kernel code: erofs: fix UAF issue for file-backed mounts w/ directio option
Problem Details: [ 9.269940][ T3222] Call trace: [ 9.269948][ T3222] ext4_file_read_iter+0xac/0x108 [ 9.269979][ T3222] vfs_iocb_iter_read+0xac/0x198 [ 9.269993][ T3222] erofs_fileio_rq_submit+0x12c/0x180 [ 9.270008][ T3222] erofs_fileio_submit_bio+0x14/0x24 [ 9.270030][ T3222] z_erofs_runqueue+0...
```diff diff --git a/fs/erofs/fileio.c b/fs/erofs/fileio.c index 43998fe1cce1..4d5054dcac95 100644 --- a/fs/erofs/fileio.c +++ b/fs/erofs/fileio.c @@ -10,6 +10,7 @@ struct erofs_fileio_rq { struct bio bio; struct kiocb iocb; struct super_block *sb; + refcount_t ref; }; struct erofs_fileio { @@ -38,7 +39,8 @@ ...
2e7577cd5ddc1f86d1b6c48caf3cfa87dbb14e34
Analyze and fix the following issue in the Linux kernel code: mshv: fix SRCU protection in irqfd resampler ack handler
Problem Details: Replace hlist_for_each_entry_rcu() with hlist_for_each_entry_srcu() in mshv_irqfd_resampler_ack() to correctly handle SRCU-protected linked list traversal. The function uses SRCU (sleepable RCU) synchronization via partition->pt_irq_srcu, but was incorrectly using the RCU variant for list iteration. T...
```diff diff --git a/drivers/hv/mshv_eventfd.c b/drivers/hv/mshv_eventfd.c index 525b64a5acc2..5e0b10aeeaa2 100644 --- a/drivers/hv/mshv_eventfd.c +++ b/drivers/hv/mshv_eventfd.c @@ -87,8 +87,9 @@ static void mshv_irqfd_resampler_ack(struct mshv_irq_ack_notifier *mian) idx = srcu_read_lock(&partition->pt_irq_srcu);...
51515bfc29ed5971d4f0a98243bdc1c93fadb102
Analyze and fix the following issue in the Linux kernel code: mshv: make field names descriptive in a header struct
Problem Details: When struct fields use very common names like "pages" or "type", it makes it difficult to find uses of these fields with tools like grep, cscope, etc when the struct is in a header file included in many places. Add prefix mreg_ to some fields in struct mshv_mem_region to make it easier to find them. T...
```diff diff --git a/drivers/hv/mshv_regions.c b/drivers/hv/mshv_regions.c index adba3564d9f1..c28aac0726de 100644 --- a/drivers/hv/mshv_regions.c +++ b/drivers/hv/mshv_regions.c @@ -88,7 +88,7 @@ static long mshv_region_process_chunk(struct mshv_mem_region *region, struct page *page; int stride, ret; - page = re...
c7c30c4093cc11ff66672471f12599a555708343
Analyze and fix the following issue in the Linux kernel code: drm/i915/quirks: Fix device id for QUIRK_EDP_LIMIT_RATE_HBR2 entry
Problem Details: Update the device ID for Dell XPS 13 7390 2-in-1 in the quirk `QUIRK_EDP_LIMIT_RATE_HBR2` entry. The previous ID (0x8a12) was incorrect; the correct ID is 0x8a52. Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/5969 Fixes: 21c586d9233a ("drm/i915/dp: Add device specific quirk to limit ...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c index d2e16b79d6be..1abbdd426e58 100644 --- a/drivers/gpu/drm/i915/display/intel_quirks.c +++ b/drivers/gpu/drm/i915/display/intel_quirks.c @@ -239,7 +239,7 @@ static struct intel_quirk intel_quirks[] = { { ...
ee9241524b4682a34ed4b66d8c68c33304810b93
Analyze and fix the following issue in the Linux kernel code: amd-xgbe: do not select NET_SELFTESTS when INET is disabled
Problem Details: AMD_XGBE currently selects NET_SELFTESTS unconditionally. Since select does not honor dependencies, this can force-enable NET_SELFTESTS even when INET is disabled (e.g. INET=n randconfig builds). Fixes build issue when INET is disabled. Fixes: 862a64c83faf ("amd-xgbe: introduce support ethtool selfte...
```diff diff --git a/drivers/net/ethernet/amd/Kconfig b/drivers/net/ethernet/amd/Kconfig index d54dca3074eb..45e8d698781c 100644 --- a/drivers/net/ethernet/amd/Kconfig +++ b/drivers/net/ethernet/amd/Kconfig @@ -165,7 +165,7 @@ config AMD_XGBE select CRC32 select PHYLIB select AMD_XGBE_HAVE_ECC if X86 - select NET...