id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
4fd6053274d2981d2cd65a9370a700c9fa73384c
Analyze and fix the following issue in the Linux kernel code: drm/i915/display: Fix PHY_C20_VDR_CUSTOM_SERDES_RATE programming
Problem Details: Make sure all the DP/HDMI/HDMI-FRL flags are programmed in all the modes the PLL is configured. Atm the DP mode flag is not programmed in case the PLL is configured for HDMI mode for instance. This is incorrect after HW reset, since the DP mode flag is asserted after reset, hence would need to be clea...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c b/drivers/gpu/drm/i915/display/intel_cx0_phy.c index 9be7e155a584..6e49659d2f17 100644 --- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c +++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c @@ -2624,6 +2624,7 @@ static void intel_c20_pll_program(struct in...
225bc03d85427e7e3821d6f99f4f2d4a09350dda
Analyze and fix the following issue in the Linux kernel code: drm/xe/evict: drop bogus assert
Problem Details: This assert can trigger here with non pin_map users that select LATE_RESTORE, since the vmap is allowed to be NULL given that save/restore can now use the blitter instead. The check here doesn't seem to have much value anymore given that we no longer move pinned memory, so any existing vmap is left wel...
```diff diff --git a/drivers/gpu/drm/xe/xe_bo_evict.c b/drivers/gpu/drm/xe/xe_bo_evict.c index d5dbc51e8612..bc5b4c5fab81 100644 --- a/drivers/gpu/drm/xe/xe_bo_evict.c +++ b/drivers/gpu/drm/xe/xe_bo_evict.c @@ -182,7 +182,6 @@ int xe_bo_evict_all(struct xe_device *xe) static int xe_bo_restore_and_map_ggtt(struct xe_...
6a91af25cdbce2086d85cc4994cf791bda3a2c90
Analyze and fix the following issue in the Linux kernel code: drm/xe/migrate: don't misalign current bytes
Problem Details: If current bytes exceeds the max copy size, ensure the clamped size still accounts for the XE_CACHELINE_BYTES alignment, otherwise we trigger the assert in xe_migrate_vram with the size now being out of alignment. Fixes: 8c2d61e0e916 ("drm/xe/migrate: don't overflow max copy size") Link: https://gitla...
```diff diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c index 569869a2b339..a36ce7dce8cc 100644 --- a/drivers/gpu/drm/xe/xe_migrate.c +++ b/drivers/gpu/drm/xe/xe_migrate.c @@ -2113,7 +2113,9 @@ int xe_migrate_access_memory(struct xe_migrate *m, struct xe_bo *bo, if (current_bytes & ~PA...
6d36f65ba551d28710c3e1aaceecacf19df0cd8f
Analyze and fix the following issue in the Linux kernel code: drm/xe/kunit: Fix kerneldoc for parameterized tests
Problem Details: Kunit's generate_params() was recently updated to take an additional test context parameter. Xe's IP and platform parameter generators were updated accordingly at the same time, but the new parameter was not added to the functions' kerneldoc, resulting in the following warnings: Warning: drivers/g...
```diff diff --git a/drivers/gpu/drm/xe/tests/xe_pci.c b/drivers/gpu/drm/xe/tests/xe_pci.c index 69e2840c7ef0..663a79ec960d 100644 --- a/drivers/gpu/drm/xe/tests/xe_pci.c +++ b/drivers/gpu/drm/xe/tests/xe_pci.c @@ -66,6 +66,7 @@ KUNIT_ARRAY_PARAM(platform, cases, xe_pci_fake_data_desc); /** * xe_pci_fake_data_gen_...
7987b93e3a11a7a95ddf2b21563d3286661b999c
Analyze and fix the following issue in the Linux kernel code: drm/xe/svm: Ensure data will be migrated to system if indicated by madvise.
Problem Details: If the location madvise() is set to DRM_XE_PREFERRED_LOC_DEFAULT_SYSTEM, the drm_pagemap in the SVM gpu fault handler will be set to NULL. However there is nothing that explicitly migrates the data to system if it is already present in device memory. In that case, set the device memory owner to NULL t...
```diff diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c index b268ee0d2271..da2a412f80c0 100644 --- a/drivers/gpu/drm/xe/xe_svm.c +++ b/drivers/gpu/drm/xe/xe_svm.c @@ -1034,6 +1034,9 @@ retry: if (err) return err; + dpagemap = xe_vma_resolve_pagemap(vma, tile); + if (!dpagemap && !ctx.devm...
ae04b1bb06f8c1738d01dc2f9b9391c4480544e4
Analyze and fix the following issue in the Linux kernel code: smb: client: Use MD5 library for M-F symlink hashing
Problem Details: Convert parse_mf_symlink() and format_mf_symlink() to use the MD5 library instead of a "md5" crypto_shash. This is simpler and faster. With the library there's no need to allocate memory, no need to handle errors, and the MD5 code is accessed directly without inefficient indirect calls and other unnec...
```diff diff --git a/fs/smb/client/Kconfig b/fs/smb/client/Kconfig index f0c1ff8544f6..f5a980bdfc93 100644 --- a/fs/smb/client/Kconfig +++ b/fs/smb/client/Kconfig @@ -16,6 +16,7 @@ config CIFS select CRYPTO_ECB select CRYPTO_AES select CRYPTO_LIB_ARC4 + select CRYPTO_LIB_MD5 select CRYPTO_LIB_SHA256 select CR...
c2b77f42205ef485a647f62082c442c1cd69d3fc
Analyze and fix the following issue in the Linux kernel code: smb: client: Fix refcount leak for cifs_sb_tlink
Problem Details: Fix three refcount inconsistency issues related to `cifs_sb_tlink`. Comments for `cifs_sb_tlink` state that `cifs_put_tlink()` needs to be called after successful calls to `cifs_sb_tlink()`. Three calls fail to update refcount accordingly, leading to possible resource leaks. Fixes: 8ceb98437946 ("CIF...
```diff diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c index 239dd84a336f..098a79b7a959 100644 --- a/fs/smb/client/inode.c +++ b/fs/smb/client/inode.c @@ -2431,8 +2431,10 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry, tcon = tlink_tcon(tlink); server = tcon->ses->server; - if (!...
8d93ff40d49d70e05c82a74beae31f883fe0eaf8
Analyze and fix the following issue in the Linux kernel code: net: usb: lan78xx: fix use of improperly initialized dev->chipid in lan78xx_reset
Problem Details: dev->chipid is used in lan78xx_init_mac_address before it's initialized: lan78xx_reset() { lan78xx_init_mac_address() lan78xx_read_eeprom() lan78xx_read_raw_eeprom() <- dev->chipid is used here dev->chipid = ... <- dev->chipid is initialized correctly here } Reorder initi...
```diff diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 28195d9a8d6b..00397a807393 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -3250,10 +3250,6 @@ static int lan78xx_reset(struct lan78xx_net *dev) } } while (buf & HW_CFG_LRST_); - ret = lan78xx_init_mac_addr...
1a8fed52f7be14e45785e8e54d0d0b50fc17dbd8
Analyze and fix the following issue in the Linux kernel code: netdevsim: set the carrier when the device goes up
Problem Details: Bringing a linked netdevsim device down and then up causes communication failure because both interfaces lack carrier. Basically a ifdown/ifup on the interface make the link broken. Commit 3762ec05a9fbda ("netdevsim: add NAPI support") added supported for NAPI, calling netif_carrier_off() in nsim_stop...
```diff diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c index ebc3833e95b4..fa1d97885caa 100644 --- a/drivers/net/netdevsim/netdev.c +++ b/drivers/net/netdevsim/netdev.c @@ -545,6 +545,7 @@ static void nsim_enable_napi(struct netdevsim *ns) static int nsim_open(struct net_device *dev) { ...
7f846c65ca11e63d2409868ff039081f80e42ae4
Analyze and fix the following issue in the Linux kernel code: tls: don't rely on tx_work during send()
Problem Details: With async crypto, we rely on tx_work to actually transmit records once encryption completes. But while send() is running, both the tx_lock and socket lock are held, so tx_work_handler cannot process the queue of encrypted records, and simply reschedules itself. During a large send(), this could last a...
```diff diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index e3d852091e7a..d17135369980 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -1152,6 +1152,13 @@ alloc_encrypted: } else if (ret != -EAGAIN) goto send_end; } + + /* Transmit if any encryptions have completed */ + if (test_and_clear_...
b8a6ff84abbcbbc445463de58704686011edc8e1
Analyze and fix the following issue in the Linux kernel code: tls: wait for pending async decryptions if tls_strp_msg_hold fails
Problem Details: Async decryption calls tls_strp_msg_hold to create a clone of the input skb to hold references to the memory it uses. If we fail to allocate that clone, proceeding with async decryption can lead to various issues (UAF on the skb, writing into userspace memory after the recv() call has returned). In th...
```diff diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index 1478d515badc..e3d852091e7a 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -1641,8 +1641,10 @@ static int tls_decrypt_sg(struct sock *sk, struct iov_iter *out_iov, if (unlikely(darg->async)) { err = tls_strp_msg_hold(&ctx->strp, &ctx->async_h...
b6fe4c29bb51cf239ecf48eacf72b924565cb619
Analyze and fix the following issue in the Linux kernel code: tls: always set record_type in tls_process_cmsg
Problem Details: When userspace wants to send a non-DATA record (via the TLS_SET_RECORD_TYPE cmsg), we need to send any pending data from a previous MSG_MORE send() as a separate DATA record. If that DATA record is encrypted asynchronously, tls_handle_open_record will return -EINPROGRESS. This is currently treated as a...
```diff diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index a3ccb3135e51..39a2ab47fe72 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c @@ -255,12 +255,9 @@ int tls_process_cmsg(struct sock *sk, struct msghdr *msg, if (msg->msg_flags & MSG_MORE) return -EINVAL; - rc = tls_handle_open_record(...
b014a4e066c555185b7c367efacdc33f16695495
Analyze and fix the following issue in the Linux kernel code: tls: wait for async encrypt in case of error during latter iterations of sendmsg
Problem Details: If we hit an error during the main loop of tls_sw_sendmsg_locked (eg failed allocation), we jump to send_end and immediately return. Previous iterations may have queued async encryption requests that are still pending. We should wait for those before returning, as we could otherwise be reading from mem...
```diff diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index 36ca3011ab87..1478d515badc 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -1054,7 +1054,7 @@ static int tls_sw_sendmsg_locked(struct sock *sk, struct msghdr *msg, if (ret == -EINPROGRESS) num_async++; else if (ret != -EAGAIN) - goto...
ce5af41e3234425a40974696682163edfd21128c
Analyze and fix the following issue in the Linux kernel code: tls: trim encrypted message to match the plaintext on short splice
Problem Details: During tls_sw_sendmsg_locked, we pre-allocate the encrypted message for the size we're expecting to send during the current iteration, but we may end up sending less, for example when splicing: if we're getting the data from small fragments of memory, we may fill up all the slots in the skmsg with less...
```diff diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index daac9fd4be7e..36ca3011ab87 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -1112,8 +1112,11 @@ alloc_encrypted: goto send_end; tls_ctx->pending_open_record_frags = true; - if (sk_msg_full(msg_pl)) + if (sk_msg_full(msg_pl)) { ful...
0c3f2e62815a43628e748b1e4ad97a1c46cce703
Analyze and fix the following issue in the Linux kernel code: tg3: prevent use of uninitialized remote_adv and local_adv variables
Problem Details: Some execution paths that jump to the fiber_setup_done label could leave the remote_adv and local_adv variables uninitialized and then use it. Initialize this variables at the point of definition to avoid this. Fixes: 85730a631f0c ("tg3: Add SGMII phy support for 5719/5718 serdes") Co-developed-by: A...
```diff diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 7f00ec7fd7b9..d78cafdb2094 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -5803,7 +5803,7 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, bool force_reset) u32 curr...
9c5f229b1312a31aff762b2111f6751e4e3722fe
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: fix TX and RX MCS rate configurations in HE mode
Problem Details: Currently, the TX and RX MCS rate configurations per peer are reversed when sent to the firmware. As a result, RX MCS rates are configured for TX, and vice versa. This commit rectifies the configuration to match what the firmware expects. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SIL...
```diff diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 303707606076..d7bc19cea2a6 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -2624,9 +2624,10 @@ static void ath12k_peer_assoc_h_he(struct ath12k *ar, switch (link_s...
8c21b32c2cc82224c7fc1a9f67318f3b1199744b
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: fix VHT MCS assignment
Problem Details: While associating, firmware needs the peer's receive capability to calculate its own VHT transmit MCS. Currently, the host sends this information via mcs->rx_mcs_set field, but firmware actually reads it from mcs->tx_mcs_set field. This mismatch is incorrect. This issue has not caused failures so far ...
```diff diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 84473dbf22e1..303707606076 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -2249,7 +2249,6 @@ static void ath12k_peer_assoc_h_vht(struct ath12k *ar, struct cfg8021...
b94f523cc5a19108ff4687a4bce9e5d484f0f9c5
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: Fix NSS value update in ext_rx_stats
Problem Details: Currently, in ext_rx_stats, the NSS value is taken directly from the firmware, which results in incorrect mapping: 4x4, 3x3, 2x2, 1x1 SS are incorrectly updated as 3x3, 2x2, 1x1, 0x0 SS respectively. Fix the issue by incrementing the NSS value by 1 while updating the PPDU info to ensure accura...
```diff diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c index 009c49502148..39d1967584db 100644 --- a/drivers/net/wireless/ath/ath12k/dp_mon.c +++ b/drivers/net/wireless/ath/ath12k/dp_mon.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright...
6917e268c4338ceb5916c8695423597ed8c8b38e
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: Defer vdev bring-up until CSA finalize to avoid stale beacon
Problem Details: Mac80211 schedules CSA finalize work twice during a channel switch: first during the reserved switch phase and again during the finalize phase. The beacon content is updated only during the second schedule, which occurs after the reserved switch completes. However, the ath12k driver attempts to bring u...
```diff diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h index 48d95ea7b3db..02a32b9f3ac2 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -355,6 +355,7 @@ struct ath12k_link_vif { struct wmi_vdev_install_key_arg group_key;...
36f9edbb9d0fc36c865c74f3c1ad8e1261ad3981
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: Fix MSDU buffer types handling in RX error path
Problem Details: Currently, packets received on the REO exception ring from unassociated peers are of MSDU buffer type, while the driver expects link descriptor type packets. These packets are not parsed further due to a return check on packet type in ath12k_hal_desc_reo_parse_err(), but the associated skb is not freed...
```diff diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c index 5e5c14a70316..99d29eda26cf 100644 --- a/drivers/net/wireless/ath/ath12k/dp_rx.c +++ b/drivers/net/wireless/ath/ath12k/dp_rx.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c)...
596b911644cc19ecba0dbc9c92849fb59390e29a
Analyze and fix the following issue in the Linux kernel code: wifi: ath11k: restore register window after global reset
Problem Details: Hardware target implements an address space larger than that PCI BAR can map. In order to be able to access the whole target address space, the BAR space is split into 4 segments, of which the last 3, called windows, can be dynamically mapped to the desired area. This is achieved by updating window reg...
```diff diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c index d8655badd96d..7114eca8810d 100644 --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2019-20...
f35a07a4842a88801d9182b1a76d178bfa616978
Analyze and fix the following issue in the Linux kernel code: wifi: ath10k: move recovery check logic into a new work
Problem Details: Currently, ath10k has a recovery check logic. It will wait for the last recovery to finish by wait_for_completion_timeout(); But in SDIO scenarios, the recovery function may be invoked from interrupt context, where long blocking waits are undesirable and can lead to system instability. Additionally, ...
```diff diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 6f78f1752cd6..9ae3595fb698 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -3,7 +3,6 @@ * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c)...
4077d7fb27be990a8ddcff9b49f7e1788a960f3a
Analyze and fix the following issue in the Linux kernel code: wifi: wcn36xx: Remove unused wcn36xx_smd_update_scan_params
Problem Details: wcn36xx_smd_update_scan_params() last use was removed in 2020 by commit 5973a2947430 ("wcn36xx: Fix software-driven scan") Remove it. This leaves the wcn36xx_hal_update_scan_params_req_ex and wcn36xx_hal_update_scan_params_resp structs unused. Remove them, together with the unused wcn36xx_hal_update...
```diff diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index d3a9d00e65e1..ef9ea4ff891b 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -4484,80 +4484,6 @@ struct set_rssi_filter_resp { u32 status; }; -/* Update scan ...
5fb1d3ce3e74a4530042795e1e065422295f1371
Analyze and fix the following issue in the Linux kernel code: parisc: entry: set W bit for !compat tasks in syscall_restore_rfi()
Problem Details: When the kernel leaves to userspace via syscall_restore_rfi(), the W bit is not set in the new PSW. This doesn't cause any problems because there's no 64 bit userspace for parisc. Simple static binaries are usually loaded at addresses way below the 32 bit limit so the W bit doesn't matter. Fix this by...
```diff diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c index 9abfe65492c6..3de4b5933b10 100644 --- a/arch/parisc/kernel/asm-offsets.c +++ b/arch/parisc/kernel/asm-offsets.c @@ -258,6 +258,8 @@ int main(void) BLANK(); DEFINE(TIF_BLOCKSTEP_PA_BIT, 31-TIF_BLOCKSTEP); DEFINE(TIF_SING...
f7a33a67c50c92589b046e69b9075b7d28d31f87
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: gsp: do not unwrap() SGEntry
Problem Details: Don't use unwrap() to extract an Option<SGEntry>, instead handle the error condition gracefully. Fixes: a841614e607c ("gpu: nova-core: firmware: process and prepare the GSP firmware") Signed-off-by: Danilo Krummrich <dakr@kernel.org> Reviewed-by: John Hubbard <jhubbard@nvidia.com> Signed-off-by: Alexa...
```diff diff --git a/drivers/gpu/nova-core/firmware/gsp.rs b/drivers/gpu/nova-core/firmware/gsp.rs index ca785860e1c8..6b0761460a57 100644 --- a/drivers/gpu/nova-core/firmware/gsp.rs +++ b/drivers/gpu/nova-core/firmware/gsp.rs @@ -202,9 +202,10 @@ impl GspFirmware { let mut level0_data = kvec![0u8; GSP...
841a8bfcbad94bb1ba60f59ce34f75259074ae0d
Analyze and fix the following issue in the Linux kernel code: mm: prevent poison consumption when splitting THP
Problem Details: When performing memory error injection on a THP (Transparent Huge Page) mapped to userspace on an x86 server, the kernel panics with the following trace. The expected behavior is to terminate the affected process instead of panicking the kernel, as the x86 Machine Check code can recover from an in-use...
```diff diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 1b81680b4225..1d1b74950332 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -4109,6 +4109,9 @@ static bool thp_underused(struct folio *folio) if (khugepaged_max_ptes_none == HPAGE_PMD_NR - 1) return false; + if (folio_contain_hwpoisoned_page(f...
78a63493f8e352296dbc7cb7b3f4973105e8679e
Analyze and fix the following issue in the Linux kernel code: ocfs2: clear extent cache after moving/defragmenting extents
Problem Details: The extent map cache can become stale when extents are moved or defragmented, causing subsequent operations to see outdated extent flags. This triggers a BUG_ON in ocfs2_refcount_cal_cow_clusters(). The problem occurs when: 1. copy_file_range() creates a reflinked extent with OCFS2_EXT_REFCOUNTED 2. ...
```diff diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c index 86f2631e6360..10923bf7c8b8 100644 --- a/fs/ocfs2/move_extents.c +++ b/fs/ocfs2/move_extents.c @@ -867,6 +867,11 @@ static int __ocfs2_move_extents_range(struct buffer_head *di_bh, mlog_errno(ret); goto out; } + /* + * Invalidate ...
c83aab85e18103a6dc066b4939e2c92a02bb1b05
Analyze and fix the following issue in the Linux kernel code: mm: don't spin in add_stack_record when gfp flags don't allow
Problem Details: syzbot was able to find the following path: add_stack_record_to_list mm/page_owner.c:182 [inline] inc_stack_record_count mm/page_owner.c:214 [inline] __set_page_owner+0x2c3/0x4a0 mm/page_owner.c:333 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_allo...
```diff diff --git a/mm/page_owner.c b/mm/page_owner.c index c3ca21132c2c..589ec37c94aa 100644 --- a/mm/page_owner.c +++ b/mm/page_owner.c @@ -168,6 +168,9 @@ static void add_stack_record_to_list(struct stack_record *stack_record, unsigned long flags; struct stack *stack; + if (!gfpflags_allow_spinning(gfp_mask))...
03521c892bb8d0712c23e158ae9bdf8705897df8
Analyze and fix the following issue in the Linux kernel code: dma-debug: don't report false positives with DMA_BOUNCE_UNALIGNED_KMALLOC
Problem Details: Commit 370645f41e6e ("dma-mapping: force bouncing if the kmalloc() size is not cache-line-aligned") introduced DMA_BOUNCE_UNALIGNED_KMALLOC feature and permitted architecture specific code configure kmalloc slabs with sizes smaller than the value of dma_get_cache_alignment(). When that feature is enab...
```diff diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 1e5c64cb6a42..138ede653de4 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -23,6 +23,7 @@ #include <linux/ctype.h> #include <linux/list.h> #include <linux/slab.h> +#include <linux/swiotlb.h> #include <asm/sections.h> #include "debug.h" ...
139e7a572af0b45f558b5e502121a768dc328ba8
Analyze and fix the following issue in the Linux kernel code: mm/damon/sysfs: dealloc commit test ctx always
Problem Details: The damon_ctx for testing online DAMON parameters commit inputs is deallocated only when the test fails. This means memory is leaked for every successful online DAMON parameters commit. Fix the leak by always deallocating it. Link: https://lkml.kernel.org/r/20251003201455.41448-3-sj@kernel.org Fixes...
```diff diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index 703f55a91b3c..cd6815ecc04e 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -1476,12 +1476,11 @@ static int damon_sysfs_commit_input(void *data) if (!test_ctx) return -ENOMEM; err = damon_commit_ctx(test_ctx, param_ctx); - if (err) { - damon_...
f0c5118ebb0eb7e4fd6f0d2ace3315ca141b317f
Analyze and fix the following issue in the Linux kernel code: mm/damon/sysfs: catch commit test ctx alloc failure
Problem Details: Patch series "mm/damon/sysfs: fix commit test damon_ctx [de]allocation". DAMON sysfs interface dynamically allocates and uses a damon_ctx object for testing if given inputs for online DAMON parameters update is valid. The object is being used without an allocation failure check, and leaked when the te...
```diff diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index 2fc722f998f8..703f55a91b3c 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -1473,6 +1473,8 @@ static int damon_sysfs_commit_input(void *data) if (IS_ERR(param_ctx)) return PTR_ERR(param_ctx); test_ctx = damon_new_ctx(); + if (!test_ctx) + re...
c97513cddcfc235f2522617980838e500af21d01
Analyze and fix the following issue in the Linux kernel code: hung_task: fix warnings caused by unaligned lock pointers
Problem Details: The blocker tracking mechanism assumes that lock pointers are at least 4-byte aligned to use their lower bits for type encoding. However, as reported by Eero Tamminen, some architectures like m68k only guarantee 2-byte alignment of 32-bit values. This breaks the assumption and causes two related WARN_...
```diff diff --git a/include/linux/hung_task.h b/include/linux/hung_task.h index 34e615c76ca5..c4403eeb7144 100644 --- a/include/linux/hung_task.h +++ b/include/linux/hung_task.h @@ -20,6 +20,10 @@ * always zero. So we can use these bits to encode the specific blocking * type. * + * Note that on architectures whe...
18d6b1743eafeb3fb1e0ea5a2b7fd0a773d525a8
Analyze and fix the following issue in the Linux kernel code: io_uring/rw: check for NULL io_br_sel when putting a buffer
Problem Details: Both the read and write side use kiocb_done() to finish a request, and kiocb_done() will call io_put_kbuf() in case a provided buffer was used for the request. Provided buffers are not supported for writes, hence NULL is being passed in. This normally works fine, as io_put_kbuf() won't actually use the...
```diff diff --git a/io_uring/rw.c b/io_uring/rw.c index a0f9d2021e3f..5b2241a5813c 100644 --- a/io_uring/rw.c +++ b/io_uring/rw.c @@ -655,13 +655,17 @@ static int kiocb_done(struct io_kiocb *req, ssize_t ret, if (ret >= 0 && req->flags & REQ_F_CUR_POS) req->file->f_pos = rw->kiocb.ki_pos; if (ret >= 0 && !(req-...
e6416c2dfe23c9a6fec881fda22ebb9ae486cfc5
Analyze and fix the following issue in the Linux kernel code: x86/CPU/AMD: Prevent reset reasons from being retained across reboot
Problem Details: The S5_RESET_STATUS register is parsed on boot and printed to kmsg. However, this could sometimes be misleading and lead to users wasting a lot of time on meaningless debugging for two reasons: * Some bits are never cleared by hardware. It's the software's responsibility to clear them as per the Proce...
```diff diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 5398db4dedb4..ccaa51ce63f6 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -1355,11 +1355,23 @@ static __init int print_s5_reset_status_mmio(void) return 0; value = ioread32(addr); - iounmap(addr); /* V...
5726b68473f7153a7f6294185e5998b7e2a230a2
Analyze and fix the following issue in the Linux kernel code: ASoC: amd/sdw_utils: avoid NULL deref when devm_kasprintf() fails
Problem Details: devm_kasprintf() may return NULL on memory allocation failure, but the debug message prints cpus->dai_name before checking it. Move the dev_dbg() call after the NULL check to prevent potential NULL pointer dereference. Fixes: cb8ea62e64020 ("ASoC: amd/sdw_utils: add sof based soundwire generic machine...
```diff diff --git a/sound/soc/amd/acp/acp-sdw-sof-mach.c b/sound/soc/amd/acp/acp-sdw-sof-mach.c index 91d72d4bb9a2..d055582a3bf1 100644 --- a/sound/soc/amd/acp/acp-sdw-sof-mach.c +++ b/sound/soc/amd/acp/acp-sdw-sof-mach.c @@ -176,9 +176,9 @@ static int create_sdw_dailink(struct snd_soc_card *card, cpus->dai_name =...
fcd298fdc2a32f1d90cdf9a452c5c5fdc6e8d137
Analyze and fix the following issue in the Linux kernel code: ASoC: dt-bindings: Add compatible string fsl,imx-audio-tlv320
Problem Details: Add compatible string fsl,imx-audio-tlv320 to fix below CHECK_DTBS warning: arch/arm/boot/dts/nxp/imx/imx6dl-gw5903.dtb: /sound: failed to match any schema with compatible: ['fsl,imx-audio-tlv320'] Signed-off-by: Frank Li <Frank.Li@nxp.com> Acked-by: Rob Herring (Arm) <robh@kernel.org> Link: https:/...
```diff diff --git a/Documentation/devicetree/bindings/sound/fsl-asoc-card.yaml b/Documentation/devicetree/bindings/sound/fsl-asoc-card.yaml index 92aa47ec72c7..88eb20bb008f 100644 --- a/Documentation/devicetree/bindings/sound/fsl-asoc-card.yaml +++ b/Documentation/devicetree/bindings/sound/fsl-asoc-card.yaml @@ -79,6 ...
c53c632592a427bc01266a8ce7e2f17555a3c247
Analyze and fix the following issue in the Linux kernel code: KVM: SVM: Disallow EFER.LMSLE when not supported by hardware
Problem Details: Modern AMD CPUs do not support segment limit checks in 64-bit mode (i.e. EFER.LMSLE must be zero). Do not allow a guest to set EFER.LMSLE on a CPU that requires the bit to be zero. For backwards compatibility, allow EFER.LMSLE to be set on CPUs that support segment limit checks in 64-bit mode, even th...
```diff diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 153c12dbf3eb..dadb562bd4b9 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -5320,7 +5320,9 @@ static __init int svm_hardware_setup(void) if (nested) { pr_info("Nested Virtualization enabled\n"); - kvm_enable_efer_bits...
2aab1f993c8cb753ccb3d5b848cd758e2e87d965
Analyze and fix the following issue in the Linux kernel code: drm/gpuvm: Fix kernel-doc warning for drm_gpuvm_map_req.map
Problem Details: The kernel-doc for struct drm_gpuvm_map_req.map was added as '@op_map' instead of '@map', leading to this warning during htmldocs build: WARNING: include/drm/drm_gpuvm.h:1083 struct member 'map' not described in 'drm_gpuvm_map_req' Fixes: 000a45dce7ad ("drm/gpuvm: Pass map arguments through a struct"...
```diff diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h index 8890ded1d907..476990e761f8 100644 --- a/include/drm/drm_gpuvm.h +++ b/include/drm/drm_gpuvm.h @@ -1078,7 +1078,7 @@ struct drm_gpuva_ops { */ struct drm_gpuvm_map_req { /** - * @op_map: struct drm_gpuva_op_map + * @map: struct drm_gpuva...
d451a0e88e9fa710df33f8dd5dc7ca63e22ef211
Analyze and fix the following issue in the Linux kernel code: smb: client: let smbd_destroy() wait for SMBDIRECT_SOCKET_DISCONNECTED
Problem Details: We should wait for the rdma_cm to become SMBDIRECT_SOCKET_DISCONNECTED, it turns out that (at least running some xfstests e.g. cifs/001) often triggers the case where wait_event_interruptible() returns with -ERESTARTSYS instead of waiting for SMBDIRECT_SOCKET_DISCONNECTED to be reached. Or we are alre...
```diff diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c index 77de85d7cdc3..49e2df3ad1f0 100644 --- a/fs/smb/client/smbdirect.c +++ b/fs/smb/client/smbdirect.c @@ -1575,12 +1575,12 @@ void smbd_destroy(struct TCP_Server_Info *server) disable_work_sync(&sc->disconnect_work); log_rdma_event(INFO,...
bfdd74166a639930baaba27a8d729edaacd46907
Analyze and fix the following issue in the Linux kernel code: gve: Check valid ts bit on RX descriptor before hw timestamping
Problem Details: The device returns a valid bit in the LSB of the low timestamp byte in the completion descriptor that the driver should check before setting the SKB's hardware timestamp. If the timestamp is not valid, do not hardware timestamp the SKB. Cc: stable@vger.kernel.org Fixes: b2c7aeb49056 ("gve: Implement n...
```diff diff --git a/drivers/net/ethernet/google/gve/gve.h b/drivers/net/ethernet/google/gve/gve.h index bceaf9b05cb4..4cc6dcbfd367 100644 --- a/drivers/net/ethernet/google/gve/gve.h +++ b/drivers/net/ethernet/google/gve/gve.h @@ -100,6 +100,8 @@ */ #define GVE_DQO_QPL_ONDEMAND_ALLOC_THRESHOLD 96 +#define GVE_DQO_...
6378e25ee1ca2ed687eee78eff7bd588d52a4e14
Analyze and fix the following issue in the Linux kernel code: dt-bindings: net: dsa: nxp,sja1105: Add optional clock
Problem Details: Add optional clock for OSC_IN and fix the below CHECK_DTBS warnings: arch/arm/boot/dts/nxp/imx/imx6qp-prtwd3.dtb: switch@0 (nxp,sja1105q): Unevaluated properties are not allowed ('clocks' was unexpected) Signed-off-by: Frank Li <Frank.Li@nxp.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> R...
```diff diff --git a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml index e9dd914b0734..607b7fe8d28e 100644 --- a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml +++ b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml @@ -41,6 ...
46f781e0d151844589dc2125c8cce3300546f92a
Analyze and fix the following issue in the Linux kernel code: HID: multitouch: fix sticky fingers
Problem Details: The sticky fingers quirk (MT_QUIRK_STICKY_FINGERS) was only considering the case when slots were not released during the last report. This can be problematic if the firmware forgets to release a finger while others are still present. This was observed on the Synaptics DLL0945 touchpad found on the Del...
```diff diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 513b8673ad8d..179dc316b4b5 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -94,9 +94,8 @@ enum report_mode { TOUCHPAD_REPORT_ALL = TOUCHPAD_REPORT_BUTTONS | TOUCHPAD_REPORT_CONTACTS, }; -#define M...
aa4daea418ee4215dca5c8636090660c545cb233
Analyze and fix the following issue in the Linux kernel code: HID: multitouch: fix name of Stylus input devices
Problem Details: HID_DG_PEN devices should have a suffix of "Stylus", as pointed out by commit c0ee1d571626 ("HID: hid-input: Add suffix also for HID_DG_PEN"). However, on multitouch devices, these suffixes may be overridden. Before that commit, HID_DG_PEN devices would get the "Stylus" suffix, but after that, multitou...
```diff diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 2879e65cf303..513b8673ad8d 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -1742,6 +1742,7 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi) case HID_CP_CONSUMER_CONTRO...
0187c08058da3e7f11b356ac27e0c427d36f33f2
Analyze and fix the following issue in the Linux kernel code: HID: hid-input: only ignore 0 battery events for digitizers
Problem Details: Commit 581c4484769e ("HID: input: map digitizer battery usage") added handling of battery events for digitizers (typically for batteries presented in stylii). Digitizers typically report correct battery levels only when stylus is actively touching the surface, and in other cases they may report battery...
```diff diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 5d7532d79d21..e56e7de53279 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -635,7 +635,10 @@ static void hidinput_update_battery(struct hid_device *dev, unsigned int usage, return; } - if (value == 0 || value < dev...
b1c5efbfd92eb84d6d10cccc6b4edee491f20de1
Analyze and fix the following issue in the Linux kernel code: perf parse-events: Remove hard coded legacy hardware and cache parsing
Problem Details: Now that legacy hardware and cache events are in json, having the lexer match the specific event is no longer necessary and generic PMU parsing can take place. Because of this remove the specific term parsing, event adding, and passing of alternate_hw_config which was now always PERF_COUNT_HW_MAX. Thi...
```diff diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 5fd910bf42f5..3aec86aebdc6 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -429,110 +429,7 @@ bool parse_events__filter_pmu(const struct parse_events_state *parse_state, static int parse_event...
b7b76f607a15f16031001687e733046b5f6f5d86
Analyze and fix the following issue in the Linux kernel code: perf parse-events: Fix legacy cache events if event is duplicated in a PMU
Problem Details: The term list when adding an event to a PMU is expected to have the event name for the alias lookup. Also, set found_supported so that -EINVAL isn't returned. Fixes: 62593394f66a ("perf parse-events: Legacy cache names on all PMUs and lower priority") Tested-by: Thomas Richter <tmricht@linux.ibm.com>...
```diff diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index da73d686f6b9..90a765016f64 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -475,8 +475,10 @@ static int parse_events_add_pmu(struct parse_events_state *parse_state, int parse_events_add_cach...
20b93a0088a595bceed4a026d527cbbac4e876c5
Analyze and fix the following issue in the Linux kernel code: firmware: arm_scmi: Fix premature SCMI_XFER_FLAG_IS_RAW clearing in raw mode
Problem Details: The SCMI_XFER_FLAG_IS_RAW flag was being cleared prematurely in scmi_xfer_raw_put() before the transfer completion was properly acknowledged by the raw message handlers. Move the clearing of SCMI_XFER_FLAG_IS_RAW and SCMI_XFER_FLAG_CHAN_SET from scmi_xfer_raw_put() to __scmi_xfer_put() to ensure the f...
```diff diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index eb46694cb14b..5caa9191a8d1 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -805,6 +805,7 @@ __scmi_xfer_put(struct scmi_xfers_info *minfo, struct scmi_xfer *xfer) scmi_dec...
092b9e2ce6dd63d2f36822751a51957412706986
Analyze and fix the following issue in the Linux kernel code: firmware: arm_scmi: Skip RAW initialization on failure
Problem Details: Avoid attempting to initialize RAW mode when the debug subsystem itself has failed to initialize, since doing so is pointless and emits misleading error messages. Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Message-Id: <20251014115346.2391418-3-cristian.marussi@arm.com> Signed-off-by: S...
```diff diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 1cd15412024c..eb46694cb14b 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -3028,9 +3028,6 @@ static int scmi_debugfs_raw_mode_setup(struct scmi_info *info) u8 channels[SCMI_M...
a10b4a69c7f8f596d2c5218fbe84430734fab3b2
Analyze and fix the following issue in the Linux kernel code: drm/xe/evict: drop bogus assert
Problem Details: This assert can trigger here with non pin_map users that select LATE_RESTORE, since the vmap is allowed to be NULL given that save/restore can now use the blitter instead. The check here doesn't seem to have much value anymore given that we no longer move pinned memory, so any existing vmap is left wel...
```diff diff --git a/drivers/gpu/drm/xe/xe_bo_evict.c b/drivers/gpu/drm/xe/xe_bo_evict.c index 1a12675b2ea9..7661fca7f278 100644 --- a/drivers/gpu/drm/xe/xe_bo_evict.c +++ b/drivers/gpu/drm/xe/xe_bo_evict.c @@ -191,7 +191,6 @@ int xe_bo_evict_all(struct xe_device *xe) static int xe_bo_restore_and_map_ggtt(struct xe_...
641bcf8731d21b56760e3646a39a65f471e9efd1
Analyze and fix the following issue in the Linux kernel code: drm/xe/migrate: don't misalign current bytes
Problem Details: If current bytes exceeds the max copy size, ensure the clamped size still accounts for the XE_CACHELINE_BYTES alignment, otherwise we trigger the assert in xe_migrate_vram with the size now being out of alignment. Fixes: 8c2d61e0e916 ("drm/xe/migrate: don't overflow max copy size") Link: https://gitla...
```diff diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c index 4ca48dd1cfd8..3112c966c67d 100644 --- a/drivers/gpu/drm/xe/xe_migrate.c +++ b/drivers/gpu/drm/xe/xe_migrate.c @@ -2176,7 +2176,9 @@ int xe_migrate_access_memory(struct xe_migrate *m, struct xe_bo *bo, if (current_bytes & ~PA...
289ce7e9a5e1a52ac7e522a3e389dc16be08d7a4
Analyze and fix the following issue in the Linux kernel code: include: trace: Fix inflight count helper on failed initialization
Problem Details: Add a check to the scmi_inflight_count() helper to handle the case when the SCMI debug subsystem fails to initialize. Fixes: f8e656382b4a ("include: trace: Add tracepoint support for inflight xfer count") Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Message-Id: <20251014115346.2391418-2...
```diff diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h index 21c0b95027c6..7c35c95fddba 100644 --- a/drivers/firmware/arm_scmi/common.h +++ b/drivers/firmware/arm_scmi/common.h @@ -333,10 +333,12 @@ static inline void scmi_inc_count(struct scmi_debug_info *dbg, int stat) } } -...
2290ab43b9d8eafb8046387f10a8dfa2b030ba46
Analyze and fix the following issue in the Linux kernel code: firmware: arm_scmi: Account for failed debug initialization
Problem Details: When the SCMI debug subsystem fails to initialize, the related debug root will be missing, and the underlying descriptor will be NULL. Handle this fault condition in the SCMI debug helpers that maintain metrics counters. Fixes: 0b3d48c4726e ("firmware: arm_scmi: Track basic SCMI communication debug m...
```diff diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h index 07b9e629276d..21c0b95027c6 100644 --- a/drivers/firmware/arm_scmi/common.h +++ b/drivers/firmware/arm_scmi/common.h @@ -309,10 +309,28 @@ enum debug_counters { SCMI_DEBUG_COUNTERS_LAST }; -static inline void scmi_inc...
437c23357d897f5b5b7d297c477da44b56654d46
Analyze and fix the following issue in the Linux kernel code: io_uring: fix unexpected placement on same size resizing
Problem Details: There might be many reasons why a user is resizing a ring, e.g. moving to huge pages or for some memory compaction using IORING_SETUP_NO_MMAP. Don't bypass resizing, the user will definitely be surprised seeing 0 while the rings weren't actually moved to a new place. Signed-off-by: Pavel Begunkov <asm...
```diff diff --git a/io_uring/register.c b/io_uring/register.c index 58d43d624856..2e4717f1357c 100644 --- a/io_uring/register.c +++ b/io_uring/register.c @@ -421,13 +421,6 @@ static int io_register_resize_rings(struct io_ring_ctx *ctx, void __user *arg) if (unlikely(ret)) return ret; - /* nothing to do, but cop...
be7cab44ed099566c605a8dac686c3254db01b35
Analyze and fix the following issue in the Linux kernel code: io_uring: protect mem region deregistration
Problem Details: io_create_region_mmap_safe() protects publishing of a region against concurrent mmap calls, however we should also protect against it when removing a region. There is a gap io_register_mem_region() where it safely publishes a region, but then copy_to_user goes wrong and it unsafely frees the region. C...
```diff diff --git a/io_uring/register.c b/io_uring/register.c index 43f04c47522c..58d43d624856 100644 --- a/io_uring/register.c +++ b/io_uring/register.c @@ -613,6 +613,7 @@ static int io_register_mem_region(struct io_ring_ctx *ctx, void __user *uarg) if (ret) return ret; if (copy_to_user(rd_uptr, &rd, sizeof(r...
08823e89e3e269bf4c4a20b4c24a8119920cc7a4
Analyze and fix the following issue in the Linux kernel code: block: Remove elevator_lock usage from blkg_conf frozen operations
Problem Details: Remove the acquisition and release of q->elevator_lock in the blkg_conf_open_bdev_frozen() and blkg_conf_exit_frozen() functions. The elevator lock is no longer needed in these code paths since commit 78c271344b6f ("block: move wbt_enable_default() out of queue freezing from sched ->exit()") which intr...
```diff diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index f93de34fe87d..3cffb68ba5d8 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -812,8 +812,7 @@ int blkg_conf_open_bdev(struct blkg_conf_ctx *ctx) } /* * Similar to blkg_conf_open_bdev, but additionally freezes the queue, - * acquires q->ele...
dc96cefef0d3032c69e46a21b345c60e56b18934
Analyze and fix the following issue in the Linux kernel code: blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests()
Problem Details: Commit 7f2799c546db ("blk-mq: cleanup shared tags case in blk_mq_update_nr_requests()") moves blk_mq_tag_update_sched_shared_tags() before q->nr_requests is updated, however, it's still using the old q->nr_requests to resize tag depth. Fix this problem by passing in expected new tag depth. Fixes: 7f2...
```diff diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index d06bb137a743..e0bed16485c3 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -557,7 +557,7 @@ int blk_mq_init_sched(struct request_queue *q, struct elevator_type *e, if (blk_mq_is_shared_tags(flags)) { /* Shared tags are stored at...
85d7dda5a9f665ea579741ec873a8841f37e8943
Analyze and fix the following issue in the Linux kernel code: cpufreq/amd-pstate: Fix a regression leading to EPP 0 after hibernate
Problem Details: After resuming from S4, all CPUs except the boot CPU have the wrong EPP hint programmed. This is because when the CPUs were offlined the EPP value was reset to 0. This is a similar problem as fixed by commit ba3319e590571 ("cpufreq/amd-pstate: Fix a regression leading to EPP 0 after resume") and the ...
```diff diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 298e92d8cc03..b44f0f7a5ba1 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1614,7 +1614,11 @@ static int amd_pstate_cpu_offline(struct cpufreq_policy *policy) * min_perf value across kexec reboots....
6b6e03106163458716c47df2baa9ad08ed4ddb0e
Analyze and fix the following issue in the Linux kernel code: spi: amlogic: fix spifc build error
Problem Details: There is an error building when Compiler version: gcc (GCC) 14.3.0 Assembler version: GNU assembler (GNU Binutils) 2.44 " Error log: WARNING: modpost: missing MODULE_DESCRIPTION() in arch/arm/probes/kprobes/test-kprobes.o ERROR: modpost: "__ffsdi2" [drivers/spi/spi-amlogic-spifc-a4.ko] undefined! " ...
```diff diff --git a/drivers/spi/spi-amlogic-spifc-a4.c b/drivers/spi/spi-amlogic-spifc-a4.c index 4338d00e56a6..35a7c4965e11 100644 --- a/drivers/spi/spi-amlogic-spifc-a4.c +++ b/drivers/spi/spi-amlogic-spifc-a4.c @@ -286,7 +286,7 @@ static int aml_sfc_set_bus_width(struct aml_sfc *sfc, u8 buswidth, u32 mask) for ...
5cb5575308bce9d63178fe943bf89c520a348808
Analyze and fix the following issue in the Linux kernel code: selftests: livepatch: use canonical ftrace path
Problem Details: Since v4.1 kernel, a new interface for ftrace called "tracefs" was introduced, which is usually mounted in /sys/kernel/tracing. Therefore, tracing files can now be accessed via either the legacy path /sys/kernel/debug/tracing or the newer path /sys/kernel/tracing. Signed-off-by: Fushuai Wang <wangfush...
```diff diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh index 46991a029f7c..8ec0cb64ad94 100644 --- a/tools/testing/selftests/livepatch/functions.sh +++ b/tools/testing/selftests/livepatch/functions.sh @@ -10,7 +10,11 @@ SYSFS_KERNEL_DIR="/sys/kernel" SYSFS_...
139560e8b973402140cafeb68c656c1374bd4c20
Analyze and fix the following issue in the Linux kernel code: livepatch: Match old_sympos 0 and 1 in klp_find_func()
Problem Details: When there is only one function of the same name, old_sympos of 0 and 1 are logically identical. Match them in klp_find_func(). This is to avoid a corner case with different toolchain behavior. In this specific issue, two versions of kpatch-build were used to build livepatch for the same kernel. One ...
```diff diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 4a0fb7978d0d..7f4838473eb5 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -90,8 +90,14 @@ static struct klp_func *klp_find_func(struct klp_object *obj, struct klp_func *func; klp_for_each_func(obj, func) { + /* + ...
b0432201a11b3caaeca6c03f2b3e399275b2e489
Analyze and fix the following issue in the Linux kernel code: smb: client: let destroy_mr_list() keep smbdirect_mr_io memory if registered
Problem Details: If a smbdirect_mr_io structure if still visible to callers of smbd_register_mr() we can't free the related memory when the connection is disconnected! Otherwise smbd_deregister_mr() will crash. Now we use a mutex and refcounting in order to keep the memory around if the connection is disconnected. It...
```diff diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c index c3330e43488f..77de85d7cdc3 100644 --- a/fs/smb/client/smbdirect.c +++ b/fs/smb/client/smbdirect.c @@ -1624,19 +1624,7 @@ void smbd_destroy(struct TCP_Server_Info *server) log_rdma_event(INFO, "free receive buffers\n"); destroy_receive_...
340ccc973544a6e7e331729bc4944603085cafab
Analyze and fix the following issue in the Linux kernel code: rust: pci: Allocate and manage PCI interrupt vectors
Problem Details: Add support to PCI rust module to allocate, free and manage IRQ vectors. Integrate with devres for managing the allocated resources. Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com> [ Add links in doc-comments; add missing invariant comment; re-format multiple safety requirements as list and fi...
```diff diff --git a/rust/kernel/pci.rs b/rust/kernel/pci.rs index 7fcc5f6022c1..d91ec9f008ae 100644 --- a/rust/kernel/pci.rs +++ b/rust/kernel/pci.rs @@ -6,8 +6,9 @@ use crate::{ bindings, container_of, device, + device::Bound, device_id::{RawDeviceId, RawDeviceIdIndex}, - devres::Devres, + devre...
88f170814fea74911ceab798a43cbd7c5599bed4
Analyze and fix the following issue in the Linux kernel code: ksmbd: fix recursive locking in RPC handle list access
Problem Details: Since commit 305853cce3794 ("ksmbd: Fix race condition in RPC handle list access"), ksmbd_session_rpc_method() attempts to lock sess->rpc_lock. This causes hung connections / tasks when a client attempts to open a named pipe. Using Samba's rpcclient tool: $ rpcclient //192.168.1.254 -U user%password...
```diff diff --git a/fs/smb/server/mgmt/user_session.c b/fs/smb/server/mgmt/user_session.c index 6fa025374f2f..1c181ef99929 100644 --- a/fs/smb/server/mgmt/user_session.c +++ b/fs/smb/server/mgmt/user_session.c @@ -147,14 +147,11 @@ void ksmbd_session_rpc_close(struct ksmbd_session *sess, int id) int ksmbd_session_rpc...
379510a815cb2e64eb0a379cb62295d6ade65df0
Analyze and fix the following issue in the Linux kernel code: smb/server: fix possible refcount leak in smb2_sess_setup()
Problem Details: Reference count of ksmbd_session will leak when session need reconnect. Fix this by adding the missing ksmbd_user_session_put(). Co-developed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn> Acked-by:...
```diff diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index e81e615f322a..b731d9b09408 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -1806,6 +1806,7 @@ int smb2_sess_setup(struct ksmbd_work *work) if (ksmbd_conn_need_reconnect(conn)) { rc = -EFAULT; + ksmbd_user_sessi...
6fced056d2cc8d01b326e6fcfabaacb9850b71a4
Analyze and fix the following issue in the Linux kernel code: smb/server: fix possible memory leak in smb2_read()
Problem Details: Memory leak occurs when ksmbd_vfs_read() fails. Fix this by adding the missing kvfree(). Co-developed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Sig...
```diff diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index ab1d45fcebde..e81e615f322a 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -6824,6 +6824,7 @@ int smb2_read(struct ksmbd_work *work) nbytes = ksmbd_vfs_read(work, fp, length, &offset, aux_payload_buf); if (nbytes < ...
5fb750e8a9ae123b2034771b864b8a21dbef65cd
Analyze and fix the following issue in the Linux kernel code: bpf: Replace bpf_map_kmalloc_node() with kmalloc_nolock() to allocate bpf_async_cb structures.
Problem Details: The following kmemleak splat: [ 8.105530] kmemleak: Trying to color unknown object at 0xff11000100e918c0 as Black [ 8.106521] Call Trace: [ 8.106521] <TASK> [ 8.106521] dump_stack_lvl+0x4b/0x70 [ 8.106521] kvfree_call_rcu+0xcb/0x3b0 [ 8.106521] ? hrtimer_cancel+0x21/0x40 [ 8.1...
```diff diff --git a/include/linux/bpf.h b/include/linux/bpf.h index a98c83346134..d808253f2e94 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -2499,6 +2499,8 @@ int bpf_map_alloc_pages(const struct bpf_map *map, int nid, #ifdef CONFIG_MEMCG void *bpf_map_kmalloc_node(const struct bpf_map *map, size_t ...
d5cda96d0130effd4255f7c5e720a58760a032a4
Analyze and fix the following issue in the Linux kernel code: ASoC: codecs: wcd938x-sdw: remove redundant runtime pm calls
Problem Details: Component bind callbacks already does runtime pm calls, soundwire codec also tries to do the exactly same thing resulting in Unbalanced pm_runtime_enable and disable calls. Remove the redundant calls from wcd938x-sdw driver. Reported-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Fixes: ebaf88c05...
```diff diff --git a/sound/soc/codecs/wcd938x-sdw.c b/sound/soc/codecs/wcd938x-sdw.c index add907cb2706..8c8f39d04972 100644 --- a/sound/soc/codecs/wcd938x-sdw.c +++ b/sound/soc/codecs/wcd938x-sdw.c @@ -1207,24 +1207,14 @@ static int wcd9380_probe(struct sdw_slave *pdev, regcache_cache_only(wcd->regmap, true); } ...
644ab3bc98ee386f178d5209ae8170b3fac591aa
Analyze and fix the following issue in the Linux kernel code: platform/x86:intel/pmc: Update Arrow Lake telemetry GUID
Problem Details: Update ARL_PMT_DMU_GUID value. Arrow Lake PMT DMU GUID has been updated after it was add to the driver. This updates ensures that the die C6 value is available in the debug filesystem. Bugzilla Link: https://bugzilla.kernel.org/show_bug.cgi?id=220421 Fixes: 83f168a1a437 ("platform/x86/intel/pmc: Add A...
```diff diff --git a/drivers/platform/x86/intel/pmc/core.h b/drivers/platform/x86/intel/pmc/core.h index f4dadb696a31..d6818bd34768 100644 --- a/drivers/platform/x86/intel/pmc/core.h +++ b/drivers/platform/x86/intel/pmc/core.h @@ -282,7 +282,7 @@ enum ppfear_regs { /* Die C6 from PUNIT telemetry */ #define MTL_PMT_DM...
2d8636119b92970ba135c3c4da87d24dbfdeb8ca
Analyze and fix the following issue in the Linux kernel code: exfat: fix out-of-bounds in exfat_nls_to_ucs2()
Problem Details: Since the len argument value passed to exfat_ioctl_set_volume_label() from exfat_nls_to_utf16() is passed 1 too large, an out-of-bounds read occurs when dereferencing p_cstring in exfat_nls_to_ucs2() later. And because of the NLS_NAME_OVERLEN macro, another error occurs when creating a file with a per...
```diff diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h index 329697c89d09..38210fb6901c 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -29,7 +29,6 @@ enum exfat_error_mode { enum { NLS_NAME_NO_LOSSY = 0, /* no lossy */ NLS_NAME_LOSSY = 1 << 0, /* just detected incorrect filename(s) */ - NLS_...
28412b489b088fb88dff488305fd4e56bd47f6e4
Analyze and fix the following issue in the Linux kernel code: ALSA: usb-audio: Fix NULL pointer deference in try_to_register_card
Problem Details: In try_to_register_card(), the return value of usb_ifnum_to_if() is passed directly to usb_interface_claimed() without a NULL check, which will lead to a NULL pointer dereference when creating an invalid USB audio device. Fix this by adding a check to ensure the interface pointer is valid before passin...
```diff diff --git a/sound/usb/card.c b/sound/usb/card.c index 1d5a65eac933..270dad84d825 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -891,10 +891,16 @@ get_alias_quirk(struct usb_device *dev, unsigned int id) */ static int try_to_register_card(struct snd_usb_audio *chip, int ifnum) { + struct usb_inter...
a7b4747d8e0e7871c3d4971cded1dcc9af6af9e9
Analyze and fix the following issue in the Linux kernel code: platform/mellanox: mlxbf-pmc: add sysfs_attr_init() to count_clock init
Problem Details: The lock-related debug logic (CONFIG_LOCK_STAT) in the kernel is noting the following warning when the BlueField-3 SOC is booted: BUG: key ffff00008a3402a8 has not been registered! ------------[ cut here ]------------ DEBUG_LOCKS_WARN_ON(1) WARNING: CPU: 4 PID: 592 at kernel/locking/lockdep.c:...
```diff diff --git a/drivers/platform/mellanox/mlxbf-pmc.c b/drivers/platform/mellanox/mlxbf-pmc.c index 4776013e0764..16a2fd9fdd9b 100644 --- a/drivers/platform/mellanox/mlxbf-pmc.c +++ b/drivers/platform/mellanox/mlxbf-pmc.c @@ -2015,6 +2015,7 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, unsigned...
a49c4d48c3b60926e6a8cec217bf95aa65388ecc
Analyze and fix the following issue in the Linux kernel code: platform/x86: alienware-wmi-wmax: Fix NULL pointer dereference in sleep handlers
Problem Details: Devices without the AWCC interface don't initialize `awcc`. Add a check before dereferencing it in sleep handlers. Cc: stable@vger.kernel.org Reported-by: Gal Hammer <galhammer@gmail.com> Tested-by: Gal Hammer <galhammer@gmail.com> Fixes: 07ac275981b1 ("platform/x86: alienware-wmi-wmax: Add support fo...
```diff diff --git a/drivers/platform/x86/dell/alienware-wmi-wmax.c b/drivers/platform/x86/dell/alienware-wmi-wmax.c index 31f9643a6a3b..b106e8e407b3 100644 --- a/drivers/platform/x86/dell/alienware-wmi-wmax.c +++ b/drivers/platform/x86/dell/alienware-wmi-wmax.c @@ -1639,7 +1639,7 @@ static int wmax_wmi_probe(struct wm...
d251db1f31be975b4d37ed71cbfe23d6560a5134
Analyze and fix the following issue in the Linux kernel code: drm/ast: Store precatch settings in struct ast_device_quirks
Problem Details: Add a precatch flag in struct ast_device_info and set it on AST2500 and AST2600. Remove calls to IS_AST_GENn() from ast_set_crtc_reg(). Also fix the coding style in several places. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://...
```diff diff --git a/drivers/gpu/drm/ast/ast_2500.c b/drivers/gpu/drm/ast/ast_2500.c index 416bce9ea757..2a52af0ded56 100644 --- a/drivers/gpu/drm/ast/ast_2500.c +++ b/drivers/gpu/drm/ast/ast_2500.c @@ -621,6 +621,7 @@ static void ast_2500_detect_widescreen(struct ast_device *ast) static const struct ast_device_quirks...
6f719373b943a955fee6fc2012aed207b65e2854
Analyze and fix the following issue in the Linux kernel code: drm/ast: Blank with VGACR17 sync enable, always clear VGACRB6 sync off
Problem Details: Blank the display by disabling sync pulses with VGACR17<7>. Unblank by reenabling them. This VGA setting should be supported by all Aspeed hardware. Ast currently blanks via sync-off bits in VGACRB6. Not all BMCs handle VGACRB6 correctly. After disabling sync during a reboot, some BMCs do not reenable...
```diff diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index b4e8edc7c767..30b011ed0a05 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -836,22 +836,24 @@ ast_crtc_helper_atomic_flush(struct drm_crtc *crtc, static void ast_crtc_helper_atomic_enable(stru...
63c7870fab67b2ab2bfe75e8b46f3c37b88c47a8
Analyze and fix the following issue in the Linux kernel code: accel/ivpu: Fix race condition when mapping dmabuf
Problem Details: Fix a race that can occur when multiple jobs submit the same dmabuf. This could cause the sg_table to be mapped twice, leading to undefined behavior. Fixes: e0c0891cd63b ("accel/ivpu: Rework bind/unbind of imported buffers") Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com> Reviewed-by: Jeff Hug...
```diff diff --git a/drivers/accel/ivpu/ivpu_gem.c b/drivers/accel/ivpu/ivpu_gem.c index e9830ad48d4b..e7277e02840a 100644 --- a/drivers/accel/ivpu/ivpu_gem.c +++ b/drivers/accel/ivpu/ivpu_gem.c @@ -46,12 +46,13 @@ static inline void ivpu_bo_unlock(struct ivpu_bo *bo) static struct sg_table *ivpu_bo_map_attachment(s...
82ebecdc74ff555daf70b811d854b1f32a296bea
Analyze and fix the following issue in the Linux kernel code: exfat: fix improper check of dentry.stream.valid_size
Problem Details: We found an infinite loop bug in the exFAT file system that can lead to a Denial-of-Service (DoS) condition. When a dentry in an exFAT filesystem is malformed, the following system calls — SYS_openat, SYS_ftruncate, and SYS_pwrite64 — can cause the kernel to hang. Root cause analysis shows that the si...
```diff diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index 7eb9c67fd35f..2364b49f050a 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -642,10 +642,14 @@ static int exfat_find(struct inode *dir, const struct qstr *qname, info->type = exfat_get_entry_type(ep); info->attr = le16_to_cpu(ep->dentry.file.at...
7f0fddd817ba6daebea1445ae9fab4b6d2294fa8
Analyze and fix the following issue in the Linux kernel code: net: core: fix lockdep splat on device unregister
Problem Details: Since blamed commit, unregister_netdevice_many_notify() takes the netdev mutex if the device needs it. If the device list is too long, this will lock more device mutexes than lockdep can handle: unshare -n \ bash -c 'for i in $(seq 1 100);do ip link add foo$i type dummy;done' BUG: MAX_LOCK_DEPTH to...
```diff diff --git a/net/core/dev.c b/net/core/dev.c index a64cef2c537e..2acfa44927da 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -12176,6 +12176,35 @@ static void dev_memory_provider_uninstall(struct net_device *dev) } } +/* devices must be UP and netdev_lock()'d */ +static void netif_close_many_and_unloc...
c3527eeb65cfe6fb93f9e06bc0429616a3a23592
Analyze and fix the following issue in the Linux kernel code: eth: fealnx: fix typo in comments
Problem Details: There are a few typos in comments: - replace "avilable" with "available" - replace "mutlicast" with "multicast" Signed-off-by: Denis Benato <benato.denis96@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251013183632.1226627-1-benato.denis96@gmail.com Signed-...
```diff diff --git a/drivers/net/ethernet/fealnx.c b/drivers/net/ethernet/fealnx.c index 6ac8547ef9b8..3c9961806f75 100644 --- a/drivers/net/ethernet/fealnx.c +++ b/drivers/net/ethernet/fealnx.c @@ -196,7 +196,7 @@ enum intr_status_bits { ERI = 0x00000080, /* receive early int */ CNTOVF = 0x00000040, /* counter ove...
e603a342cf7ecd64ef8f36207dfe1caacb9e2583
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: make arg_parsing.c more robust to crashes
Problem Details: We started getting a crash in BPF CI, which seems to originate from test_parse_test_list_file() test and is happening at this line: ASSERT_OK(strcmp("test_with_spaces", set.tests[0].name), "test 0 name"); One way we can crash there is if set.cnt zero, which is checked for with ASSERT_EQ() above, bu...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/arg_parsing.c b/tools/testing/selftests/bpf/prog_tests/arg_parsing.c index bb143de68875..fbf0d9c2f58b 100644 --- a/tools/testing/selftests/bpf/prog_tests/arg_parsing.c +++ b/tools/testing/selftests/bpf/prog_tests/arg_parsing.c @@ -146,9 +146,12 @@ static void ...
04fd067b770d19fee39759d994c4bfa2fb332d9f
Analyze and fix the following issue in the Linux kernel code: KVM: Fix VM exit code for full dirty ring in API documentation
Problem Details: While reading the documentation, I saw a exit code I could not grep for, to figure out it has a slightly different name. Fix that name in documentation so it points to the right exit code. Signed-off-by: Leonardo Bras <leo.bras@arm.com> Link: https://lore.kernel.org/r/20251014152802.13563-1-leo.bras@...
```diff diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index 6ae24c5ca559..3382adefc772 100644 --- a/Documentation/virt/kvm/api.rst +++ b/Documentation/virt/kvm/api.rst @@ -8510,7 +8510,7 @@ Therefore, the ioctl must be called *before* reading the content of the dirty pages. The dirty ...
78be9facfb5e711e5284ef1856401ea909eceeb2
Analyze and fix the following issue in the Linux kernel code: livepatch/klp-build: Add --show-first-changed option to show function divergence
Problem Details: Add a --show-first-changed option to identify where changed functions begin to diverge: - Parse 'objtool klp diff' output to find changed functions. - Run objtool again on each object with --debug-checksum=<funcs>. - Diff the per-instruction checksum debug output to locate the first differ...
```diff diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build index 28ee259ce5f6..881e052e7fae 100755 --- a/scripts/livepatch/klp-build +++ b/scripts/livepatch/klp-build @@ -20,7 +20,7 @@ set -o nounset # This helps keep execution in pipes so pipefail+errexit can catch errors. shopt -s lastpipe -un...
2c2f0b8626917c48e4b12827d296a3c654612b90
Analyze and fix the following issue in the Linux kernel code: livepatch/klp-build: Add --debug option to show cloning decisions
Problem Details: Add a --debug option which gets passed to "objtool klp diff" to enable debug output related to cloning decisions. Acked-by: Petr Mladek <pmladek@suse.com> Tested-by: Joe Lawrence <joe.lawrence@redhat.com> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
```diff diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build index 01ed0b66bfaf..28ee259ce5f6 100755 --- a/scripts/livepatch/klp-build +++ b/scripts/livepatch/klp-build @@ -20,7 +20,7 @@ set -o nounset # This helps keep execution in pipes so pipefail+errexit can catch errors. shopt -s lastpipe -un...
abaf1f42ddd070662fb419aed29c985ea209bd88
Analyze and fix the following issue in the Linux kernel code: livepatch/klp-build: Introduce fix-patch-lines script to avoid __LINE__ diff noise
Problem Details: The __LINE__ macro creates challenges for binary diffing. When a .patch file adds or removes lines, it shifts the line numbers for all code below it. This can cause the code generation of functions using __LINE__ to change due to the line number constant being embedded in a MOV instruction, despite t...
```diff diff --git a/MAINTAINERS b/MAINTAINERS index 755e2528f839..fc573e9a523c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14443,6 +14443,7 @@ F: include/linux/livepatch*.h F: kernel/livepatch/ F: kernel/module/livepatch.c F: samples/livepatch/ +F: scripts/livepatch/ F: tools/testing/selftests/livepatch/ LLC...
164c9201e1dad8d5c0c38f583dba81e4b6da9cc7
Analyze and fix the following issue in the Linux kernel code: objtool: Add base objtool support for livepatch modules
Problem Details: In preparation for klp-build, enable "classic" objtool to work on livepatch modules: - Avoid duplicate symbol/section warnings for prefix symbols and the .static_call_sites and __mcount_loc sections which may have already been extracted by klp diff. - Add __klp_funcs to the IBT function p...
```diff diff --git a/tools/objtool/check.c b/tools/objtool/check.c index b2659fbf7bc9..d071fbf73e4c 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -3,6 +3,7 @@ * Copyright (C) 2015-2017 Josh Poimboeuf <jpoimboe@redhat.com> */ +#define _GNU_SOURCE /* memmem() */ #include <string.h> #include <s...
2058f6d1660edc4a9bda9bee627792b352121b10
Analyze and fix the following issue in the Linux kernel code: objtool: Refactor prefix symbol creation code
Problem Details: The prefix symbol creation code currently ignores all errors, presumably because some functions don't have the leading NOPs. Shuffle the code around a bit, improve the error handling and document why some errors are ignored. Acked-by: Petr Mladek <pmladek@suse.com> Tested-by: Joe Lawrence <joe.lawren...
```diff diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 8d17d930d0c8..b2659fbf7bc9 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -15,6 +15,7 @@ #include <objtool/special.h> #include <objtool/warn.h> #include <objtool/checksum.h> +#include <objtool/util.h> #include <linux/objto...
7c2575a6406fb85946b05d8dcc856686d3156354
Analyze and fix the following issue in the Linux kernel code: objtool/klp: Add --debug option to show cloning decisions
Problem Details: Add a --debug option to klp diff which prints cloning decisions and an indented dependency tree for all cloned symbols and relocations. This helps visualize which symbols and relocations were included and why. Acked-by: Petr Mladek <pmladek@suse.com> Tested-by: Joe Lawrence <joe.lawrence@redhat.com> ...
```diff diff --git a/tools/objtool/include/objtool/warn.h b/tools/objtool/include/objtool/warn.h index 29173a1368d7..e88322d97573 100644 --- a/tools/objtool/include/objtool/warn.h +++ b/tools/objtool/include/objtool/warn.h @@ -102,6 +102,10 @@ static inline char *offstr(struct section *sec, unsigned long offset) #defi...
a3493b33384a01a1f0e38b420d1a4766aec903a6
Analyze and fix the following issue in the Linux kernel code: objtool/klp: Add --debug-checksum=<funcs> to show per-instruction checksums
Problem Details: Add a --debug-checksum=<funcs> option to the check subcommand to print the calculated checksum of each instruction in the given functions. This is useful for determining where two versions of a function begin to diverge. Acked-by: Petr Mladek <pmladek@suse.com> Tested-by: Joe Lawrence <joe.lawrence@r...
```diff diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index 14daa1357c8b..7b6fd60b022b 100644 --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -94,6 +94,7 @@ static const struct option check_options[] = { OPT_GROUP("Options:"), OPT_BOOLEAN(0, "backtrace", &op...
a4bbb493a3247ef32f6191fd8b2a0657139f8e08
Analyze and fix the following issue in the Linux kernel code: cxl/trace: Subtract to find an hpa_alias0 in cxl_poison events
Problem Details: Traces of cxl_poison events include an hpa_alias0 field if the poison address is in a region configured with an ELC, Extended Linear Cache. Since the ELC always comes first in the region, the calculation needs to subtract the ELC size from the calculated HPA address. Fixes: 8c520c5f1e76 ("cxl: Add ex...
```diff diff --git a/drivers/cxl/core/trace.h b/drivers/cxl/core/trace.h index a53ec4798b12..a972e4ef1936 100644 --- a/drivers/cxl/core/trace.h +++ b/drivers/cxl/core/trace.h @@ -1068,7 +1068,7 @@ TRACE_EVENT(cxl_poison, __entry->hpa = cxl_dpa_to_hpa(cxlr, cxlmd, __entry->dpa); if (__entry->hpa != ...
a1526bcfcb6cb7cb601b9ff8e24d08881ef9afb8
Analyze and fix the following issue in the Linux kernel code: objtool: Mark prefix functions
Problem Details: In preparation for the objtool klp diff subcommand, introduce a flag to identify __pfx_*() and __cfi_*() functions in advance so they don't need to be manually identified every time a check is needed. Acked-by: Petr Mladek <pmladek@suse.com> Tested-by: Joe Lawrence <joe.lawrence@redhat.com> Signed-off...
```diff diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 86f6e4da536c..46b425fade4f 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -3568,10 +3568,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, if (func && insn_func(insn) && func != insn_func(insn)...
c9e9b85d41f9079d6a10faabf70a0b18d5c0f177
Analyze and fix the following issue in the Linux kernel code: objtool: Fix weak symbol hole detection for .cold functions
Problem Details: When ignore_unreachable_insn() looks for weak function holes which jump to their .cold functions, it assumes the parent function comes before the corresponding .cold function in the symbol table. That's not necessarily the case with -ffunction-sections. Mark all the holes beforehand (including .cold ...
```diff diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 1d28ff73ebc9..86f6e4da536c 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2507,6 +2507,44 @@ static void mark_rodata(struct objtool_file *file) file->rodata = found; } +static void mark_holes(struct objtool_file *file) +{ ...
4cdee7888f42f5573b380ddfa9da43208e759bdc
Analyze and fix the following issue in the Linux kernel code: objtool: Fix "unexpected end of section" warning for alternatives
Problem Details: Due to the short circuiting logic in next_insn_to_validate(), control flow may silently transition from .altinstr_replacement to .text without a corresponding nested call to validate_branch(). As a result the validate_branch() 'sec' variable doesn't get reinitialized, which can trigger a confusing "un...
```diff diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 65eb90034d3e..c2e46f901a53 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -3512,15 +3512,12 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, { struct alternative *alt; struct instruction *next_i...
68245893cf447cca478e6bd71c02741656053ef4
Analyze and fix the following issue in the Linux kernel code: objtool: Fix __pa_symbol() relocation handling
Problem Details: __pa_symbol() generates a relocation which refers to a physical address. Convert it to back its virtual form before calculating the addend. Acked-by: Petr Mladek <pmladek@suse.com> Tested-by: Joe Lawrence <joe.lawrence@redhat.com> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
```diff diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c index 6742002a01f5..b10200cc50c9 100644 --- a/tools/objtool/arch/x86/decode.c +++ b/tools/objtool/arch/x86/decode.c @@ -68,6 +68,17 @@ bool arch_callee_saved_reg(unsigned char reg) } } +/* Undo the effects of __pa_symbol() if ne...
41d24d78589705f85cbe90e5a8c1b55ea05557a2
Analyze and fix the following issue in the Linux kernel code: objtool: Fix x86 addend calculation
Problem Details: On x86, arch_dest_reloc_offset() hardcodes the addend adjustment to four, but the actual adjustment depends on the relocation type. Fix that. Acked-by: Petr Mladek <pmladek@suse.com> Tested-by: Joe Lawrence <joe.lawrence@redhat.com> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
```diff diff --git a/tools/objtool/arch/loongarch/decode.c b/tools/objtool/arch/loongarch/decode.c index 2e555c4060c5..77942b927a7a 100644 --- a/tools/objtool/arch/loongarch/decode.c +++ b/tools/objtool/arch/loongarch/decode.c @@ -17,9 +17,9 @@ unsigned long arch_jump_destination(struct instruction *insn) return insn...
72567c630d32bc31f671977f78228c80937ed80e
Analyze and fix the following issue in the Linux kernel code: objtool: Fix weak symbol detection
Problem Details: find_symbol_hole_containing() fails to find a symbol hole (aka stripped weak symbol) if its section has no symbols before the hole. This breaks weak symbol detection if -ffunction-sections is enabled. Fix that by allowing the interval tree to contain section symbols, which are always at offset zero f...
```diff diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index c024937eb12a..d7fb3d0b05cf 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -109,7 +109,7 @@ struct symbol_hole { }; /* - * Find !section symbol where @offset is after it. + * Find the last symbol before @offset. */ static int symb...
c2a3e7af31107a2e1dff92b0601d525466dc21b7
Analyze and fix the following issue in the Linux kernel code: objtool: Fix interval tree insertion for zero-length symbols
Problem Details: Zero-length symbols get inserted in the wrong spot. Fix that. Acked-by: Petr Mladek <pmladek@suse.com> Tested-by: Joe Lawrence <joe.lawrence@redhat.com> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
```diff diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index a8a78b55d3ec..c024937eb12a 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -92,7 +92,7 @@ static inline unsigned long __sym_start(struct symbol *s) static inline unsigned long __sym_last(struct symbol *s) { - return s->offset + s->le...
81cf39be3559f3cebef6ad7b0893c06bf5a5847e
Analyze and fix the following issue in the Linux kernel code: objtool: Add empty symbols to the symbol tree again
Problem Details: The following commit 5da6aea375cd ("objtool: Fix find_{symbol,func}_containing()") fixed the issue where overlapping symbols weren't getting sorted properly in the symbol tree. Therefore the workaround to skip adding empty symbols from the following commit a2e38dffcd93 ("objtool: Don't add empt...
```diff diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index 19e249f4783c..a8a78b55d3ec 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -96,7 +96,8 @@ static inline unsigned long __sym_last(struct symbol *s) } INTERVAL_TREE_DEFINE(struct symbol, node, unsigned long, __subtree_last, - __s...
9ebb662fab38a5942100e597b48de5ec9d5e714d
Analyze and fix the following issue in the Linux kernel code: objtool: Fix broken error handling in read_symbols()
Problem Details: The free(sym) call in the read_symbols() error path is fundamentally broken: 'sym' doesn't point to any allocated block. If triggered, things would go from bad to worse. Remove the free() and simplify the error paths. Freeing memory isn't necessary here anyway, these are fatal errors which lead to a...
```diff diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index 1c1bb2cb960d..b009d9feed76 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -492,14 +492,14 @@ static int read_symbols(struct elf *elf) if (!gelf_getsymshndx(symtab->data, shndx_data, i, &sym->sym, &shndx)) { ERROR_ELF("...
b37491d72b43c3a322d396c2d8e951a10be70c17
Analyze and fix the following issue in the Linux kernel code: interval_tree: Fix ITSTATIC usage for *_subtree_search()
Problem Details: For consistency with the other function templates, change _subtree_search_*() to use the user-supplied ITSTATIC rather than the hard-coded 'static'. Acked-by: Petr Mladek <pmladek@suse.com> Tested-by: Joe Lawrence <joe.lawrence@redhat.com> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
```diff diff --git a/drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.h b/drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.h index 1d7fc3226bca..cfb42a8f5768 100644 --- a/drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.h +++ b/drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.h @@ -53,6 +53,10 @@ extern...
3049fc4b5f1d2320a84e2902b3ac5a735f60ca04
Analyze and fix the following issue in the Linux kernel code: x86/alternative: Refactor INT3 call emulation selftest
Problem Details: The INT3 call emulation selftest is a bit fragile as it relies on the compiler not inserting any extra instructions before the int3_selftest_ip() definition. Also, the int3_selftest_ip() symbol overlaps with the int3_selftest symbol(), which can confuse objtool. Fix those issues by slightly reworking...
```diff diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 8ee5ff547357..d19a3fd7cf04 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -2244,21 +2244,34 @@ int alternatives_text_reserved(void *start, void *end) * See entry_{32,64}.S for more details. */...
6717e8f91db71641cb52855ed14c7900972ed0bc
Analyze and fix the following issue in the Linux kernel code: kbuild: Remove 'kmod_' prefix from __KBUILD_MODNAME
Problem Details: In preparation for the objtool klp diff subcommand, remove the arbitrary 'kmod_' prefix from __KBUILD_MODNAME and instead add it explicitly in the __initcall_id() macro. This change supports the standardization of "unique" symbol naming by ensuring the non-unique portion of the name comes before the u...
```diff diff --git a/include/linux/init.h b/include/linux/init.h index 17c1bc712e23..40331923b9f4 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -200,12 +200,13 @@ extern struct module __this_module; /* Format: <modname>__<counter>_<line>_<fn> */ #define __initcall_id(fn) \ + __PASTE(kmod_, ...