id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
322617a06c97153f7b0681ecaa55490abccff7fa
Analyze and fix the following issue in the Linux kernel code: NTB: ntb_transport: Add 'tx_memcpy_offload' module option
Problem Details: Some platforms (e.g. R-Car S4) do not gain from using a DMAC on TX path in ntb_transport and end up CPU-bound on memcpy_toio(). Add a module parameter 'tx_memcpy_offload' that moves the TX memcpy_toio() and descriptor writes to a per-QP kernel thread. It is disabled by default. This change also fixes ...
```diff diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c index 4483160851d4..cf64c6d0275a 100644 --- a/drivers/ntb/ntb_transport.c +++ b/drivers/ntb/ntb_transport.c @@ -54,12 +54,14 @@ #include <linux/errno.h> #include <linux/export.h> #include <linux/interrupt.h> +#include <linux/kthread.h> #...
969c3cca0f3b88682cd833cee4cf01b0915629a3
Analyze and fix the following issue in the Linux kernel code: rtc: ds1390: fix number of bytes read from RTC
Problem Details: The spi_write_then_read() reads 8 bytes starting from DS1390_REG_SECONDS (== 0x01), so the last byte read would already be part of the alarm (Tenths and Hundredths of Seconds) feature. However 7 bytes are engouh -- seconds (0x01), minutes (0x02), hours (0x03), day (0x04), date (0x05), month/century (0...
```diff diff --git a/drivers/rtc/rtc-ds1390.c b/drivers/rtc/rtc-ds1390.c index f46428ca77cc..f7afd6bdeb4a 100644 --- a/drivers/rtc/rtc-ds1390.c +++ b/drivers/rtc/rtc-ds1390.c @@ -134,7 +134,7 @@ static int ds1390_read_time(struct device *dev, struct rtc_time *dt) chip->txrx_buf[0] = DS1390_REG_SECONDS; /* do the ...
81be22cd4ace020045cc6d31255c6f7c071eb7c0
Analyze and fix the following issue in the Linux kernel code: rtc: interface: Alarm race handling should not discard preceding error
Problem Details: Commit 795cda8338ea ("rtc: interface: Fix long-standing race when setting alarm") should not discard any errors from the preceding validations. Prior to that commit, if the alarm feature was disabled, or the set_alarm failed, a meaningful error code would be returned to the caller for further action. ...
```diff diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index b8b298efd9a9..1906f4884a83 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c @@ -457,7 +457,7 @@ static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) * are in, we can return -ETIME to signal that the...
dfeef98e55d0e5f622886d0a9980c235ff08fd97
Analyze and fix the following issue in the Linux kernel code: drm/xe/sa: Add lockdep annotations for SA manager swap_guard
Problem Details: Annotate the SA manager init path to model taking swap_guard while under reclaim context. This helps lockdep catch potential circular dependencies between fs_reclaim and swap_guard in debug builds. Without this annotation, lockdep is unaware of this chain until the shrinker runs. Signed-off-by: Satyan...
```diff diff --git a/drivers/gpu/drm/xe/xe_sa.c b/drivers/gpu/drm/xe/xe_sa.c index c7ee952e8914..f32045f40b7a 100644 --- a/drivers/gpu/drm/xe/xe_sa.c +++ b/drivers/gpu/drm/xe/xe_sa.c @@ -89,6 +89,12 @@ struct xe_sa_manager *__xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, if (ret) return ERR_PTR(ret); +...
bcd768d787e7bb4e06d77709fa17d5bafec8612e
Analyze and fix the following issue in the Linux kernel code: drm/xe/vf: Fix fs_reclaim warning with CCS save/restore BB allocation
Problem Details: CCS save/restore batch buffers are attached during BO allocation and detached during BO teardown. The shrinker triggers xe_bo_move(), which is used for both allocation and deletion paths. When BO allocation and shrinking occur concurrently, a circular locking dependency involving fs_reclaim and swap_g...
```diff diff --git a/drivers/gpu/drm/xe/xe_bb.c b/drivers/gpu/drm/xe/xe_bb.c index 8b678297aaa2..b0aceaec2685 100644 --- a/drivers/gpu/drm/xe/xe_bb.c +++ b/drivers/gpu/drm/xe/xe_bb.c @@ -59,16 +59,51 @@ err: return ERR_PTR(err); } -struct xe_bb *xe_bb_ccs_new(struct xe_gt *gt, u32 dwords, - enum xe_sriov_vf_...
16843e6638b743dd0376a1fc0845f2fd34daff98
Analyze and fix the following issue in the Linux kernel code: drm/sa: Split drm_suballoc_new() into SA alloc and init helpers
Problem Details: drm_suballoc_new() currently both allocates the SA object using kmalloc() and searches for a suitable hole in the sub-allocator for the requested size. If SA allocation is done by holding sub-allocator mutex, this design can lead to reclaim safety issues. By splitting the kmalloc() step outside of the...
```diff diff --git a/drivers/gpu/drm/drm_suballoc.c b/drivers/gpu/drm/drm_suballoc.c index 879ea33dbbc4..dc9bef3c0419 100644 --- a/drivers/gpu/drm/drm_suballoc.c +++ b/drivers/gpu/drm/drm_suballoc.c @@ -293,45 +293,66 @@ static bool drm_suballoc_next_hole(struct drm_suballoc_manager *sa_manager, } /** - * drm_subal...
a5d5634cde48a9fcd68c8504aa07f89f175074a0
Analyze and fix the following issue in the Linux kernel code: drm/xe/sync: Fix user fence leak on alloc failure
Problem Details: When dma_fence_chain_alloc() fails, properly release the user fence reference to prevent a memory leak. Fixes: adda4e855ab6 ("drm/xe: Enforce correct user fence signaling order using") Cc: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com> Reviewed-by: Matth...
```diff diff --git a/drivers/gpu/drm/xe/xe_sync.c b/drivers/gpu/drm/xe/xe_sync.c index f03ab2e27284..52cefbd985ac 100644 --- a/drivers/gpu/drm/xe/xe_sync.c +++ b/drivers/gpu/drm/xe/xe_sync.c @@ -206,8 +206,10 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef, if (XE_IOCTL_DBG(xe, IS_ERR(sync->ufe...
f939bdd9207a5d1fc55cced5459858480686ce22
Analyze and fix the following issue in the Linux kernel code: drm/xe/sync: Cleanup partially initialized sync on parse failure
Problem Details: xe_sync_entry_parse() can allocate references (syncobj, fence, chain fence, or user fence) before hitting a later failure path. Several of those paths returned directly, leaving partially initialized state and leaking refs. Route these error paths through a common free_sync label and call xe_sync_entr...
```diff diff --git a/drivers/gpu/drm/xe/xe_sync.c b/drivers/gpu/drm/xe/xe_sync.c index c8fdcdbd6ae7..f03ab2e27284 100644 --- a/drivers/gpu/drm/xe/xe_sync.c +++ b/drivers/gpu/drm/xe/xe_sync.c @@ -146,8 +146,10 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef, if (!signal) { sync->fence = drm...
0d195d3b205ca90db30d70d09d7bb6909aac178f
Analyze and fix the following issue in the Linux kernel code: drbd: fix null-pointer dereference on local read error
Problem Details: In drbd_request_endio(), READ_COMPLETED_WITH_ERROR is passed to __req_mod() with a NULL peer_device: __req_mod(req, what, NULL, &m); The READ_COMPLETED_WITH_ERROR handler then unconditionally passes this NULL peer_device to drbd_set_out_of_sync(), which dereferences it, causing a null-pointer deref...
```diff diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index d15826f6ee81..70f75ef07945 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c @@ -621,7 +621,8 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, break; case READ_COMPLETED_WITH_...
a29a1f0ec8d69ee917a9d4c84b844df0decff0ef
Analyze and fix the following issue in the Linux kernel code: drm/sysfb: corebootdrm: Add DRM driver for coreboot framebuffers
Problem Details: Add corebootdrm, a DRM driver for coreboot framebuffers. The driver supports a pre-initialized framebuffer with various packed RGB formats. The driver code is fairly small and uses the same logic as the other sysfb drivers. Most of the implementation comes from existing sysfb helpers. Until now, coreb...
```diff diff --git a/drivers/firmware/google/Kconfig b/drivers/firmware/google/Kconfig index 3ab3e089328b..b78c644fa253 100644 --- a/drivers/firmware/google/Kconfig +++ b/drivers/firmware/google/Kconfig @@ -63,7 +63,8 @@ config GOOGLE_FRAMEBUFFER_COREBOOT help This option enables the kernel to search for a frameb...
73d8aa63b22b1e49f3f025da394bbe339e7a880f
Analyze and fix the following issue in the Linux kernel code: firmware: google: framebuffer: Fix dependencies
Problem Details: The framebuffer on the coreboot bus represents an entry in the coreboot payload table; not the actual device. [1] Hence it must not depend on any other driver setting. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/dri-devel/CAODwPW9_ym3E4za3yoUAs0+1sQfaKTDOau4Oh9...
```diff diff --git a/drivers/firmware/google/Kconfig b/drivers/firmware/google/Kconfig index 41b78f5cb735..3ab3e089328b 100644 --- a/drivers/firmware/google/Kconfig +++ b/drivers/firmware/google/Kconfig @@ -59,11 +59,11 @@ config GOOGLE_MEMCONSOLE_X86_LEGACY config GOOGLE_FRAMEBUFFER_COREBOOT tristate "Coreboot Fr...
0d847e16ca6c23a99a0228db6c2589d4b1898321
Analyze and fix the following issue in the Linux kernel code: firmware: google: framebuffer: Tie platform device to PCI hardware
Problem Details: Use the PCI device as parent of the system-framebuffer device instead of the coreboot device. Prevents SIGBUS or SIGSEG after hot-unplug of the PCI device while the framebuffer is active. The simple-framebuffer device depends on the PCI hardware, so this device needs to be its parent. The current core...
```diff diff --git a/drivers/firmware/google/framebuffer-coreboot.c b/drivers/firmware/google/framebuffer-coreboot.c index 767515a30a52..07e9c7be94fa 100644 --- a/drivers/firmware/google/framebuffer-coreboot.c +++ b/drivers/firmware/google/framebuffer-coreboot.c @@ -13,6 +13,7 @@ #include <linux/kernel.h> #include <l...
f3850d399de3b6142b02315227ef9e772ed0c302
Analyze and fix the following issue in the Linux kernel code: firmware: google: framebuffer: Do not mark framebuffer as busy
Problem Details: Remove the flag IORESOURCE_BUSY flag from coreboot's framebuffer resource. It prevents simpledrm from successfully requesting the range for its own use; resulting in errors such as [ 2.775430] simple-framebuffer simple-framebuffer.0: [drm] could not acquire memory region [mem 0x80000000-0x80407fff ...
```diff diff --git a/drivers/firmware/google/framebuffer-coreboot.c b/drivers/firmware/google/framebuffer-coreboot.c index 4e9177105992..f44183476ed7 100644 --- a/drivers/firmware/google/framebuffer-coreboot.c +++ b/drivers/firmware/google/framebuffer-coreboot.c @@ -67,7 +67,7 @@ static int framebuffer_probe(struct cor...
5cd28bd28c8ce426b56ce4230dbd17537181d5ad
Analyze and fix the following issue in the Linux kernel code: firmware: google: framebuffer: Do not unregister platform device
Problem Details: The native driver takes over the framebuffer aperture by removing the system- framebuffer platform device. Afterwards the pointer in drvdata is dangling. Remove the entire logic around drvdata and let the kernel's aperture helpers handle this. The platform device depends on the native hardware device i...
```diff diff --git a/drivers/firmware/google/framebuffer-coreboot.c b/drivers/firmware/google/framebuffer-coreboot.c index c68c9f56370f..4e9177105992 100644 --- a/drivers/firmware/google/framebuffer-coreboot.c +++ b/drivers/firmware/google/framebuffer-coreboot.c @@ -81,19 +81,10 @@ static int framebuffer_probe(struct c...
803ec1faf7c1823e6e3b1f2aaa81be18528c9436
Analyze and fix the following issue in the Linux kernel code: drm/bridge: samsung-dsim: Fix memory leak in error path
Problem Details: In samsung_dsim_host_attach(), drm_bridge_add() is called to add the bridge. However, if samsung_dsim_register_te_irq() or pdata->host_ops->attach() fails afterwards, the function returns without removing the bridge, causing a memory leak. Fix this by adding proper error handling with goto labels to e...
```diff diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index eabc4c32f6ab..ad8c6aa49d48 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1881,6 +1881,14 @@ static int samsung_dsim_register_te_irq(struct samsung_dsim *dsi, stru...
496daa2759260374bb9c9b2196a849aa3bc513a8
Analyze and fix the following issue in the Linux kernel code: drm/bridge: synopsys: dw-dp: Check return value of devm_drm_bridge_add() in dw_dp_bind()
Problem Details: Return the value of devm_drm_bridge_add() in order to propagate the error properly, if it fails due to resource allocation failure or bridge registration failure. This ensures that the bind function fails safely rather than proceeding with a potentially incomplete bridge setup. Fixes: b726970486d8 ("...
```diff diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c b/drivers/gpu/drm/bridge/synopsys/dw-dp.c index 432342452484..07f7a2e0d9f2 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c @@ -2049,7 +2049,9 @@ struct dw_dp *dw_dp_bind(struct device *dev, struct drm_encoder...
c5f8658f97ec392eeaf355d4e9775ae1f23ca1d3
Analyze and fix the following issue in the Linux kernel code: drm/imx: parallel-display: check return value of devm_drm_bridge_add() in imx_pd_probe()
Problem Details: Return the value of devm_drm_bridge_add() in order to propagate the error properly, if it fails due to resource allocation failure or bridge registration failure. This ensures that the probe function fails safely rather than proceeding with a potentially incomplete bridge setup. Fixes: bf7e97910b9f (...
```diff diff --git a/drivers/gpu/drm/imx/ipuv3/parallel-display.c b/drivers/gpu/drm/imx/ipuv3/parallel-display.c index 6fbf505d2801..590120a33fa0 100644 --- a/drivers/gpu/drm/imx/ipuv3/parallel-display.c +++ b/drivers/gpu/drm/imx/ipuv3/parallel-display.c @@ -256,7 +256,9 @@ static int imx_pd_probe(struct platform_devic...
75f3cf0d1561b0a1cfa97ee35d78ca0118e584d5
Analyze and fix the following issue in the Linux kernel code: rv: Fix multiple definition of __pcpu_unique_da_mon_this
Problem Details: The refactoring in commit 30984ccf31b7 ("rv: Refactor da_monitor to minimise macros") replaced per-monitor unique variable names (da_mon_##name) with a fixed name (da_mon_this). While this works for 'static' variables (each translation unit gets its own copy), DEFINE_PER_CPU internally generates a non...
```diff diff --git a/include/rv/da_monitor.h b/include/rv/da_monitor.h index db11d41bb438..7511f5464c48 100644 --- a/include/rv/da_monitor.h +++ b/include/rv/da_monitor.h @@ -20,6 +20,12 @@ #include <linux/bug.h> #include <linux/sched.h> +/* + * Per-cpu variables require a unique name although static in some + * co...
c2366539d3746219000f58d821fdf8607bd8cfec
Analyze and fix the following issue in the Linux kernel code: drm/xe/guc: Increase GuC log sizes in debug builds
Problem Details: Increase event log size for GuC debug to 16MB, and for general debug to 8MB. This allows for useful debug even if performance-affecting DRM_XE_DEBUG_GUC is not enabled. Without this change, GuC logs gathered by CI are useless for debug due to limited size, which translates to time frame not even able ...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_log.h b/drivers/gpu/drm/xe/xe_guc_log.h index 1b05bb60c1c7..4649a260755e 100644 --- a/drivers/gpu/drm/xe/xe_guc_log.h +++ b/drivers/gpu/drm/xe/xe_guc_log.h @@ -13,9 +13,13 @@ struct drm_printer; struct xe_device; #if IS_ENABLED(CONFIG_DRM_XE_DEBUG_GUC) -#define XE_GUC_...
f6a495484a27150fb85f943e1a7464da88c2a797
Analyze and fix the following issue in the Linux kernel code: proc: Fix pointer error dereference
Problem Details: The function try_lookup_noperm() can return an error pointer. Add check for error pointer. Detected by Smatch: fs/proc/base.c:2148 proc_fill_cache() error: 'child' dereferencing possible ERR_PTR() Fixes: 1df98b8bbcca ("proc_fill_cache(): clean up, get rid of pointless find_inode_number() use") Signed...
```diff diff --git a/fs/proc/base.c b/fs/proc/base.c index 4eec684baca9..4c863d17dfb4 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2128,6 +2128,9 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx, ino_t ino = 1; child = try_lookup_noperm(&qname, dir); + if (IS_ERR(child)) + goto end_inst...
008304c9ae75c772d3460040de56e12112cdf5e6
Analyze and fix the following issue in the Linux kernel code: drm/i915/alpm: ALPM disable fixes
Problem Details: PORT_ALPM_CTL is supposed to be written only before link training. Remove writing it from ALPM disable. Also clearing ALPM_CTL_ALPM_AUX_LESS_ENABLE and is not about disabling ALPM but switching to AUX-Wake ALPM. Stop touching this bit on ALPM disable. Closes: https://gitlab.freedesktop.org/drm/xe/ker...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c index e0a4a59dc025..b3334bc4d0f9 100644 --- a/drivers/gpu/drm/i915/display/intel_alpm.c +++ b/drivers/gpu/drm/i915/display/intel_alpm.c @@ -604,12 +604,7 @@ void intel_alpm_disable(struct intel_dp *intel_dp) mut...
97b281d7edb2ae662365be2809cd728470119720
Analyze and fix the following issue in the Linux kernel code: rust: list: Add unsafe blocks for container_of and safety comments
Problem Details: impl_list_item_mod.rs calls container_of! without unsafe blocks at a couple of places. Since container_of! is unsafe, the blocks are strictly necessary. The problem was so far not visible because the "unsafe-op-in-unsafe-fn" check is a lint rather than a hard compiler error, and Rust suppresses lints ...
```diff diff --git a/rust/kernel/list/impl_list_item_mod.rs b/rust/kernel/list/impl_list_item_mod.rs index 202bc6f97c13..ee53d0387e63 100644 --- a/rust/kernel/list/impl_list_item_mod.rs +++ b/rust/kernel/list/impl_list_item_mod.rs @@ -84,11 +84,12 @@ macro_rules! impl_has_list_links_self_ptr { // right type. ...
bfd264fbbbca7a39ea430d7bc2baf8ee2ea958e4
Analyze and fix the following issue in the Linux kernel code: net: dsa: sja1105: protect link replay helpers against NULL phylink instance
Problem Details: There is a crash when unbinding the sja1105 driver under special circumstances: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000030 Call trace: phylink_run_resolve_and_disable+0x10/0x90 sja1105_static_config_reload+0xc0/0x410 sja1105_vlan_filtering+0x100/0x140 dsa_port...
```diff diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c index 71a817c07a90..94d17b06da40 100644 --- a/drivers/net/dsa/sja1105/sja1105_main.c +++ b/drivers/net/dsa/sja1105/sja1105_main.c @@ -2278,6 +2278,12 @@ int sja1105_static_config_reload(struct sja1105_private *priv, ...
f1e2f0ce704e4a14e3f367d3b97d3dd2d8e183b7
Analyze and fix the following issue in the Linux kernel code: net: usb: lan78xx: scan all MDIO addresses on LAN7801
Problem Details: The LAN7801 is designed exclusively for external PHYs (unlike the LAN7800/LAN7850 which have internal PHYs), but lan78xx_mdio_init() restricts PHY scanning to MDIO addresses 0-7 by setting phy_mask to ~(0xFF). This prevents discovery of external PHYs wired to addresses outside that range. One such cas...
```diff diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 00397a807393..065588c9cfa6 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -2094,8 +2094,6 @@ static int lan78xx_mdio_init(struct lan78xx_net *dev) dev->mdiobus->phy_mask = ~(1 << 1); break; case ID_REV_CH...
64868f5ecadeb359a49bc4485bfa7c497047f13a
Analyze and fix the following issue in the Linux kernel code: net: usb: kaweth: remove TX queue manipulation in kaweth_set_rx_mode
Problem Details: kaweth_set_rx_mode(), the ndo_set_rx_mode callback, calls netif_stop_queue() and netif_wake_queue(). These are TX queue flow control functions unrelated to RX multicast configuration. The premature netif_wake_queue() can re-enable TX while tx_urb is still in-flight, leading to a double usb_submit_urb(...
```diff diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index c9efb7df892e..e01d14f6c366 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c @@ -765,7 +765,6 @@ static void kaweth_set_rx_mode(struct net_device *net) netdev_dbg(net, "Setting Rx mode to %d\n", packet_filter_bitmap); ...
e1512c1db9e8794d8d130addd2615ec27231d994
Analyze and fix the following issue in the Linux kernel code: espintcp: Fix race condition in espintcp_close()
Problem Details: This issue was discovered during a code audit. After cancel_work_sync() is called from espintcp_close(), espintcp_tx_work() can still be scheduled from paths such as the Delayed ACK handler or ksoftirqd. As a result, the espintcp_tx_work() worker may dereference a freed espintcp ctx or sk. The follow...
```diff diff --git a/net/xfrm/espintcp.c b/net/xfrm/espintcp.c index bf744ac9d5a7..8709df716e98 100644 --- a/net/xfrm/espintcp.c +++ b/net/xfrm/espintcp.c @@ -536,7 +536,7 @@ static void espintcp_close(struct sock *sk, long timeout) sk->sk_prot = &tcp_prot; barrier(); - cancel_work_sync(&ctx->work); + disable_wor...
f891007ab1c77436950d10e09eae54507f1865ff
Analyze and fix the following issue in the Linux kernel code: psp: use sk->sk_hash in psp_write_headers()
Problem Details: udp_flow_src_port() is indirectly using sk->sk_txhash as a base, because __tcp_transmit_skb() uses skb_set_hash_from_sk(). This is problematic because this field can change over the lifetime of a TCP flow, thanks to calls to sk_rethink_txhash(). Problem is that some NIC might (ab)use the PSP UDP sour...
```diff diff --git a/net/psp/psp_main.c b/net/psp/psp_main.c index a8534124f626..066222eb56c4 100644 --- a/net/psp/psp_main.c +++ b/net/psp/psp_main.c @@ -166,9 +166,46 @@ static void psp_write_headers(struct net *net, struct sk_buff *skb, __be32 spi, { struct udphdr *uh = udp_hdr(skb); struct psphdr *psph = (stru...
858d2a4f67ff69e645a43487ef7ea7f28f06deae
Analyze and fix the following issue in the Linux kernel code: tcp: fix potential race in tcp_v6_syn_recv_sock()
Problem Details: Code in tcp_v6_syn_recv_sock() after the call to tcp_v4_syn_recv_sock() is done too late. After tcp_v4_syn_recv_sock(), the child socket is already visible from TCP ehash table and other cpus might use it. Since newinet->pinet6 is still pointing to the listener ipv6_pinfo bad things can happen as syz...
```diff diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index ecb362025c4e..5cb3056d6ddc 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h @@ -42,7 +42,9 @@ struct inet_connection_sock_af_ops { struct request_sock *req, st...
8c746e22096579897d1f8f74dbb6b17a6862fb6d
Analyze and fix the following issue in the Linux kernel code: PCI: dwc: ep: Always clear IB maps on BAR update
Problem Details: dw_pcie_ep_set_bar() currently tears down existing inbound mappings only when either the previous or the new struct pci_epf_bar uses submaps (num_submap != 0). If both the old and new mappings are BAR Match Mode, reprogramming the same ATU index is sufficient, so no explicit teardown was needed. Howev...
```diff diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index 0ca05943a1e5..295076cf70de 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -519,6 +519,12 @@ static int dw_pcie_ep_set_bar(st...
5ddb66967924e38c680e6a304585c0f553681a3a
Analyze and fix the following issue in the Linux kernel code: PCI: endpoint: pci-epf-test: Select configfs
Problem Details: Like some of the other endpoint modules, pci-epf-test now also uses configfs, but is missing an indication in Kconfig: arm-linux-gnueabi-ld: drivers/pci/endpoint/functions/pci-epf-test.o: in function `pci_epf_test_add_cfs': pci-epf-test.c:(.text.pci_epf_test_add_cfs+0x2c): undefined reference to `...
```diff diff --git a/drivers/pci/endpoint/functions/Kconfig b/drivers/pci/endpoint/functions/Kconfig index 0c9cea0698d7..bb5a23994288 100644 --- a/drivers/pci/endpoint/functions/Kconfig +++ b/drivers/pci/endpoint/functions/Kconfig @@ -6,6 +6,7 @@ config PCI_EPF_TEST tristate "PCI Endpoint Test driver" depends on P...
a3b93b42238b3bb9eefc25729f567e66eea66a56
Analyze and fix the following issue in the Linux kernel code: PCI: Account fully optional bridge windows correctly
Problem Details: pbus_size_mem_optional() adds dev_res->add_size of a bridge window into children_add_size when the window has a non-optional part. However, if the bridge window is fully optional, only r_size is added (which is zero for such a window). Also, a second dev_res entry will be added by pci_dev_res_add_to_l...
```diff diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index f30d1f7f023a..bd66ac47b3b9 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -1224,31 +1224,34 @@ static bool pbus_size_mem_optional(struct pci_dev *dev, int resno, struct resource *res = pci_resource_n(dev, resno); boo...
9678e53179aa7e907360f5b5b275769008a69b80
Analyze and fix the following issue in the Linux kernel code: tracing: Wake up poll waiters for hist files when removing an event
Problem Details: The event_hist_poll() function attempts to verify whether an event file is being removed, but this check may not occur or could be unnecessarily delayed. This happens because hist_poll_wakeup() is currently invoked only from event_hist_trigger() when a hist command is triggered. If the event file is be...
```diff diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h index 0a2b8229b999..37eb2f0f3dd8 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -683,6 +683,11 @@ static inline void hist_poll_wakeup(void) #define hist_poll_wait(file, wait) \ poll_wait(file, &hist_po...
f0a0da1f907e8488826d91c465f7967a56a95aca
Analyze and fix the following issue in the Linux kernel code: tracing: Fix checking of freed trace_event_file for hist files
Problem Details: The event_hist_open() and event_hist_poll() functions currently retrieve a trace_event_file pointer from a file struct by invoking event_file_data(), which simply returns file->f_inode->i_private. The functions then check if the pointer is NULL to determine whether the event is still valid. This approa...
```diff diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index e6f449f53afc..768df987419e 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -5784,7 +5784,7 @@ static __poll_t event_hist_poll(struct file *file, struct poll_table_struct *wai guard(...
f4ff9f646a4d373f9e895c2f0073305da288bc0a
Analyze and fix the following issue in the Linux kernel code: fgraph: Do not call handlers direct when not using ftrace_ops
Problem Details: The function graph tracer was modified to us the ftrace_ops of the function tracer. This simplified the code as well as allowed more features of the function graph tracer. Not all architectures were converted over as it required the implementation of HAVE_DYNAMIC_FTRACE_WITH_ARGS to implement. For tho...
```diff diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 1a4d36fc9085..c242fe49af4c 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -1092,10 +1092,17 @@ static inline bool is_ftrace_trampoline(unsigned long addr) #ifdef CONFIG_FUNCTION_GRAPH_TRACER #ifndef ftrace_graph_func -#d...
912b0ee248c529a4f45d1e7f568dc1adddbf2a4a
Analyze and fix the following issue in the Linux kernel code: tracing: ring-buffer: Fix to check event length before using
Problem Details: Check the event length before adding it for accessing next index in rb_read_data_buffer(). Since this function is used for validating possibly broken ring buffers, the length of the event could be broken. In that case, the new event (e + len) can point a wrong address. To avoid invalid memory access at...
```diff diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index bdc8010d8f48..1e7a34a31851 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -1849,6 +1849,7 @@ static int rb_read_data_buffer(struct buffer_data_page *dpage, int tail, int cpu struct ring_buffer_event *event;...
f1547779402c4cd67755c33616b7203baa88420b
Analyze and fix the following issue in the Linux kernel code: ring-buffer: Fix possible dereference of uninitialized pointer
Problem Details: There is a pointer head_page in rb_meta_validate_events() which is not initialized at the beginning of a function. This pointer can be dereferenced if there is a failure during reader page validation. In this case the control is passed to "invalid" label where the pointer is dereferenced in a loop. To...
```diff diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index d33103408955..bdc8010d8f48 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -1919,6 +1919,8 @@ static void rb_meta_validate_events(struct ring_buffer_per_cpu *cpu_buffer) if (!meta || !meta->head_buffer) r...
d820fa3114825c43a6a2f3d66d3d1029db811fe3
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: fix flaky build_id test
Problem Details: The build_id selftest occasionally fails because MADV_PAGEOUT does not guarantee the immediate eviction of the page. The test assumes eviction happens and proceeds without verifying that the page was actually reclaimed, leading to false test failures. Fix the test by retrying the page-out sequence unt...
```diff diff --git a/tools/testing/selftests/bpf/uprobe_multi.c b/tools/testing/selftests/bpf/uprobe_multi.c index dd38dc68f635..3e58a86b8e25 100644 --- a/tools/testing/selftests/bpf/uprobe_multi.c +++ b/tools/testing/selftests/bpf/uprobe_multi.c @@ -100,6 +100,9 @@ int __attribute__((weak)) trigger_uprobe(bool build_i...
ecfa6f34492c493a9a1dc2900f3edeb01c79946b
Analyze and fix the following issue in the Linux kernel code: HID: Add HID_CLAIMED_INPUT guards in raw_event callbacks missing them
Problem Details: In commit 2ff5baa9b527 ("HID: appleir: Fix potential NULL dereference at raw event handle"), we handle the fact that raw event callbacks can happen even for a HID device that has not been "claimed" causing a crash if a broken device were attempted to be connected to the system. Fix up the remaining in...
```diff diff --git a/drivers/hid/hid-cmedia.c b/drivers/hid/hid-cmedia.c index 528d7f361215..8bf5649b0c79 100644 --- a/drivers/hid/hid-cmedia.c +++ b/drivers/hid/hid-cmedia.c @@ -99,7 +99,7 @@ static int cmhid_raw_event(struct hid_device *hid, struct hid_report *report, { struct cmhid *cm = hid_get_drvdata(hid); -...
2bad24c17742fc88973d6aea526ce1353f5334a3
Analyze and fix the following issue in the Linux kernel code: HID: asus: avoid memory leak in asus_report_fixup()
Problem Details: The asus_report_fixup() function was returning a newly allocated kmemdup()-allocated buffer, but never freeing it. Switch to devm_kzalloc() to ensure the memory is managed and freed automatically when the device is removed. The caller of report_fixup() does not take ownership of the returned pointer,...
```diff diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c index 8ffcd12038e8..7a08e964b9cc 100644 --- a/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c @@ -1399,14 +1399,21 @@ static const __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc, */ if (*rsize == rsize_orig && rdesc[offs] ...
91e8c6e601bdc1ccdf886479b6513c01c7e51c2c
Analyze and fix the following issue in the Linux kernel code: HID: magicmouse: avoid memory leak in magicmouse_report_fixup()
Problem Details: The magicmouse_report_fixup() function was returning a newly kmemdup()-allocated buffer, but never freeing it. The caller of report_fixup() does not take ownership of the returned pointer, but it *is* permitted to return a sub-portion of the input rdesc, whose lifetime is managed by the caller. Assis...
```diff diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index 91f621ceb924..17908d52c027 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c @@ -994,9 +994,7 @@ static const __u8 *magicmouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, hid_info(hdev, "fixi...
239c15116d80f67d32f00acc34575f1a6b699613
Analyze and fix the following issue in the Linux kernel code: HID: apple: avoid memory leak in apple_report_fixup()
Problem Details: The apple_report_fixup() function was returning a newly kmemdup()-allocated buffer, but never freeing it. The caller of report_fixup() does not take ownership of the returned pointer, but it *is* permitted to return a sub-portion of the input rdesc, whose lifetime is managed by the caller. Assisted-b...
```diff diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index 233e367cce1d..894adc23367b 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c @@ -686,9 +686,7 @@ static const __u8 *apple_report_fixup(struct hid_device *hdev, __u8 *rdesc, hid_info(hdev, "fixing up Magic Keyboard batt...
571dcbeb8e635182bb825ae758399831805693c2
Analyze and fix the following issue in the Linux kernel code: net: nfc: nci: Fix parameter validation for packet data
Problem Details: Since commit 9c328f54741b ("net: nfc: nci: Add parameter validation for packet data") communication with nci nfc chips is not working any more. The mentioned commit tries to fix access of uninitialized data, but failed to understand that in some cases the data packet is of variable length and can ther...
```diff diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c index 418b84e2b260..c96512bb8653 100644 --- a/net/nfc/nci/ntf.c +++ b/net/nfc/nci/ntf.c @@ -58,7 +58,7 @@ static int nci_core_conn_credits_ntf_packet(struct nci_dev *ndev, struct nci_conn_info *conn_info; int i; - if (skb->len < sizeof(struct nci_core_con...
57a94d4b22b0c6cc5d601e6b6238d78fb923d991
Analyze and fix the following issue in the Linux kernel code: net/mlx5e: Use unsigned for mlx5e_get_max_num_channels
Problem Details: The max number of channels is always an unsigned int, use the correct type to fix compilation errors done with strict type checking, e.g.: error: call to ‘__compiletime_assert_1110’ declared with attribute error: min(mlx5e_get_devlink_param_num_doorbells(mdev), mlx5e_get_max_num_channels(mdev)) si...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h index 19fce51117c9..ea2cd1f5d1d0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h @@ -180,7 +180,8 @@ static inline u16 mlx5_min_rx_wqes(int wq_typ...
83ac0304a2d77519dae1e54c9713cbe1aedf19c9
Analyze and fix the following issue in the Linux kernel code: net/mlx5e: Fix deadlocks between devlink and netdev instance locks
Problem Details: In the mentioned "Fixes" commit, various work tasks triggering devlink health reporter recovery were switched to use netdev_trylock to protect against concurrent tear down of the channels being recovered. But this had the side effect of introducing potential deadlocks because of incorrect lock ordering...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c index 424f8a2728a3..74660e7fe674 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c @@ -457,22 +457,8 @@ static void mlx5e_ptpsq_unhe...
9854b243ce4225328d0b32fdc998d35b6952d3f7
Analyze and fix the following issue in the Linux kernel code: net/mlx5e: MACsec, add ASO poll loop in macsec_aso_set_arm_event
Problem Details: The macsec_aso_set_arm_event function calls mlx5_aso_poll_cq once without a retry loop. If the CQE is not immediately available after posting the WQE, the function fails unnecessarily. Use read_poll_timeout() to poll 3-10 usecs for CQE, consistent with other ASO polling code paths in the driver. Fixe...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c index 641cd3a2cdfa..90b3bc5f9166 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c @@ -1386,7 +1...
d451994ebc7d4392610bd4b2ab339b255deb4143
Analyze and fix the following issue in the Linux kernel code: net/mlx5: Fix misidentification of write combining CQE during poll loop
Problem Details: The write combining completion poll loop uses usleep_range() which can sleep much longer than requested due to scheduler latency. Under load, we witnessed a 20ms+ delay until the process was rescheduled, causing the jiffies based timeout to expire while the thread is sleeping. The original do-while lo...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/wc.c b/drivers/net/ethernet/mellanox/mlx5/core/wc.c index 815a7c97d6b0..04d03be1bb77 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/wc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/wc.c @@ -2,6 +2,7 @@ // Copyright (c) 2024, NVIDIA CORPORATION & AFFI...
ae3cb71e6c4dbda0c0b7c10475b744377813c7bd
Analyze and fix the following issue in the Linux kernel code: net/mlx5e: Fix misidentification of ASO CQE during poll loop
Problem Details: The ASO completion poll loop uses usleep_range() which can sleep much longer than requested due to scheduler latency. Under load, we witnessed a 20ms+ delay until the process was rescheduled, causing the jiffies based timeout to expire while the thread is sleeping. The original do-while loop structure...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c index 7819fb297280..d5d9146efca6 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c @@ -1,6 +1,7 @@ // SPDX-Lice...
47bf2e813817159f4d195be83a9b5a640ee6baec
Analyze and fix the following issue in the Linux kernel code: net/mlx5: Fix multiport device check over light SFs
Problem Details: Driver is using num_vhca_ports capability to distinguish between multiport master device and multiport slave device. num_vhca_ports is a capability the driver sets according to the MAX num_vhca_ports capability reported by FW. On the other hand, light SFs doesn't set the above capbility. This leads to...
```diff diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index e2d067b1e67b..04dcd09f7517 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -1282,12 +1282,12 @@ static inline bool mlx5_rl_is_supported(struct mlx5_core_dev *dev) static inline int mlx5_core_is_mp_slave(s...
e6834a4c474697df23ab9948fd3577b26bf48656
Analyze and fix the following issue in the Linux kernel code: bonding: alb: fix UAF in rlb_arp_recv during bond up/down
Problem Details: The ALB RX path may access rx_hashtbl concurrently with bond teardown. During rapid bond up/down cycles, rlb_deinitialize() frees rx_hashtbl while RX handlers are still running, leading to a null pointer dereference detected by KASAN. However, the root cause is that rlb_arp_recv() can still be accesse...
```diff diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 78cff904cdc3..55a960da42b5 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -4343,9 +4343,13 @@ static int bond_close(struct net_device *bond_dev) bond_work_cancel_all(bond); bond->sen...
604530085b2ef484843c723a105b6fd3218b4710
Analyze and fix the following issue in the Linux kernel code: bnge: fix reserving resources from FW
Problem Details: HWRM_FUNC_CFG is used to reserve resources, whereas HWRM_FUNC_QCFG is intended for querying resource information from the firmware. Since __bnge_hwrm_reserve_pf_rings() reserves resources for a specific PF, the command type should be HWRM_FUNC_CFG. Fixes: 627c67f038d2 ("bng_en: Add resource management...
```diff diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c index 84c90a957719..91a4ef9e3150 100644 --- a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c +++ b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c @@ -442,7 +442,7 @@ __bnge_hwrm_reserve_p...
4bd8b5f8bcb57b430c35494d8a2471ce5fd7661d
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Enable DAC in DCE link encoder
Problem Details: Ensure that the DAC output is enabled at the correct time by moving it to the DCE link encoder similarly to how digital outputs are enabled. This also removes the call to DAC1EncoderControl from the DCE HWSS, which always felt like it was a hacky solution. Fixes: 0fbe321a93ce ("drm/amd/display: Imple...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c index 8903bdb89c66..2ba3d3a3aac5 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c @@ -102,6 +102,7 @@ static co...
cbced93894d145239c83881d7fd953b7392c23a8
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Set CRTC source for DAC using registers
Problem Details: Apparently the VBIOS SelectCRTC_Source function overwrites a few registers (such as FMT_*) which DC writes in a different place, which can cause problems. Instead of using the SelectCRTC_Source function from the VBIOS, use the DAC_SOURCE_SELECT register directly, similarly to how it is done for digita...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c index 574618d5d4a4..87c19f17c799 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c @@ -1498,7 +1498,10 @...
e2a024345bce78a8e1ed7d9e84c859b05979e41e
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Initialize DAC in DCE link encoder using VBIOS
Problem Details: The VBIOS DAC1EncoderControl() function can initialize the DAC, by writing board-specific values to certain registers. Call this at link encoder hardware initialization time similarly to how the equivalent UNIPHYTransmitterControl initialization is done. This fixes DAC output on the Radeon HD 7790. A...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table.c b/drivers/gpu/drm/amd/display/dc/bios/command_table.c index 76a3559f0ddc..b692fa37402d 100644 --- a/drivers/gpu/drm/amd/display/dc/bios/command_table.c +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table.c @@ -1874,8 +1874,7 @@ static void dac...
e021ee995056ee7e58114edd92bcd4578d8b4bb5
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Turn off DAC in DCE link encoder using VBIOS
Problem Details: Apparently, the VBIOS DAC1EncoderControl function is much more graceful about turning off the DAC. It writes various DAC registers in a specific sequence. Use that instead of just clearing the DAC_ENABLE register. Do this in just the dce110_link_encoder_disable_output function and remove it from the H...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c index 7f0766b5fa3d..f8fcf8d1a4dd 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c @@ -133,6 +133,21 @@ static e...
613b1737abe1bd0a65b49851e777231302095e28
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Don't call find_analog_engine() twice
Problem Details: The analog engine is already there in the link_analog_engine variable and assigned to enc_init_data.analog_engine already. I suspect this was a rebase mistake. Fixes: 436d0d22aa70 ("drm/amd/display: Pass proper DAC encoder ID to VBIOS") Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Tested-by...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/link/link_factory.c b/drivers/gpu/drm/amd/display/dc/link/link_factory.c index 6f4c3c73e113..49db8123f08c 100644 --- a/drivers/gpu/drm/amd/display/dc/link/link_factory.c +++ b/drivers/gpu/drm/amd/display/dc/link/link_factory.c @@ -561,7 +561,6 @@ static bool construct...
aa25c111a782e711d9eaad0adc3d5e086d175a29
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: fix 4-level paging if GMC supports 57-bit VA v2
Problem Details: It turned that using 4 level page tables on GMC generations which support 57bit VAs actually doesn't work at all. Background is that the GMC actually can't switch between 4 and 5 levels, but rather just uses a subset of address space when less than 5 levels are selected. Philip already removed the au...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h index e8e8bfa098c3..0e8a52d96573 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h @@ -33,9 +33,9 @@ #include "amdgpu_ras.h" /* VA hole for 48bit and 57bit addresse...
09da66f139b43c217e22435d6e50b0d9960f5183
Analyze and fix the following issue in the Linux kernel code: drm/amdkfd: Check for NULL return values
Problem Details: This patch fixes issues when the code moves forward with a potential NULL pointer, without checking. Removed one redundant NULL check for a function parameter. This check is already done in the only caller. Signed-off-by: Andrew Martin <andrew.martin@amd.com> Reviewed-by: Felix Kuehling <felix.kuehlin...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c index 193ed8becab8..31b8fa52b42f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c @@ -107,7 +107,7 @@ static const char *amdkfd_fen...
f0157ce46cf0e5e2257e19d590c9b16036ce26d4
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Use same max plane scaling limits for all 64 bpp formats
Problem Details: The plane scaling hw seems to have the same min/max plane scaling limits for all 16 bpc / 64 bpp interleaved pixel color formats. Therefore add cases to amdgpu_dm_plane_get_min_max_dc_plane_scaling() for all the 16 bpc fixed-point / unorm formats to use the same .fp16 up/downscaling factor limits as u...
```diff diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c index ce56734c09b8..198064acf9f6 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c @@ -1060,10 +1060,15 ...
1b38a87b8f8020e8ef4563e7752a64182b5a39b9
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Remove conditional for shaper 3DLUT power-on
Problem Details: [Why] Shaper programming has high chance to fail on first time after power-on or reboot. This can be verified by running IGT's kms_colorop. [How] Always power on the shaper and 3DLUT before programming by removing the debug flag of low power mode. Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.c...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/mpc/dcn32/dcn32_mpc.c b/drivers/gpu/drm/amd/display/dc/mpc/dcn32/dcn32_mpc.c index 83bbbf34bcac..badcef027b84 100644 --- a/drivers/gpu/drm/amd/display/dc/mpc/dcn32/dcn32_mpc.c +++ b/drivers/gpu/drm/amd/display/dc/mpc/dcn32/dcn32_mpc.c @@ -724,8 +724,7 @@ bool mpc32_pr...
b6a65009e7ce3f0cc72da18f186adb60717b51a0
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Correct logic check error for fastboot
Problem Details: [Why] Fix fastboot broken in driver. This is caused by an open source backport change 7495962c. from the comment, the intended check is to disable fastboot for pre-DCN10. but the logic check is reversed, and causes fastboot to be disabled on all DCN10 and after. fastboot is for driver trying to pick ...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c index 4659e1b489ba..4277b6761522 100644 --- a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c @@ -1964,8 +1...
e977fcb3a318b53b47f23b44ac237fceb1b731fe
Analyze and fix the following issue in the Linux kernel code: eth: fbnic: Advertise supported XDP features.
Problem Details: Drivers are supposed to advertise the XDP features they support. This was missed while adding XDP support. Before: $ ynl --family netdev --dump dev-get ... {'ifindex': 3, 'xdp-features': set(), 'xdp-rx-metadata-features': set(), 'xsk-features': set()}, ... After: $ ynl --family netdev --dump d...
```diff diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c b/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c index e3ca5fcfabef..b4b396ca9bce 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c +++ b/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c @@ -805,6 +805,8 @@ struct net_device *fbnic_netdev_alloc...
bcf4373eec313b2538208a1131cb32dcc1a500fb
Analyze and fix the following issue in the Linux kernel code: fbdev: au1100fb: Replace custom printk wrappers by pr_*
Problem Details: The global wrappers also have the advantage to do stricter format checking, so the pr_devel formats are also checked if DEBUG is not defined. The global variants only check for DEBUG being defined and not its actual value, so the #define to zero is dropped, too. There is only a slight semantic change ...
```diff diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c index 7611dad0d68d..f589f90cce2c 100644 --- a/drivers/video/fbdev/au1100fb.c +++ b/drivers/video/fbdev/au1100fb.c @@ -41,6 +41,9 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambri...
2bb53005f4670b8c17c181b9559319b27a6ab74e
Analyze and fix the following issue in the Linux kernel code: fbdev: au1100fb: Mark several local functions as static
Problem Details: This fixes several (fatal) compiler warnings à la drivers/video/fbdev/au1100fb.c:530:6: error: no previous prototype for ‘au1100fb_drv_remove’ [-Werror=missing-prototypes] 523 | void au1100fb_drv_remove(struct platform_device *dev) | ^~~~~~~~~~~~~~~~~~~ Signed-off-by: Uwe Kleine-König...
```diff diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c index 7bc224a8455c..1abaa8e81315 100644 --- a/drivers/video/fbdev/au1100fb.c +++ b/drivers/video/fbdev/au1100fb.c @@ -120,7 +120,7 @@ static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi) * Set hardware with var settings....
7939cecdc6fa39ea9e74507a389f31a7a7936b18
Analyze and fix the following issue in the Linux kernel code: fbdev: au1100fb: Don't store device specific data in global variables
Problem Details: Using global data to store device specific data is a bad pattern that breaks if there is more than one device. So expand driver data and drop the global variables. While there is probably no machine that has two or more au1100fb devices, this makes the driver a better template for new drivers and save...
```diff diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c index feaa1061c436..7bc224a8455c 100644 --- a/drivers/video/fbdev/au1100fb.c +++ b/drivers/video/fbdev/au1100fb.c @@ -84,21 +84,6 @@ struct fb_bitfield rgb_bitfields[][4] = { { 8, 4, 0 }, { 4, 4, 0 }, { 0, 4, 0 }, { 0, 0, 0 } }, };...
d389489225b85aac3ad90ed8b5661679f27a2da4
Analyze and fix the following issue in the Linux kernel code: drm/xe/reg_sr: Add debugfs to verify status of reg_sr programming
Problem Details: When applying save-restore register programming for workarounds, tuning settings, and general device configuration we assume the programming was successful. However there are a number of cases where the desired reg_sr programming can become lost: - workarounds implemented on the wrong RTP table migh...
```diff diff --git a/drivers/gpu/drm/xe/xe_gt_debugfs.c b/drivers/gpu/drm/xe/xe_gt_debugfs.c index 4363bc9c3606..aa43427a9f4b 100644 --- a/drivers/gpu/drm/xe/xe_gt_debugfs.c +++ b/drivers/gpu/drm/xe/xe_gt_debugfs.c @@ -155,6 +155,30 @@ static int register_save_restore(struct xe_gt *gt, struct drm_printer *p) return 0...
a41ee215b59d78f8cd0a4b05e373335944e0ecb0
Analyze and fix the following issue in the Linux kernel code: drm/xe/reg_sr: Don't process gt/hwe lists in VF
Problem Details: There are a few different reg_sr lists managed by the driver for workarounds/tuning: - gt->reg_sr - hwe->reg_sr - hwe->reg_lrc The first two are not relevant to SRIOV VFs; a VF KMD does not have access to the registers that appear on this list and it is the PF KMD's responsibility to apply such pr...
```diff diff --git a/drivers/gpu/drm/xe/tests/xe_rtp_test.c b/drivers/gpu/drm/xe/tests/xe_rtp_test.c index d2255a59e58f..e5a0f985a700 100644 --- a/drivers/gpu/drm/xe/tests/xe_rtp_test.c +++ b/drivers/gpu/drm/xe/tests/xe_rtp_test.c @@ -322,7 +322,8 @@ static void xe_rtp_process_to_sr_tests(struct kunit *test) count_r...
81b1f046ff8a5ad5da2c970cff354b61dfa1d6b1
Analyze and fix the following issue in the Linux kernel code: drbd: Replace deprecated strcpy with strscpy
Problem Details: strcpy() has been deprecated [1] because it performs no bounds checking on the destination buffer, which can lead to buffer overflows. Replace it with the safer strscpy(). No functional changes. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1] Signed-off-by: Thorsten Bl...
```diff diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 1f6ac9202b66..ba00b5f21a49 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -32,6 +32,7 @@ #include <linux/memcontrol.h> #include <linux/mm_inline.h> #include <linux/slab.h> +#include <linux/...
ab140365fb62c0bdab22b2f516aff563b2559e3b
Analyze and fix the following issue in the Linux kernel code: drbd: fix "LOGIC BUG" in drbd_al_begin_io_nonblock()
Problem Details: Even though we check that we "should" be able to do lc_get_cumulative() while holding the device->al_lock spinlock, it may still fail, if some other code path decided to do lc_try_lock() with bad timing. If that happened, we logged "LOGIC BUG for enr=...", but still did not return an error. The rest ...
```diff diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c index 742b2908ff68..b3dbf6c76e98 100644 --- a/drivers/block/drbd/drbd_actlog.c +++ b/drivers/block/drbd/drbd_actlog.c @@ -483,38 +483,20 @@ void drbd_al_begin_io(struct drbd_device *device, struct drbd_interval *i) int drbd_al_b...
6c2e331c915ba9e774aa847921262805feb00863
Analyze and fix the following issue in the Linux kernel code: drm/xe/wa: Steer RMW of MCR registers while building default LRC
Problem Details: When generating the default LRC, if a register is not masked, we apply any save-restore programming necessary via a read-modify-write sequence that will ensure we only update the relevant bits/fields without clobbering the rest of the register. However some of the registers that need to be updated mig...
```diff diff --git a/drivers/gpu/drm/xe/regs/xe_engine_regs.h b/drivers/gpu/drm/xe/regs/xe_engine_regs.h index 68172b0248a6..dc5a4fafa70c 100644 --- a/drivers/gpu/drm/xe/regs/xe_engine_regs.h +++ b/drivers/gpu/drm/xe/regs/xe_engine_regs.h @@ -96,6 +96,12 @@ #define ENABLE_SEMAPHORE_POLL_BIT REG_BIT(13) #define R...
7b821da55b3f88c1703ff2c2074d182295a84f6b
Analyze and fix the following issue in the Linux kernel code: rds: tcp: fix uninit-value in __inet_bind
Problem Details: KMSAN reported an uninit-value access in __inet_bind() when binding an RDS TCP socket. The uninitialized memory originates from rds_tcp_conn_alloc(), which uses kmem_cache_alloc() to allocate the rds_tcp_connection structure. Specifically, the field 't_client_port_group' is incremented in rds_tcp_con...
```diff diff --git a/net/rds/tcp.c b/net/rds/tcp.c index 45484a93d75f..04f310255692 100644 --- a/net/rds/tcp.c +++ b/net/rds/tcp.c @@ -373,7 +373,7 @@ static int rds_tcp_conn_alloc(struct rds_connection *conn, gfp_t gfp) int ret = 0; for (i = 0; i < RDS_MPATH_WORKERS; i++) { - tc = kmem_cache_alloc(rds_tcp_conn_...
6bf45704a92a128a8bfb2dd4d550c61b257c8f9a
Analyze and fix the following issue in the Linux kernel code: net/rds: Fix NULL pointer dereference in rds_tcp_accept_one
Problem Details: Save a local pointer to new_sock->sk and hold a reference before installing callbacks in rds_tcp_accept_one. After rds_tcp_set_callbacks() or rds_tcp_reset_callbacks(), tc->t_sock is set to new_sock which may race with the shutdown path. A concurrent rds_tcp_conn_path_shutdown() may call sock_release(...
```diff diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c index 6fb5c928b8fd..b4ab68a1da6d 100644 --- a/net/rds/tcp_listen.c +++ b/net/rds/tcp_listen.c @@ -177,6 +177,7 @@ int rds_tcp_accept_one(struct rds_tcp_net *rtn) struct rds_tcp_connection *rs_tcp = NULL; int conn_state; struct rds_conn_path *cp; + s...
123d2e75a14e8a21cecac3f3452221ba901f8111
Analyze and fix the following issue in the Linux kernel code: s390/tape: Fix device driver name
Problem Details: Recent cleanups and code consolidations in the s390 tape device driver renamed files and function namespaces from tape_34xx to tape_3490 to better reflect the single support of the IBM 3490E device in the codebase. These changes also renamed the driver name to tape_3490, which consequently broke users...
```diff diff --git a/drivers/s390/char/tape_3490.c b/drivers/s390/char/tape_3490.c index c4ea32af1b65..7302f1121553 100644 --- a/drivers/s390/char/tape_3490.c +++ b/drivers/s390/char/tape_3490.c @@ -784,7 +784,7 @@ tape_3490_online(struct ccw_device *cdev) static struct ccw_driver tape_3490_driver = { .driver = { ...
42a6bd57ee9f930a72c26f863c72f666d6ed9ea5
Analyze and fix the following issue in the Linux kernel code: io_uring: add IORING_OP_URING_CMD128 to opcode checks
Problem Details: io_should_commit(), io_uring_classic_poll(), and io_do_iopoll() compare struct io_kiocb's opcode against IORING_OP_URING_CMD to implement special treatment for uring_cmds. The recently added opcode IORING_OP_URING_CMD128 is meant to be equivalent to IORING_OP_URING_CMD, so treat it the same way in thes...
```diff diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h index 503663d6fd6d..0fa844faf287 100644 --- a/io_uring/io_uring.h +++ b/io_uring/io_uring.h @@ -530,6 +530,12 @@ static inline bool io_file_can_poll(struct io_kiocb *req) return false; } +static inline bool io_is_uring_cmd(const struct io_kiocb *req) +...
f08fe8891c3eeb63b73f9f1f6d97aa629c821579
Analyze and fix the following issue in the Linux kernel code: dcache: Limit the minimal number of bucket to two
Problem Details: There is an OOB read problem on dentry_hashtable when user sets 'dhash_entries=1': BUG: unable to handle page fault for address: ffff888b30b774b0 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page Oops: Oops: 0000 [#1] SMP PTI RIP: 0010:__d_lookup+0x56/0x120...
```diff diff --git a/fs/dcache.c b/fs/dcache.c index 7ba1801d8132..24f4f3acaa8c 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -3257,7 +3257,7 @@ static void __init dcache_init_early(void) HASH_EARLY | HASH_ZERO, &d_hash_shift, NULL, - 0, + 2, 0); d_hash_shift = 32 - d_hash_shift; @@ ...
29cc0f3aa7c64d3b3cb9d94c0a0984ba6717bf72
Analyze and fix the following issue in the Linux kernel code: arm64: Force the use of CNTVCT_EL0 in __delay()
Problem Details: Quentin forwards a report from Hyesoo Yu, describing an interesting problem with the use of WFxT in __delay() when a vcpu is loaded and that KVM is *not* in VHE mode (either nVHE or hVHE). In this case, CNTVOFF_EL2 is set to a non-zero value to reflect the state of the guest virtual counter. At the sa...
```diff diff --git a/arch/arm64/lib/delay.c b/arch/arm64/lib/delay.c index cb2062e7e234..d02341303899 100644 --- a/arch/arm64/lib/delay.c +++ b/arch/arm64/lib/delay.c @@ -23,9 +23,20 @@ static inline unsigned long xloops_to_cycles(unsigned long xloops) return (xloops * loops_per_jiffy * HZ) >> 32; } +/* + * Force ...
0783052534f547f8f201dd4554b1df9f1f8615b5
Analyze and fix the following issue in the Linux kernel code: ASoC: rockchip: i2s-tdm: Use param rate if not provided by set_sysclk
Problem Details: Drivers will not always call set_sysclk() for all clocks, especially when default mclk-fs can be used. When that is the case, use the clock rate set in the params multiplied by the default mclk-fs. Fixes: 5323186e2e8d ("ASoC: rockchip: i2s_tdm: Re-add the set_sysclk callback") Signed-off-by: Detlev Ca...
```diff diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c index 770b9bfbb384..fc52149ed6ae 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -22,6 +22,7 @@ #define DRV_NAME "rockchip-i2s-tdm" +#define DEFAULT_MCLK_FS 256 #...
621609f1e5ca43a75edd497dd1c28bd84aa66433
Analyze and fix the following issue in the Linux kernel code: rust: irq: add `'static` bounds to irq callbacks
Problem Details: These callback functions take a generic `T` that is used in the body as the generic argument in `Registration` and `ThreadedRegistration`. Those types require `T: 'static`, but due to a compiler bug this requirement isn't propagated to the function. Thus add the bound. This was caught in the upstream R...
```diff diff --git a/rust/kernel/irq/request.rs b/rust/kernel/irq/request.rs index b150563fdef8..2ceeaeb0543a 100644 --- a/rust/kernel/irq/request.rs +++ b/rust/kernel/irq/request.rs @@ -261,7 +261,10 @@ impl<T: Handler + 'static> Registration<T> { /// # Safety /// /// This function should be only used as the callba...
294f54f849d846f4643a67db9b41b63867dc8bfe
Analyze and fix the following issue in the Linux kernel code: fserror: fix lockdep complaint when igrabbing inode
Problem Details: Christoph Hellwig reported a lockdep splat in generic/108: ================================ WARNING: inconsistent lock state 6.19.0+ #4827 Tainted: G N -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. swapper/1/0 [HC1[1]:SC0[0]:HE0:SE1] takes:...
```diff diff --git a/fs/iomap/ioend.c b/fs/iomap/ioend.c index e4d57cb969f1..4d1ef8a2cee9 100644 --- a/fs/iomap/ioend.c +++ b/fs/iomap/ioend.c @@ -69,11 +69,57 @@ static u32 iomap_finish_ioend_buffered(struct iomap_ioend *ioend) return folio_count; } +static DEFINE_SPINLOCK(failed_ioend_lock); +static LIST_HEAD(fa...
84fa9532c66a58dc76fa2d4d2ea5e0034871111b
Analyze and fix the following issue in the Linux kernel code: drm/i915/dp_mst: Fix ww mutex lock failure in for_each_joiner_candidate() loop
Problem Details: Handle modeset WW mutex lock failures due to contention properly. Return -EDEADLK to the caller instead of attempting to lock the same mutex again in a subsequent joiner candidate iteration, where the WW mutex is already in a contended state. This fixes the following warning: WARNING: drivers/gpu/drm...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index f833f4764327..94c023142664 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -729,7 +729,7 @@ static int mst_stream_compute_config(struct intel...
c860076ea9b56032dd31c0a5560bba45637e4264
Analyze and fix the following issue in the Linux kernel code: drm/i915/dp: Fix ww mutex lock failure in for_each_joiner_candidate() loop
Problem Details: Handle modeset WW mutex lock failures due to contention properly. Return -EDEADLK to the caller instead of attempting to lock the same mutex again in a subsequent joiner candidate iteration, where the WW mutex is already in a contended state. This fixes the following warning: WARNING: drivers/gpu/drm...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 454e6144ee4e..025e906b63a9 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -2969,7 +2969,7 @@ intel_dp_compute_link_config(struct intel_encoder *encoder, ...
45be47bf5d7db0f762a93e9c0ede6cb3c91edf3b
Analyze and fix the following issue in the Linux kernel code: octeontx2-af: Fix default entries mcam entry action
Problem Details: As per design, AF should update the default MCAM action only when mcam_index is -1. A bug in the previous patch caused default entries to be changed even when the request was not for them. Fixes: 570ba37898ec ("octeontx2-af: Update RSS algorithm index") Signed-off-by: Hariprasad Kelam <hkelam@marvell....
```diff diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index c7c70429eb6c..8658cb2143df 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c @@ -1042,32 +1042,35 @@ void rvu_npc_...
0da1dba72616b178a64a762a235a24e9899e495d
Analyze and fix the following issue in the Linux kernel code: net/mlx5e: XSK, Fix unintended ICOSQ change
Problem Details: XSK wakeup must use the async ICOSQ (with proper locking), as it is not guaranteed to run on the same CPU as the channel. The commit that converted the NAPI trigger path to use the sync ICOSQ incorrectly applied the same change to XSK, causing XSK wakeups to use the sync ICOSQ as well. Revert XSK flow...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h index a7de3a3efc49..19fce51117c9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h @@ -1103,6 +1103,7 @@ int mlx5e_open_locked(struct net_device *ne...
0201eedb69b24a6be9b7c1716287a89c4dde2320
Analyze and fix the following issue in the Linux kernel code: ipv6: icmp: remove obsolete code in icmpv6_xrlim_allow()
Problem Details: Following part was needed before the blamed commit, because inet_getpeer_v6() second argument was the prefix. /* Give more bandwidth to wider prefixes. */ if (rt->rt6i_dst.plen < 128) tmo >>= ((128 - rt->rt6i_dst.plen)>>5); Now inet_getpeer_v6() retrieves hosts, we need to remove @tmo adjustement...
```diff diff --git a/Documentation/networking/ip-sysctl.rst b/Documentation/networking/ip-sysctl.rst index 28c7e4f5ecf9..6921d8594b84 100644 --- a/Documentation/networking/ip-sysctl.rst +++ b/Documentation/networking/ip-sysctl.rst @@ -3234,12 +3234,13 @@ enhanced_dad - BOOLEAN =========== ratelimit - INTEGER - Limi...
87b08913a9ae82082e276d237ece08fc8ee24380
Analyze and fix the following issue in the Linux kernel code: inet: move icmp_global_{credit,stamp} to a separate cache line
Problem Details: icmp_global_credit was meant to be changed ~1000 times per second, but if an admin sets net.ipv4.icmp_msgs_per_sec to a very high value, icmp_global_credit changes can inflict false sharing to surrounding fields that are read mostly. Move icmp_global_credit and icmp_global_stamp to a separate cachelin...
```diff diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 2dbd46fc4734..8e971c7bf164 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h @@ -88,6 +88,12 @@ struct netns_ipv4 { int sysctl_tcp_rcvbuf_low_rtt; __cacheline_group_end(netns_ipv4_read_rx); + /* ICMP rate limiter hot...
034bbd806298e9ba4197dd1587b0348ee30996ea
Analyze and fix the following issue in the Linux kernel code: icmp: prevent possible overflow in icmp_global_allow()
Problem Details: Following expression can overflow if sysctl_icmp_msgs_per_sec is big enough. sysctl_icmp_msgs_per_sec * delta / HZ; Fixes: 4cdf507d5452 ("icmp: add a global rate limitation") Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid...
```diff diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index e216b6df6331..eff8487c0aba 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -250,7 +250,8 @@ bool icmp_global_allow(struct net *net) if (delta < HZ / 50) return false; - incr = READ_ONCE(net->ipv4.sysctl_icmp_msgs_per_sec) * delta / HZ; + incr = R...
570e4549f63293ca4973ef367ff02554f3e3dfc2
Analyze and fix the following issue in the Linux kernel code: selftests/net: packetdrill: add ipv4-mapped-ipv6 tests
Problem Details: Add ipv4-mapped-ipv6 case to ksft_runner.sh before an upcoming TCP fix in this area. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://patch.msgid.link/20260217142924.1853498-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kern...
```diff diff --git a/tools/testing/selftests/net/packetdrill/ksft_runner.sh b/tools/testing/selftests/net/packetdrill/ksft_runner.sh index b34e5cf0112e..0a97d5ae3469 100755 --- a/tools/testing/selftests/net/packetdrill/ksft_runner.sh +++ b/tools/testing/selftests/net/packetdrill/ksft_runner.sh @@ -13,6 +13,15 @@ declar...
705d01c8d78121ee1634bfc602ac4b0ad1438fab
Analyze and fix the following issue in the Linux kernel code: x86/hyperv: Fix error pointer dereference
Problem Details: The function idle_thread_get() can return an error pointer and is not checked for it. Add check for error pointer. Detected by Smatch: arch/x86/hyperv/hv_vtl.c:126 hv_vtl_bringup_vcpu() error: 'idle' dereferencing possible ERR_PTR() Fixes: 2b4b90e053a29 ("x86/hyperv: Use per cpu initial stack for vtl...
```diff diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c index c0edaed0efb3..9b6a9bc4ab76 100644 --- a/arch/x86/hyperv/hv_vtl.c +++ b/arch/x86/hyperv/hv_vtl.c @@ -110,7 +110,7 @@ static void hv_vtl_ap_entry(void) static int hv_vtl_bringup_vcpu(u32 target_vp_index, int cpu, u64 eip_ignored) { - u64 s...
fe9f15983c4823a8473e289b4a302946a4864ef5
Analyze and fix the following issue in the Linux kernel code: x86/hyperv: Reserve 3 interrupt vectors used exclusively by MSHV
Problem Details: MSVC compiler, used to compile the Microsoft Hypervisor, currently has an assert intrinsic that uses interrupt vector 0x29 to create an exception. This will cause hypervisor to then crash and collect core. As such, if this interrupt number is assigned to a device by Linux and the device generates it, h...
```diff diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 579fb2c64cfd..89a2eb8a0722 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -478,6 +478,28 @@ int hv_get_hypervisor_version(union hv_hypervisor_version_info *info) } EXPORT_SYMBOL_GPL(hv_get_h...
1e5c009126952f673ffa2427acbd69e57493f0d2
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Remove hexdump dependency
Problem Details: The verification signature header generation requires converting a binary certificate to a C array. Previously this only worked with xxd, and a switch to hexdump has been done in commit b640d556a2b3 ("selftests/bpf: Remove xxd util dependency"). hexdump is a more common utility program, yet it might n...
```diff diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index c6bf4dfb1495..6776158f1f3e 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -723,7 +723,7 @@ $(VERIFICATION_CERT) $(PRIVATE_KEY): $(VERIFY_SIG_SETUP) # Generates a heade...
7be41fb00e2c2a823f271a8318b453ca11812f1e
Analyze and fix the following issue in the Linux kernel code: accel: ethosu: Fix shift overflow in cmd_to_addr()
Problem Details: The "((cmd[0] & 0xff0000) << 16)" shift is zero. This was intended to be (((u64)cmd[0] & 0xff0000) << 16). Move the cast to the correct location. Fixes: 5a5e9c0228e6 ("accel: Add Arm Ethos-U NPU driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/aQGmY64tW...
```diff diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c index 473b5f5d7514..7b073116314b 100644 --- a/drivers/accel/ethosu/ethosu_gem.c +++ b/drivers/accel/ethosu/ethosu_gem.c @@ -154,7 +154,7 @@ static void cmd_state_init(struct cmd_state *st) static u64 cmd_to_addr(u32 *cmd) { -...
beeebffc807531f69445356180238500f56951cc
Analyze and fix the following issue in the Linux kernel code: lib/crypto: powerpc/aes: Fix rndkey_from_vsx() on big endian CPUs
Problem Details: I finally got a big endian PPC64 kernel to boot in QEMU. The PPC64 VSX optimized AES library code does work in that case, with the exception of rndkey_from_vsx() which doesn't take into account that the order in which the VSX code stores the round key words depends on the endianness. So fix rndkey_fro...
```diff diff --git a/lib/crypto/powerpc/aes.h b/lib/crypto/powerpc/aes.h index 42e0a993c619..5a36b637e6b9 100644 --- a/lib/crypto/powerpc/aes.h +++ b/lib/crypto/powerpc/aes.h @@ -95,7 +95,8 @@ static inline bool is_vsx_format(const struct p8_aes_key *key) } /* - * Convert a round key from VSX to generic format by r...
08020dbe3125e936429e7966bf072e08fa964f36
Analyze and fix the following issue in the Linux kernel code: apparmor: fix signedness bug in unpack_tags()
Problem Details: Smatch static checker warning: security/apparmor/policy_unpack.c:966 unpack_pdb() warn: unsigned 'unpack_tags(e, &pdb->tags, info)' is never less than zero. unpack_tags() is declared with return type size_t (unsigned) but returns negative errno values on failure. The caller in unpack_pdb() tes...
```diff diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index e68adf39771f..dc908e1f5a88 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -835,7 +835,7 @@ fail_reset: } -static size_t unpack_tags(struct aa_ext *e, struct aa_tags_struct *ta...
003049b1c4fb8aabb93febb7d1e49004f6ad653b
Analyze and fix the following issue in the Linux kernel code: io_uring/zcrx: fix user_ref race between scrub and refill paths
Problem Details: The io_zcrx_put_niov_uref() function uses a non-atomic check-then-decrement pattern (atomic_read followed by separate atomic_dec) to manipulate user_refs. This is serialized against other callers by rq_lock, but io_zcrx_scrub() modifies the same counter with atomic_xchg() WITHOUT holding rq_lock. On S...
```diff diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index 28150c6578e3..97984a73a95d 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -349,10 +349,14 @@ static inline atomic_t *io_get_user_counter(struct net_iov *niov) static bool io_zcrx_put_niov_uref(struct net_iov *niov) { atomic_t *uref = io_get_user_co...
80ca113671a005430207d351cb403c1637106212
Analyze and fix the following issue in the Linux kernel code: ASoC: dt-bindings: asahi-kasei,ak5558: Fix the supply names
Problem Details: In the original txt format binding document ak4458.txt, the supply names are 'AVDD-supply', 'DVDD-supply', and they are also used in driver. But in the commit converting to yaml format, they are changed to 'avdd-supply', 'dvdd-supply'. After search all the dts file, these names 'AVDD-supply', 'DVDD-sup...
```diff diff --git a/Documentation/devicetree/bindings/sound/asahi-kasei,ak5558.yaml b/Documentation/devicetree/bindings/sound/asahi-kasei,ak5558.yaml index 5c2f131c86c3..18919d9112a3 100644 --- a/Documentation/devicetree/bindings/sound/asahi-kasei,ak5558.yaml +++ b/Documentation/devicetree/bindings/sound/asahi-kasei,a...
e570a5ca307f6d7a6acd080fc219db2ce3c0737b
Analyze and fix the following issue in the Linux kernel code: ASoC: dt-bindings: asahi-kasei,ak4458: Fix the supply names
Problem Details: In the original txt format binding document ak4458.txt, the supply names are 'AVDD-supply', 'DVDD-supply', and they are also used in driver. But in the commit converting to yaml format, they are changed to 'avdd-supply', 'dvdd-supply'. After search all the dts file, these names 'AVDD-supply', 'DVDD-sup...
```diff diff --git a/Documentation/devicetree/bindings/sound/asahi-kasei,ak4458.yaml b/Documentation/devicetree/bindings/sound/asahi-kasei,ak4458.yaml index 259e97b7a3c0..3a3313ea0890 100644 --- a/Documentation/devicetree/bindings/sound/asahi-kasei,ak4458.yaml +++ b/Documentation/devicetree/bindings/sound/asahi-kasei,a...
50a634f1d795721ce68583c78ba493f1d7aa8bc2
Analyze and fix the following issue in the Linux kernel code: ASoC: dt-bindings: asahi-kasei,ak4458: set unevaluatedProperties:false
Problem Details: When including the dai-common.yaml, and allow '#sound-dai-cells' and "sound-name-prefix' to be used, should use unevaluatedProperties:false according to writing-bindings.rst. Fixes: 8d7de4a014f5 ("ASoC: dt-bindings: asahi-kasei,ak4458: Reference common DAI properties") Cc: stable@vger.kernel.org Signe...
```diff diff --git a/Documentation/devicetree/bindings/sound/asahi-kasei,ak4458.yaml b/Documentation/devicetree/bindings/sound/asahi-kasei,ak4458.yaml index 1fdbeecc5eff..259e97b7a3c0 100644 --- a/Documentation/devicetree/bindings/sound/asahi-kasei,ak4458.yaml +++ b/Documentation/devicetree/bindings/sound/asahi-kasei,a...
625be3456b3ced6e2dca6166962c0cf6cc2e546d
Analyze and fix the following issue in the Linux kernel code: tools/sched_ext: scx_pair: fix stride == 0 crash on single-CPU systems
Problem Details: nr_cpu_ids / 2 produces stride 0 on a single-CPU system, which later causes SCX_BUG_ON(i == j) to fire. Validate stride after option parsing to also catch invalid user-supplied values via -S. Signed-off-by: David Carlier <devnexen@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
```diff diff --git a/tools/sched_ext/scx_pair.c b/tools/sched_ext/scx_pair.c index d3e97faa6334..2a82d8a8a0aa 100644 --- a/tools/sched_ext/scx_pair.c +++ b/tools/sched_ext/scx_pair.c @@ -56,7 +56,6 @@ restart: skel = SCX_OPS_OPEN(pair_ops, scx_pair); skel->rodata->nr_cpu_ids = libbpf_num_possible_cpus(); - assert...
55a24d9203979d1cd0196ba1d189860e8b828c2e
Analyze and fix the following issue in the Linux kernel code: tools/sched_ext: scx_central: fix CPU_SET and skeleton leak on early exit
Problem Details: Use CPU_SET_S() instead of CPU_SET() on the dynamically allocated cpuset to avoid a potential out-of-bounds write when nr_cpu_ids exceeds CPU_SETSIZE. Also destroy the skeleton before returning on invalid central CPU ID to prevent a resource leak. Signed-off-by: David Carlier <devnexen@gmail.com> Sig...
```diff diff --git a/tools/sched_ext/scx_central.c b/tools/sched_ext/scx_central.c index a6dfd45de70c..39f21b00a208 100644 --- a/tools/sched_ext/scx_central.c +++ b/tools/sched_ext/scx_central.c @@ -74,6 +74,7 @@ restart: u32 central_cpu = strtoul(optarg, NULL, 0); if (central_cpu >= skel->rodata->nr_cpu_ids) {...
17ff034f805e032ed1358624a71381f9d6e29e9e
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Only use analog stream encoder with analog engine
Problem Details: Some GPUs have analog connectors that work with a DP bridge chip and don't actually have an internal DAC: Those should not use the analog stream encoders. Fixes: 5834c33fd3f6 ("drm/amd/display: Add concept of analog encoders (v2)") Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Al...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c index 864634e14de1..f49d67fcafe0 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dce100/dce...
f402898bd101af3166bde236b7f6a43d926e17a0
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Only use analog link encoder with analog engine
Problem Details: Some GPUs have analog connectors that work with a DP bridge chip and don't actually have an internal DAC: Those should not use the analog link encoder code path. Fixes: 0fbe321a93ce ("drm/amd/display: Implement DCE analog link encoders (v2)") Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Revi...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c index a929e64524e5..864634e14de1 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dce100/dce...