id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
03cc84b102d1a832e8dfc59344346dedcebcdf42
Analyze and fix the following issue in the Linux kernel code: drm/amd/pm: fix BUG: scheduling while atomic
Problem Details: atomic scheduling will be triggered in interrupt handler for AC/DC mode switch as following backtrace. Call Trace: <IRQ> dump_stack_lvl __schedule_bug __schedule schedule schedule_preempt_disabled __mutex_lock smu_cmn_send_smc_msg_with_param smu_v13_0_irq_process amdgpu_irq_dispatch amdgpu_i...
```diff diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h index ae3563d71fa0..356d9422b411 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h +++ b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h @@ -303,5 +303,7 @@ int smu_v13_0_set_wbrf_exclusion_ranges(struc...
9095567bc31bd404be54b0616bdb705011ee2cd9
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: Fix error handling in amdgpu_ras_add_bad_pages
Problem Details: It ensures that appropriate error codes are returned when an error condition is detected Fixes the below; drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:2849 amdgpu_ras_add_bad_pages() warn: missing error code here? 'amdgpu_umc_pages_in_a_row()' failed. drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:2884 amdgpu_ras...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index 01c947066a2e..f0924aa3f4e4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c @@ -2832,8 +2832,10 @@ int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev, m...
2774ef7625adb5fb9e9265c26a59dca7b8fd171e
Analyze and fix the following issue in the Linux kernel code: drm/amdkfd: wq_release signals dma_fence only when available
Problem Details: kfd_process_wq_release() signals eviction fence by dma_fence_signal() which wanrs if dma_fence is NULL. kfd_process->ef is initialized by kfd_process_device_init_vm() through ioctl. That means the fence is NULL for a new created kfd_process, and close a kfd_process right after open it will trigger the...
```diff diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c index 0976b5b0e8e8..083f83c94531 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c @@ -1160,7 +1160,8 @@ static void kfd_process_wq_release(struct work_struct *work...
62bf9fe6fab01a3f7355931fd9472b3d3ef6a3b2
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: Fix for MEC SJT FW Load Fail on VF
Problem Details: Users might switch to ROCM build does not include MEC SJT FW and driver needs to consider this case.w Signed-off-by: yfeng1 <yfeng1@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c index a5bdcaf7a081..2ba185875baa 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c @@ -579,11 +579,16 @@ static int gfx_v9_4_3_init_cp_compute_microcode(struct amdgpu_d...
da968c3ce459442e83b021d73417b9402c8b14c5
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Promote DC to 3.2.315
Problem Details: This version brings along the following: - Add Interface to Dump DSC Caps from dm - Add DP required HBlank size calc to link interface - Add 6bpc RGB case for dcn32 output bpp calculations - Add VC for VESA Aux Backlight Control - Add support for setting multiple CRC windows in dc - Clean up SPL code a...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h index 5b32c447da98..5fb15c6315a4 100644 --- a/drivers/gpu/drm/amd/display/dc/dc.h +++ b/drivers/gpu/drm/amd/display/dc/dc.h @@ -55,7 +55,7 @@ struct aux_payload; struct set_config_cmd_payload; struct dmub_notification; -#...
f765e7ce0417f8dc38479b4b495047c397c16902
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Fix PSR-SU not support but still call the amdgpu_dm_psr_enable
Problem Details: [Why] The enum DC_PSR_VERSION_SU_1 of psr_version is 1 and DC_PSR_VERSION_UNSUPPORTED is 0xFFFFFFFF. The original code may has chance trigger the amdgpu_dm_psr_enable() while psr version is set to DC_PSR_VERSION_UNSUPPORTED. [How] Modify the condition to psr->psr_version == DC_PSR_VERSION_SU_1 Revie...
```diff diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index a8933612966b..0bbe8c454922 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -8931,7 +8931,7 @@ static void amdgpu_dm_e...
de5d7a8802eac4e22ed95d2d959907ebc4aad3ac
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: fix init_adj offset for cositing in SPL
Problem Details: [Why & How] init_adj offset is applied when cosited not interstitial Adjust cositing offset in SPL Reviewed-by: Jun Lei <jun.lei@amd.com> Signed-off-by: Samson Tam <Samson.Tam@amd.com> Signed-off-by: Roman Li <roman.li@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deu...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c index d75f8da63e10..c6ed0b921523 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn...
5b231f5bc9ff02ec5737f2ec95cdf15ac95088e9
Analyze and fix the following issue in the Linux kernel code: drm/amdkfd: fixed page fault when enable MES shader debugger
Problem Details: Initialize the process context address before setting the shader debugger. [ 260.781212] amdgpu 0000:03:00.0: amdgpu: [gfxhub] page fault (src_id:0 ring:32 vmid:0 pasid:0) [ 260.781236] amdgpu 0000:03:00.0: amdgpu: in page starting at address 0x0000000000000000 from client 10 [ 260.781255] amdgpu...
```diff diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c index 312dfa84f29f..a8abc3091801 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c @@ -350,10 +350,27 @@ int kfd_dbg_set_mes_debug_mode(struct kfd_process_device *pdd, bool...
e4975ac5353395978a7dc49a656adbe6ef9ad063
Analyze and fix the following issue in the Linux kernel code: sched_ext: update scx_bpf_dsq_insert() doc for SCX_DSQ_LOCAL_ON
Problem Details: With commit 5b26f7b920f7 ("sched_ext: Allow SCX_DSQ_LOCAL_ON for direct dispatches"), scx_bpf_dsq_insert() can use SCX_DSQ_LOCAL_ON for direct dispatch from ops.enqueue() to target the local DSQ of any CPU. Update the documentation accordingly. Fixes: 5b26f7b920f7 ("sched_ext: Allow SCX_DSQ_LOCAL_ON ...
```diff diff --git a/Documentation/scheduler/sched-ext.rst b/Documentation/scheduler/sched-ext.rst index 6cb8b676ce03..a8ceaad63b6a 100644 --- a/Documentation/scheduler/sched-ext.rst +++ b/Documentation/scheduler/sched-ext.rst @@ -242,9 +242,9 @@ The following briefly shows how a waking task is scheduled and executed. ...
143981aa63f33d469a55a55fd9fb81cd90109672
Analyze and fix the following issue in the Linux kernel code: watchdog: rti_wdt: Fix an OF node leak in rti_wdt_probe()
Problem Details: rti_wdt_probe() does not release the OF node reference obtained by of_parse_phandle(). Add a of_node_put() call. This was found by an experimental verification tool that I am developing. Due to the lack of the actual device, no runtime test was able to be performed. Fixes: f20ca595ae23 ("watchdog:rit...
```diff diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c index e01dd1c13e2c..d1f9ce4100a8 100644 --- a/drivers/watchdog/rti_wdt.c +++ b/drivers/watchdog/rti_wdt.c @@ -302,6 +302,7 @@ static int rti_wdt_probe(struct platform_device *pdev) node = of_parse_phandle(pdev->dev.of_node, "memory-region", ...
7da5fc3408f3165e8a7dfb0d15b934aa3531082a
Analyze and fix the following issue in the Linux kernel code: watchdog: max77620: fix excess field in kerneldoc
Problem Details: The wdt_info does not exist in the struct being documented. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202412281555.YMBF9azh-lkp@intel.com/ Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: h...
```diff diff --git a/drivers/watchdog/max77620_wdt.c b/drivers/watchdog/max77620_wdt.c index 33835c0b06de..d3ced783a5f4 100644 --- a/drivers/watchdog/max77620_wdt.c +++ b/drivers/watchdog/max77620_wdt.c @@ -25,7 +25,6 @@ static bool nowayout = WATCHDOG_NOWAYOUT; /** * struct max77620_variant - Data specific to a c...
3322d53fdab8eedf01a9bca45dbf010566922e3c
Analyze and fix the following issue in the Linux kernel code: watchdog: sp805: Report correct timeleft at maximum
Problem Details: sp805_wdt::load_val is of type unsigned int. When the interrupt is inactive wdt_timeleft adds one to the value, and then adds that to the value used to calculate the time remaining. Unfortunately it's not unlikely that load_val contains LOAD_MAX, which is 0xFFFFFFFF and wraps to zero when one is added ...
```diff diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c index 109e2e37e8f0..4400c439c718 100644 --- a/drivers/watchdog/sp805_wdt.c +++ b/drivers/watchdog/sp805_wdt.c @@ -128,7 +128,7 @@ static unsigned int wdt_timeleft(struct watchdog_device *wdd) /*If the interrupt is inactive then time le...
6a569e299f2be13e5e0f487930455b55a9cb4874
Analyze and fix the following issue in the Linux kernel code: watchdog: rti: Fix off-by-one in heartbeat recovery
Problem Details: According to AM62x TRM WDT period is (RTIDWDPRLD + 1) * (2^13) / RTICLK1, Fix the heartbeat recovery. In practice this doesn't affect rounded heatbeat in seconds, but it does correct 4% of error in milliseconds, for, say, default 60s heartbeat. This affects last_ping calculation. Signed-off-by: Alexan...
```diff diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c index 58c9445c0f88..e01dd1c13e2c 100644 --- a/drivers/watchdog/rti_wdt.c +++ b/drivers/watchdog/rti_wdt.c @@ -273,7 +273,8 @@ static int rti_wdt_probe(struct platform_device *pdev) set_bit(WDOG_HW_RUNNING, &wdd->status); time_left_ms =...
0ee4736c003daded513de0ff112d4a1e9c85bbab
Analyze and fix the following issue in the Linux kernel code: btrfs: zlib: fix avail_in bytes for s390 zlib HW compression path
Problem Details: Since the input data length passed to zlib_compress_folios() can be arbitrary, always setting strm.avail_in to a multiple of PAGE_SIZE may cause read-in bytes to exceed the input range. Currently this triggers an assert in btrfs_compress_folios() on the debug kernel (see below). Fix strm.avail_in calcu...
```diff diff --git a/fs/btrfs/zlib.c b/fs/btrfs/zlib.c index ddf0d5a448a7..c9e92c6941ec 100644 --- a/fs/btrfs/zlib.c +++ b/fs/btrfs/zlib.c @@ -174,10 +174,10 @@ int zlib_compress_folios(struct list_head *ws, struct address_space *mapping, copy_page(workspace->buf + i * PAGE_SIZE, data_in); start +=...
7467bc5959bf02ef5210ea7e7948e548565c799c
Analyze and fix the following issue in the Linux kernel code: btrfs: zoned: calculate max_extent_size properly on non-zoned setup
Problem Details: Since commit 559218d43ec9 ("block: pre-calculate max_zone_append_sectors"), queue_limits's max_zone_append_sectors is default to be 0 and it is only updated when there is a zoned device. So, we have lim->max_zone_append_sectors = 0 when there is no zoned device in the filesystem. That leads to fs_info...
```diff diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index cb32966380f5..5f9d3be1234a 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -745,8 +745,9 @@ int btrfs_check_zoned_mode(struct btrfs_fs_info *fs_info) (u64)lim->max_segments << PAGE_SHIFT), fs_info->sectorsize); fs_info->fs_devices->chun...
6aecd91a5c5b68939cf4169e32bc49f3cd2dd329
Analyze and fix the following issue in the Linux kernel code: btrfs: avoid NULL pointer dereference if no valid extent tree
Problem Details: [BUG] Syzbot reported a crash with the following call trace: BTRFS info (device loop0): scrub: started on devid 1 BUG: kernel NULL pointer dereference, address: 0000000000000208 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 106e70067 P4D 106e70067 ...
```diff diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 204c928beaf9..531312efee8d 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -1541,6 +1541,10 @@ static int scrub_find_fill_first_stripe(struct btrfs_block_group *bg, u64 extent_gen; int ret; + if (unlikely(!extent_root)) { + btrfs_err(fs_info,...
e021e6cbfb5a695968afb6619828929a97e4a83a
Analyze and fix the following issue in the Linux kernel code: vfio/pci: Expose setup ROM at ROM bar when needed
Problem Details: If ROM bar is missing for any reason, we can fallback to using pdev->rom to expose the ROM content to the guest. This fixes some passthrough use cases where the upstream bridge does not have enough address window. Signed-off-by: Yunxiang Li <Yunxiang.Li@amd.com> Link: https://lore.kernel.org/r/2025010...
```diff diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c index e41c3a965663..4c673d842fb3 100644 --- a/drivers/vfio/pci/vfio_pci_config.c +++ b/drivers/vfio/pci/vfio_pci_config.c @@ -511,6 +511,10 @@ static void vfio_bar_fixup(struct vfio_pci_core_device *vdev) mask = ~(pci_resour...
c45beebfde34aa71afbc48b2c54cdda623515037
Analyze and fix the following issue in the Linux kernel code: ovl: support encoding fid from inode with no alias
Problem Details: Dmitry Safonov reported that a WARN_ON() assertion can be trigered by userspace when calling inotify_show_fdinfo() for an overlayfs watched inode, whose dentry aliases were discarded with drop_caches. The WARN_ON() assertion in inotify_show_fdinfo() was removed, because it is possible for encoding fil...
```diff diff --git a/fs/overlayfs/export.c b/fs/overlayfs/export.c index 036c9f39a14d..444aeeccb6da 100644 --- a/fs/overlayfs/export.c +++ b/fs/overlayfs/export.c @@ -176,35 +176,37 @@ static int ovl_connect_layer(struct dentry *dentry) * * Return 0 for upper file handle, > 0 for lower file handle or < 0 on error. ...
844b8cdc681612ff24df62cdefddeab5772fadf1
Analyze and fix the following issue in the Linux kernel code: nbd: don't allow reconnect after disconnect
Problem Details: Following process can cause nbd_config UAF: 1) grab nbd_config temporarily; 2) nbd_genl_disconnect() flush all recv_work() and release the initial reference: nbd_genl_disconnect nbd_disconnect_and_put nbd_disconnect flush_workqueue(nbd->recv_workq) if (test_and_clear_bit(NBD_RT_HAS...
```diff diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index b1a5af69a66d..259bd57fc529 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -2179,6 +2179,7 @@ static void nbd_disconnect_and_put(struct nbd_device *nbd) flush_workqueue(nbd->recv_workq); nbd_clear_que(nbd); nbd->task_setup = NULL; ...
2530766492ec7726582bcde44575ec3ff7487cd2
Analyze and fix the following issue in the Linux kernel code: nfsd: fix UAF when access ex_uuid or ex_stats
Problem Details: We can access exp->ex_stats or exp->ex_uuid in rcu context(c_show and e_show). All these resources should be released using kfree_rcu. Fix this by using call_rcu, clean them all after a rcu grace period. ================================================================== BUG: KASAN: slab-use-after-free...
```diff diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index c6168bccfb6c..0363720280d4 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -355,16 +355,25 @@ static void export_stats_destroy(struct export_stats *stats) EXP_STATS_COUNTERS_NUM); } -static void svc_export_put(struct kref *ref) +static ...
ce32496ec1abe866225f2e2005ceda68cf4c7bf4
Analyze and fix the following issue in the Linux kernel code: block: simplify tag allocation policy selection
Problem Details: Use a plain BLK_MQ_F_* flag to select the round robin tag selection instead of overlaying an enum with just two possible values into the flags space. Doing so allows adding a BLK_MQ_F_MAX sentinel for simplified overflow checking in the messy debugfs helpers. Signed-off-by: Christoph Hellwig <hch@lst...
```diff diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 64b3c333aa47..adf5f0697b6b 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -172,19 +172,13 @@ static int hctx_state_show(void *data, struct seq_file *m) return 0; } -#define BLK_TAG_ALLOC_NAME(name) [BLK_TAG_ALLOC_##name...
1b10f0b603c066d81327c163a23c19f01e112366
Analyze and fix the following issue in the Linux kernel code: SUNRPC: no need get cache ref when protected by rcu
Problem Details: rcu_read_lock/rcu_read_unlock has already provide protection for the pointer we will reference when we call c_show. Therefore, there is no need to obtain a cache reference to help protect cache_head. Additionally, the .put such as expkey_put/svc_export_put will invoke dput, which can sleep and break rc...
```diff diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index 88f42a27c8cc..cb279eb9ac4b 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c @@ -1438,17 +1438,11 @@ static int c_show(struct seq_file *m, void *p) seq_printf(m, "# expiry=%lld refcnt=%d flags=%lx\n", convert_to_wallclock(cp->expiry_tim...
c224edca7af028828e2ad866b61d731b5e72b46d
Analyze and fix the following issue in the Linux kernel code: nfsd: no need get cache ref when protected by rcu
Problem Details: rcu_read_lock/rcu_read_unlock has already provide protection for the pointer we will reference when we call e_show. Therefore, there is no need to obtain a cache reference to help protect cache_head. Additionally, the .put such as expkey_put/svc_export_put will invoke dput, which can sleep and break rc...
```diff diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index aa4712362b3b..c6168bccfb6c 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -1425,13 +1425,9 @@ static int e_show(struct seq_file *m, void *p) return 0; } - if (!cache_get_rcu(&exp->h)) + if (cache_check_rcu(cd, &exp->h, NULL)) return 0; ...
1b3e26a5ccbfc2f85bda1930cc278e313165e353
Analyze and fix the following issue in the Linux kernel code: NFSD: fix decoding in nfs4_xdr_dec_cb_getattr
Problem Details: If a client were to send an error to a CB_GETATTR call, the code erronously continues to try decode past the error code. It ends up returning BAD_XDR error to the rpc layer and then in turn trigger a WARN_ONCE in nfsd4_cb_done() function. Fixes: 6487a13b5c6b ("NFSD: add support for CB_GETATTR callback...
```diff diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 94479483c3d6..151de0285d22 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -647,7 +647,7 @@ static int nfs4_xdr_dec_cb_getattr(struct rpc_rqst *rqstp, return status; status = decode_cb_op_status(xdr, OP_CB_GETATTR, &cb...
a4b853f183a19a88ad635f9ae8ba97e7cb377a23
Analyze and fix the following issue in the Linux kernel code: sunrpc: remove all connection limit configuration
Problem Details: Now that the connection limit only apply to unconfirmed connections, there is no need to configure it. So remove all the configuration and fix the number of unconfirmed connections as always 64 - which is now given a name: XPT_MAX_TMP_CONN Signed-off-by: NeilBrown <neilb@suse.de> Reviewed-by: Jeff La...
```diff diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 4ec22c2f2ea3..7ded57ec3a60 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c @@ -70,9 +70,6 @@ static unsigned long nlm_grace_period; unsigned long nlm_timeout = LOCKD_DFLT_TIMEO; static int nlm_udpport, nlm_tcpport; -/* RLIM_NOFILE defaults to 1024. Th...
de71d4e211eddb670b285a0ea477a299601ce1ca
Analyze and fix the following issue in the Linux kernel code: nfsd: fix legacy client tracking initialization
Problem Details: Get rid of the nfsd4_legacy_tracking_ops->init() call in check_for_legacy_methods(). That will be handled in the caller (nfsd4_client_tracking_init()). Otherwise, we'll wind up calling nfsd4_legacy_tracking_ops->init() twice, and the second time we'll trigger the BUG_ON() in nfsd4_init_recdir(). Fix...
```diff diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 4a765555bf84..1c8fcb04b3cd 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c @@ -2052,7 +2052,6 @@ static inline int check_for_legacy_methods(int status, struct net *net) path_put(&path); if (status) return -ENOTDIR; - stat...
6f035c99acd6ef6b875ac4ac28e6117e60db8f89
Analyze and fix the following issue in the Linux kernel code: NFSD: Clean up unused variable
Problem Details: @sb should have been removed by commit 7e64c5bc497c ("NLM/NFSD: Fix lock notifications for async-capable filesystems"). Reviewed-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 9fbf7c8f0a3e..b9d0a300d376 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -7962,7 +7962,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_blocked_lock *nbl = NULL; struct file_lock *file_lock ...
fa47906ff358a5865b7be2356a5a1d1e58dd17d8
Analyze and fix the following issue in the Linux kernel code: vsnprintf: fix up kerneldoc for argument name changes
Problem Details: Stephen Rothwell reports that I missed fixing up the documentation when the argument names changed in commit 938df695e98d ("vsprintf: associate the format state with the format pointer"), resulting in htmldoc warnings like lib/vsprintf.c:2760: warning: Function parameter or struct member 'fmt_str' n...
```diff diff --git a/lib/vsprintf.c b/lib/vsprintf.c index a49bb6eb2435..4432b69a78be 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -2732,7 +2732,7 @@ static unsigned long long convert_num_spec(unsigned int val, int size, struct pr * vsnprintf - Format a string and place it in a buffer * @buf: The buffer to p...
73b9075f334f5debf28646884a320b796b27768d
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Avoid generating untracked files when running bpf selftests
Problem Details: Currently, when we run the BPF selftests with the following command: make -C tools/testing/selftests TARGETS=bpf SKIP_TARGETS="" The command generates untracked files and directories with make version less than 4.4: ''' Untracked files: (use "git add <file>..." to include in what will be committ...
```diff diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 9e870e519c30..eb4d21651aa7 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -202,9 +202,9 @@ ifeq ($(shell expr $(MAKE_VERSION) \>= 4.4), 1) $(let OUTPUT,$(OUTPUT)/,\ ...
df4ff47448fe0d392b29868e8398e3b0e587514d
Analyze and fix the following issue in the Linux kernel code: media: venus: destroy hfi session after m2m_ctx release
Problem Details: This partially reverts commit that made hfi_session_destroy() the first step of vdec/venc close(). The reason being is a regression report when, supposedly, encode/decoder is closed with still active streaming (no ->stop_streaming() call before close()) and pending pkts, so isr_thread cannot find inst...
```diff diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 2d27c5167246..807487a1f536 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -506,18 +506,14 @@ err_cpucfg_path: void venus_close_common(struct venus_inst...
8977b561216c7e693d61c6442657e33f134bfeb5
Analyze and fix the following issue in the Linux kernel code: RDMA/hns: Clean up the legacy CONFIG_INFINIBAND_HNS
Problem Details: hns driver used to support hip06 and hip08 devices with CONFIG_INFINIBAND_HNS_HIP06 and CONFIG_INFINIBAND_HNS_HIP08 respectively, which both depended on CONFIG_INFINIBAND_HNS. But we no longer provide support for hip06 and only support hip08 and higher since the commit in fixes line, so there is no ne...
```diff diff --git a/drivers/infiniband/hw/Makefile b/drivers/infiniband/hw/Makefile index 1211f4317a9f..aba96ca9bce5 100644 --- a/drivers/infiniband/hw/Makefile +++ b/drivers/infiniband/hw/Makefile @@ -11,7 +11,7 @@ obj-$(CONFIG_INFINIBAND_OCRDMA) += ocrdma/ obj-$(CONFIG_INFINIBAND_VMWARE_PVRDMA) += vmw_pvrdma/ obj...
81468c4058a62e84e475433b83b3edc613294f5e
Analyze and fix the following issue in the Linux kernel code: RDMA/rtrs: Add missing deinit() call
Problem Details: A warning is triggered when repeatedly connecting and disconnecting the rnbd: list_add corruption. prev->next should be next (ffff88800b13e480), but was ffff88801ecd1338. (prev=ffff88801ecd1340). WARNING: CPU: 1 PID: 36562 at lib/list_debug.c:32 __list_add_valid_or_report+0x7f/0xa0 Workqueue: ib_cm ...
```diff diff --git a/drivers/infiniband/ulp/rtrs/rtrs.c b/drivers/infiniband/ulp/rtrs/rtrs.c index 4e17d546d4cc..bf38ac6f87c4 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs.c +++ b/drivers/infiniband/ulp/rtrs/rtrs.c @@ -584,6 +584,9 @@ static void dev_free(struct kref *ref) list_del(&dev->entry); mutex_unlock(&pool-...
be92ab2de0ee1a13291c3b47b2d7eb24d80c0a2c
Analyze and fix the following issue in the Linux kernel code: spi: atmel-qspi: Memory barriers after memory-mapped I/O
Problem Details: The QSPI peripheral control and status registers are accessible via the SoC's APB bus, whereas MMIO transactions' data travels on the AHB bus. Microchip documentation and even sample code from Atmel emphasises the need for a memory barrier before the first MMIO transaction to the AHB-connected QSPI, a...
```diff diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index f46da363574f..8fdc9d27a95e 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -661,13 +661,20 @@ static int atmel_qspi_transfer(struct spi_mem *mem, (void)atmel_qspi_read(aq, QSPI_IFR); /* Send/Receive ...
dddca3b2fc676113c58b04aaefe84bfb958ac83e
Analyze and fix the following issue in the Linux kernel code: regulator: of: Implement the unwind path of of_regulator_match()
Problem Details: of_regulator_match() does not release the OF node reference in the error path, resulting in an OF node leak. Therefore, call of_node_put() on the obtained nodes before returning the EINVAL error. Since it is possible that some drivers call this function and do not exit on failure, such as s2mps11_pmic...
```diff diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index 3d85762beda6..6acbd5f2e796 100644 --- a/drivers/regulator/of_regulator.c +++ b/drivers/regulator/of_regulator.c @@ -446,7 +446,7 @@ int of_regulator_match(struct device *dev, struct device_node *node, "failed to parse D...
907af7d6e0c8cf4086b1bc5218281b2ca09f130b
Analyze and fix the following issue in the Linux kernel code: regulator: Move OF_ API declarations/definitions outside CONFIG_REGULATOR
Problem Details: Since these are hidden inside CONFIG_REGULATOR, building the consumer drivers without CONFIG_REGULATOR will result in the following build error: >> drivers/pci/pwrctrl/slot.c:39:15: error: implicit declaration of function 'of_regulator_bulk_get_all'; did you mean 'regulator_bulk_get'? [-Werror=implici...
```diff diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 85be83c8fa17..bcba3935c6f9 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -168,38 +168,6 @@ int devm_regulator_get_enable_read_voltage(struct device *dev, const char *id); voi...
1156b5e8be98c97087f8971609c852e418daf03b
Analyze and fix the following issue in the Linux kernel code: regulator: Guard of_regulator_bulk_get_all() with CONFIG_OF
Problem Details: Since the definition is in drivers/regulator/of_regulator.c and compiled only if CONFIG_OF is enabled, building the consumer driver without CONFIG_OF and with CONFIG_REGULATOR will result in below build error: ERROR: modpost: "of_regulator_bulk_get_all" [drivers/pci/pwrctrl/pci-pwrctl-slot.ko] undefin...
```diff diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 8c3c372ad735..85be83c8fa17 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -175,6 +175,8 @@ struct regulator *__must_check of_regulator_get_optional(struct device *dev, struct ...
c21b89d495bab6ae7ce0a1592bb955e5e80127fd
Analyze and fix the following issue in the Linux kernel code: btrfs: don't read from userspace twice in btrfs_uring_encoded_read()
Problem Details: If we return -EAGAIN the first time because we need to block, btrfs_uring_encoded_read() will get called twice. Take a copy of args, the iovs, and the iter the first time, as by the time we are called the second time these may have gone out of scope. Reported-by: Jens Axboe <axboe@kernel.dk> Fixes: 34...
```diff diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index f8680e7cc974..149259180faa 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -4879,25 +4879,29 @@ out_fail: return ret; } +struct btrfs_uring_encoded_data { + struct btrfs_ioctl_encoded_io_args args; + struct iovec iovstack[UIO_FASTIOV]; + struct...
0c0214df28f0dba8de084cb4dedc0c459dfbc083
Analyze and fix the following issue in the Linux kernel code: fanotify: Fix crash in fanotify_init(2)
Problem Details: The rrror handling in fanotify_init(2) is buggy and overwrites 'fd' before calling put_unused_fd() leading to possible access beyond the end of fd bitmap. Fix it. Reported-by: syzbot+6a3aa63412255587b21b@syzkaller.appspotmail.com Fixes: ebe559609d78 ("fs: get rid of __FMODE_NONOTIFY kludge") Signed-of...
```diff diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 19435cd2c41f..6ff94e312232 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -1624,8 +1624,8 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags) ...
7b12ab055edef2f51733d155617a401a05237bcc
Analyze and fix the following issue in the Linux kernel code: media: nxp: imx8-isi: fix v4l2-compliance test errors
Problem Details: Running the v4l2-compliance (1.27.0-5208, SHA: af114250d48d) on the m2m device fails on the MMAP streaming tests, with the following messages: fail: v4l2-test-buffers.cpp(240): g_field() == V4L2_FIELD_ANY fail: v4l2-test-buffers.cpp(1508): buf.qbuf(node) Apparently, the driver does not properly set t...
```diff diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c index c0ba34ea82fd..8654150728a8 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c @@ -861,6 +861,7 @@ int mxc_isi_v...
96b5d2e807f667320c66f41ddc1c473023a73ab2
Analyze and fix the following issue in the Linux kernel code: drm: xlnx: zynqmp_dpsub: Fix kernel doc
Problem Details: Fix two kernel doc warnings introduced by the recent DP audio patch: - Add a doc line for the new "audio" field - Remove a reference to zynqmp_dpsub.c from zynqmp.rst, as the .c file no longer has structured comments Fixes: 3ec5c1579305 ("drm: xlnx: zynqmp_dpsub: Add DP audio support") Closes: http...
```diff diff --git a/Documentation/gpu/zynqmp.rst b/Documentation/gpu/zynqmp.rst index f57bfa0ad6ec..1a6f9193de22 100644 --- a/Documentation/gpu/zynqmp.rst +++ b/Documentation/gpu/zynqmp.rst @@ -144,6 +144,4 @@ Internals .. kernel-doc:: drivers/gpu/drm/xlnx/zynqmp_dp.c -.. kernel-doc:: drivers/gpu/drm/xlnx/zynqmp_...
eca836dfd8386b32f1aae60f8e323218ac6a0b75
Analyze and fix the following issue in the Linux kernel code: soc: samsung: exynos-pmu: Fix uninitialized ret in tensor_set_bits_atomic()
Problem Details: If tensor_set_bits_atomic() is called with a mask of 0 the function will just iterate over its bit, not perform any updates and return stack value of 'ret'. Also reported by smatch: drivers/soc/samsung/exynos-pmu.c:129 tensor_set_bits_atomic() error: uninitialized symbol 'ret'. Fixes: 0b7c6075022c...
```diff diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c index d8c53cec7f37..dd5256e5aae1 100644 --- a/drivers/soc/samsung/exynos-pmu.c +++ b/drivers/soc/samsung/exynos-pmu.c @@ -126,7 +126,7 @@ static int tensor_set_bits_atomic(void *ctx, unsigned int offset, u32 val, if (ret) re...
34d813e45ecb8e84f7154509b1acf7dda57ef09f
Analyze and fix the following issue in the Linux kernel code: drm/display: hdmi-state-helper: add drm_display_mode declaration
Problem Details: Add forward-declaration for the struct drm_display_mode, missed in the commit 47368ab437fd ("drm/display: hdmi: add generic mode_valid helper") Fixes: 47368ab437fd ("drm/display: hdmi: add generic mode_valid helper") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://patchwork...
```diff diff --git a/include/drm/display/drm_hdmi_state_helper.h b/include/drm/display/drm_hdmi_state_helper.h index 9ae19f3caf72..44ec5c4a7503 100644 --- a/include/drm/display/drm_hdmi_state_helper.h +++ b/include/drm/display/drm_hdmi_state_helper.h @@ -6,6 +6,7 @@ struct drm_atomic_state; struct drm_connector; str...
b9097e4c8bf3934e4e07e6f9b88741957fef351e
Analyze and fix the following issue in the Linux kernel code: drm/tests: helpers: Fix compiler warning
Problem Details: Delete one line break to make the format correct, resolving the following warning during a W=1 build: >> drivers/gpu/drm/tests/drm_kunit_helpers.c:324: warning: bad line: for a KUnit test Fixes: caa714f86699 ("drm/tests: helpers: Add helper for drm_display_mode_from_cea_vic()") Reported-by: kernel te...
```diff diff --git a/drivers/gpu/drm/tests/drm_kunit_helpers.c b/drivers/gpu/drm/tests/drm_kunit_helpers.c index 04a6b8cc62ac..3c0b7824c0be 100644 --- a/drivers/gpu/drm/tests/drm_kunit_helpers.c +++ b/drivers/gpu/drm/tests/drm_kunit_helpers.c @@ -320,8 +320,7 @@ static void kunit_action_drm_mode_destroy(void *ptr) } ...
600258d555f0710b9c47fb78d2d80a4aecd608cc
Analyze and fix the following issue in the Linux kernel code: xfrm: delete intermediate secpath entry in packet offload mode
Problem Details: Packets handled by hardware have added secpath as a way to inform XFRM core code that this path was already handled. That secpath is not needed at all after policy is checked and it is removed later in the stack. However, in the case of IP forwarding is enabled (/proc/sys/net/ipv4/ip_forward), that se...
```diff diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 32c09e85a64c..2c4eda6a8596 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -1224,9 +1224,19 @@ static inline int __xfrm_policy_check2(struct sock *sk, int dir, if (xo) { x = xfrm_input_state(skb); - if (x->xso.type == XFRM_DEV_OFFLOA...
fcf73e20cd1fe60c3ba5f9626f1e8f9cd4511edf
Analyze and fix the following issue in the Linux kernel code: Revert "drm/i915/hdcp: Don't enable HDCP1.4 directly from check_link"
Problem Details: This reverts commit 483f7d94a0453564ad9295288c0242136c5f36a0. This needs to be reverted since HDCP even after updating the connector state HDCP property we don't reenable HDCP until the next commit in which the CP Property is set causing compliance to fail. --v2 -Fix build issue [Dnyaneshwar] Signed-...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index f6e68a0e3b6d..7464b44c8bb3 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -1166,9 +1166,15 @@ static int intel_hdcp_check_link(struct intel_connecto...
4c16e1cadcbcaf3c82d5fc310fbd34d0f5d0db7c
Analyze and fix the following issue in the Linux kernel code: ksmbd: fix a missing return value check bug
Problem Details: In the smb2_send_interim_resp(), if ksmbd_alloc_work_struct() fails to allocate a node, it returns a NULL pointer to the in_work pointer. This can lead to an illegal memory write of in_work->response_buf when allocate_interim_rsp_buf() attempts to perform a kzalloc() on it. To address this issue, inco...
```diff diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index 23e21845f928..433e33c04039 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -695,6 +695,9 @@ void smb2_send_interim_resp(struct ksmbd_work *work, __le32 status) struct smb2_hdr *rsp_hdr; struct ksmbd_work *in_work = ks...
95f1c1e98db36ddb9ea79e5c61ec11ec43ebbbaf
Analyze and fix the following issue in the Linux kernel code: netfilter: xt_hashlimit: htable_selective_cleanup() optimization
Problem Details: I have seen syzbot reports hinting at xt_hashlimit abuse: [ 105.783066][ T4331] xt_hashlimit: max too large, truncated to 1048576 [ 105.811405][ T4331] xt_hashlimit: size too large, truncated to 1048576 And worker threads using up to 1 second per htable_selective_cleanup() invocation. [ 269.73449...
```diff diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 0859b8f76764..fa02aab56724 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c @@ -363,11 +363,15 @@ static void htable_selective_cleanup(struct xt_hashlimit_htable *ht, bool select unsigned int i; for ...
385443057f475e775fe1c66e77d4be9727f40973
Analyze and fix the following issue in the Linux kernel code: kbuild: pacman-pkg: provide versioned linux-api-headers package
Problem Details: The Arch Linux glibc package contains a versioned dependency on "linux-api-headers". If the linux-api-headers package provided by pacman-pkg does not specify an explicit version this dependency is not satisfied. Fix the dependency by providing an explicit version. Fixes: c8578539deba ("kbuild: add scr...
```diff diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD index f83493838cf9..dca706617adc 100644 --- a/scripts/package/PKGBUILD +++ b/scripts/package/PKGBUILD @@ -103,7 +103,7 @@ _package-headers() { _package-api-headers() { pkgdesc="Kernel headers sanitized for use in userspace" - provides=(linux-...
c84f0f4f49d81645f49c3269fdcc3b84ce61e795
Analyze and fix the following issue in the Linux kernel code: RDMA/bnxt_re: Fix to drop reference to the mmap entry in case of error
Problem Details: In the error handling path of bnxt_re_mmap(), driver should invoke rdma_user_mmap_entry_put() to free the reference of mmap entry in case the error happens after rdma_user_mmap_entry_get was called. Fixes: ea2224857882 ("RDMA/bnxt_re: Update alloc_page uapi for pacing") Reviewed-by: Saravanan Vajravel...
```diff diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index 129178bdc581..27efaaf1c82a 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -4465,9 +4465,10 @@ int bnxt_re_mmap(struct ib_ucontext *ib_uctx, struct vm_ar...
f09ff307c7299392f1c88f763299e24bc99811c7
Analyze and fix the following issue in the Linux kernel code: safesetid: check size of policy writes
Problem Details: syzbot attempts to write a buffer with a large size to a sysfs entry with writes handled by handle_policy_update(), triggering a warning in kmalloc. Check the size specified for write buffers before allocating. Reported-by: syzbot+4eb7a741b3216020043a@syzkaller.appspotmail.com Closes: https://syzkall...
```diff diff --git a/security/safesetid/securityfs.c b/security/safesetid/securityfs.c index 25310468bcdd..8e1ffd70b18a 100644 --- a/security/safesetid/securityfs.c +++ b/security/safesetid/securityfs.c @@ -143,6 +143,9 @@ static ssize_t handle_policy_update(struct file *file, char *buf, *p, *end; int err; + if (...
3b44cd0998678b55a0df20b514bca0e298f4ff48
Analyze and fix the following issue in the Linux kernel code: net: corrections for security_secid_to_secctx returns
Problem Details: security_secid_to_secctx() returns the size of the new context, whereas previous versions provided that via a pointer parameter. Correct the type of the value returned in nfqnl_get_sk_secctx() and the check for error in netlbl_unlhsh_add(). Add an error check. Fixes: 2d470c778120 ("lsm: replace contex...
```diff diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index 5110f29b2f40..5c913987901a 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c @@ -470,9 +470,9 @@ static int nfqnl_put_sk_classid(struct sk_buff *skb, struct sock *sk) return 0; } -static u3...
5e7f0efd23238039bcd4fc72ff28d94f364ec26b
Analyze and fix the following issue in the Linux kernel code: selinux: match extended permissions to their base permissions
Problem Details: In commit d1d991efaf34 ("selinux: Add netlink xperm support") a new extended permission was added ("nlmsg"). This was the second extended permission implemented in selinux ("ioctl" being the first one). Extended permissions are associated with a base permission. It was found that, in the access vector...
```diff diff --git a/security/selinux/avc.c b/security/selinux/avc.c index cc0b0af20296..1f2680bcc43a 100644 --- a/security/selinux/avc.c +++ b/security/selinux/avc.c @@ -174,13 +174,15 @@ int avc_get_hash_stats(char *page) * using a linked list for extended_perms_decision lookup because the list is * always small....
8ce4f287524c74a118b0af1eebd4b24a8efca57a
Analyze and fix the following issue in the Linux kernel code: net: libwx: fix firmware mailbox abnormal return
Problem Details: The existing SW-FW interaction flow on the driver is wrong. Follow this wrong flow, driver would never return error if there is a unknown command. Since firmware writes back 'firmware ready' and 'unknown command' in the mailbox message if there is an unknown command sent by driver. So reading 'firmware...
```diff diff --git a/drivers/net/ethernet/wangxun/libwx/wx_hw.c b/drivers/net/ethernet/wangxun/libwx/wx_hw.c index 1bf9c38e4125..deaf670c160e 100644 --- a/drivers/net/ethernet/wangxun/libwx/wx_hw.c +++ b/drivers/net/ethernet/wangxun/libwx/wx_hw.c @@ -334,27 +334,25 @@ int wx_host_interface_command(struct wx *wx, u32 *b...
c83c846231db8b153bfcb44d552d373c34f78245
Analyze and fix the following issue in the Linux kernel code: io_uring/timeout: fix multishot updates
Problem Details: After update only the first shot of a multishot timeout request adheres to the new timeout value while all subsequent retries continue to use the old value. Don't forget to update the timeout stored in struct io_timeout_data. Cc: stable@vger.kernel.org Fixes: ea97f6c8558e8 ("io_uring: add support for ...
```diff diff --git a/io_uring/timeout.c b/io_uring/timeout.c index 362689b17ccc..e9cec9e4dc2f 100644 --- a/io_uring/timeout.c +++ b/io_uring/timeout.c @@ -427,10 +427,12 @@ static int io_timeout_update(struct io_ring_ctx *ctx, __u64 user_data, timeout->off = 0; /* noseq */ data = req->async_data; + data->ts = *ts...
a039e54397c6a75b713b9ce7894a62e06956aa92
Analyze and fix the following issue in the Linux kernel code: net_sched: cls_flow: validate TCA_FLOW_RSHIFT attribute
Problem Details: syzbot found that TCA_FLOW_RSHIFT attribute was not validated. Right shitfing a 32bit integer is undefined for large shift values. UBSAN: shift-out-of-bounds in net/sched/cls_flow.c:329:23 shift exponent 9445 is too large for 32-bit type 'u32' (aka 'unsigned int') CPU: 1 UID: 0 PID: 54 Comm: kworker/u...
```diff diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c index 5502998aace7..5c2580a07530 100644 --- a/net/sched/cls_flow.c +++ b/net/sched/cls_flow.c @@ -356,7 +356,8 @@ static const struct nla_policy flow_policy[TCA_FLOW_MAX + 1] = { [TCA_FLOW_KEYS] = { .type = NLA_U32 }, [TCA_FLOW_MODE] = { .type = NLA...
a003c38d9bbbacd26b2354795bddb8d25631b0b5
Analyze and fix the following issue in the Linux kernel code: net: pcs: pcs-mtk-lynxi: correctly report in-band status capabilities
Problem Details: Neither does the LynxI PCS support QSGMII, nor is in-band-status supported in 2500Base-X mode. Fix the pcs_inband_caps() method accordingly. Fixes: 520d29bdda86 ("net: pcs: pcs-mtk-lynxi: implement pcs_inband_caps() method") Signed-off-by: Daniel Golle <daniel@makrotopia.org> Link: https://patch.msgid...
```diff diff --git a/drivers/net/pcs/pcs-mtk-lynxi.c b/drivers/net/pcs/pcs-mtk-lynxi.c index 7de804535229..ed91cd7a406a 100644 --- a/drivers/net/pcs/pcs-mtk-lynxi.c +++ b/drivers/net/pcs/pcs-mtk-lynxi.c @@ -93,11 +93,12 @@ static unsigned int mtk_pcs_lynxi_inband_caps(struct phylink_pcs *pcs, { switch (interface) { ...
3479c7549fb1dfa7a1db4efb7347c7b8ef50de4b
Analyze and fix the following issue in the Linux kernel code: tcp/dccp: allow a connection when sk_max_ack_backlog is zero
Problem Details: If the backlog of listen() is set to zero, sk_acceptq_is_full() allows one connection to be made, but inet_csk_reqsk_queue_is_full() does not. When the net.ipv4.tcp_syncookies is zero, inet_csk_reqsk_queue_is_full() will cause an immediate drop before the sk_acceptq_is_full() check in tcp_conn_request(...
```diff diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index 3c82fad904d4..c7f42844c79a 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h @@ -282,7 +282,7 @@ static inline int inet_csk_reqsk_queue_len(const struct sock *sk) static inline in...
1e9b0e1c550c42c13c111d1a31e822057232abc4
Analyze and fix the following issue in the Linux kernel code: net: 802: LLC+SNAP OID:PID lookup on start of skb data
Problem Details: 802.2+LLC+SNAP frames received by napi_complete_done() with GRO and DSA have skb->transport_header set two bytes short, or pointing 2 bytes before network_header & skb->data. This was an issue as snap_rcv() expected offset to point to SNAP header (OID:PID), causing packet to be dropped. A fix at llc_f...
```diff diff --git a/net/802/psnap.c b/net/802/psnap.c index fca9d454905f..389df460c8c4 100644 --- a/net/802/psnap.c +++ b/net/802/psnap.c @@ -55,11 +55,11 @@ static int snap_rcv(struct sk_buff *skb, struct net_device *dev, goto drop; rcu_read_lock(); - proto = find_snap_client(skb_transport_header(skb)); + prot...
577a66e2e634f712384c57a98f504c44ea4b47da
Analyze and fix the following issue in the Linux kernel code: iio: iio-mux: kzalloc instead of devm_kzalloc to ensure page alignment
Problem Details: During channel configuration, the iio-mux driver allocates a page with devm_kzalloc(PAGE_SIZE) to read channel ext_info. However, the resulting buffer points to an offset of the page due to the devres header sitting at the beginning of the allocated area. This leads to failure in the provider driver wh...
```diff diff --git a/drivers/iio/multiplexer/iio-mux.c b/drivers/iio/multiplexer/iio-mux.c index 2953403bef53..c309d991490c 100644 --- a/drivers/iio/multiplexer/iio-mux.c +++ b/drivers/iio/multiplexer/iio-mux.c @@ -7,6 +7,7 @@ * Author: Peter Rosin <peda@axentia.se> */ +#include <linux/cleanup.h> #include <linux...
f5ab868af55ff58f7783d08d674bb373cb672210
Analyze and fix the following issue in the Linux kernel code: iio: adc: ad7625: Add ending newlines to error messages
Problem Details: Error messages passed to dev_err_probe() are supposed to end in "\n". Fix accordingly. Fixes: b7ffd0fa65e9 ("iio: adc: ad7625: add driver") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Tested-by: Trevor Gamblin <tgamblin@baylibre.com> Link: https://patch.msgid.link/20241230151030.320...
```diff diff --git a/drivers/iio/adc/ad7625.c b/drivers/iio/adc/ad7625.c index aefe3bf75c91..afa9bf4ddf3c 100644 --- a/drivers/iio/adc/ad7625.c +++ b/drivers/iio/adc/ad7625.c @@ -477,12 +477,12 @@ static int devm_ad7625_pwm_get(struct device *dev, ref_clk = devm_clk_get_enabled(dev, NULL); if (IS_ERR(ref_clk)) r...
82e1cedeb8186cc019bad83d6bf06a9c475d7b13
Analyze and fix the following issue in the Linux kernel code: iio: light: veml3235: fix scale to conform to ABI
Problem Details: The current scale is not ABI-compliant as it is just the sensor gain instead of the value that acts as a multiplier to be applied to the raw value (there is no offset). Use the iio-gts helpers to obtain the proper scale values according to the gain and integration time to match the resolution tables f...
```diff diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig index 4897258e3da5..e34e551eef3e 100644 --- a/drivers/iio/light/Kconfig +++ b/drivers/iio/light/Kconfig @@ -669,6 +669,7 @@ config VCNL4035 config VEML3235 tristate "VEML3235 ambient light sensor" select REGMAP_I2C + select IIO_GTS_HELPER ...
383ca7bee8a93be9ff5a072936981c2710d2856b
Analyze and fix the following issue in the Linux kernel code: clk: sunxi-ng: a64: stop force-selecting PLL-MIPI as TCON0 parent
Problem Details: Stop force-selecting PLL-MIPI as TCON0 parent, since it breaks video output on Pinebook that uses RGB to eDP bridge. Partially revert commit ca1170b69968 ("clk: sunxi-ng: a64: force select PLL_MIPI in TCON0 mux"), while still leaving CLK_SET_RATE_NO_REPARENT flag set, since we do not want the clock to...
```diff diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c index 82d7dcbca1cc..63f0259b0e99 100644 --- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c +++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c @@ -535,11 +535,11 @@ static SUNXI_CCU_M_WITH_MUX_GATE(de_clk, "de", de_parents, CLK_SE...
8715c91a836502929c637c76a26335ede8818acf
Analyze and fix the following issue in the Linux kernel code: arm64: dts: allwinner: a64: explicitly assign clock parent for TCON0
Problem Details: TCON0 seems to need a different clock parent depending on output type. For RGB it has to be PLL-VIDEO0-2X, while for DSI it has to be PLL-MIPI, so select it explicitly. Video output doesn't work if incorrect clock is assigned. On my Pinebook I manually configured PLL-VIDEO0-2X and PLL-MIPI to the sam...
```diff diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts index 379c2c8466f5..86d44349e095 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts @@ -390,6 +390,8 @@ &tcon0 {...
f563dd9ca6cb6ed52c5fb6e4285d1ef26cfa7e8a
Analyze and fix the following issue in the Linux kernel code: drm/mediatek: Initialize pointer in mtk_drm_of_ddp_path_build_one()
Problem Details: The struct device_node *next pointer is not initialized, and it is used in an error path in which it may have never been modified by function mtk_drm_of_get_ddp_ep_cid(). Since the error path is relying on that pointer being NULL for the OVL Adaptor and/or invalid component check and since said pointe...
```diff diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index f0f3d545ff19..c86decee6ec9 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -905,7 +905,7 @@ static int mtk_drm_of_ddp_path_build_one(struct device *dev, enum mtk...
522908140645865dc3e2fac70fd3b28834dfa7be
Analyze and fix the following issue in the Linux kernel code: drm/mediatek: Add return value check when reading DPCD
Problem Details: Check the return value of drm_dp_dpcd_readb() to confirm that AUX communication is successful. To simplify the code, replace drm_dp_dpcd_readb() and DP_GET_SINK_COUNT() with drm_dp_read_sink_count(). Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver") Signed-off-by: Liankun Ya...
```diff diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c index e945c1204837..dcf4d23d11ba 100644 --- a/drivers/gpu/drm/mediatek/mtk_dp.c +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -2103,7 +2103,6 @@ static enum drm_connector_status mtk_dp_bdg_detect(struct drm_bridge *bridge) struct ...
0f368cb7ef103f284f75e962c4c89da5aa8ccec7
Analyze and fix the following issue in the Linux kernel code: clk: sunxi-ng: a64: drop redundant CLK_PLL_VIDEO0_2X and CLK_PLL_MIPI
Problem Details: Drop redundant CLK_PLL_VIDEO0_2X and CLK_PLL.MIPI. These are now defined in dt-bindings/clock/sun50i-a64-ccu.h Fixes: ca1170b69968 ("clk: sunxi-ng: a64: force select PLL_MIPI in TCON0 mux") Reviewed-by: Dragan Simic <dsimic@manjaro.org> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Tested-by: Frank Oltman...
```diff diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.h b/drivers/clk/sunxi-ng/ccu-sun50i-a64.h index a8c11c0b4e06..dfba88a5ad0f 100644 --- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.h +++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.h @@ -21,7 +21,6 @@ /* PLL_VIDEO0 exported for HDMI PHY */ -#define CLK_PLL_VIDEO0_2X 8 ...
9897831de614f1d8d5184547f0e7bf7665eed436
Analyze and fix the following issue in the Linux kernel code: dt-bindings: clock: sunxi: Export PLL_VIDEO_2X and PLL_MIPI
Problem Details: Export PLL_VIDEO_2X and PLL_MIPI, these will be used to explicitly select TCON0 clock parent in dts Fixes: ca1170b69968 ("clk: sunxi-ng: a64: force select PLL_MIPI in TCON0 mux") Reviewed-by: Dragan Simic <dsimic@manjaro.org> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Tested-by: Frank Oltmanns <frank@o...
```diff diff --git a/include/dt-bindings/clock/sun50i-a64-ccu.h b/include/dt-bindings/clock/sun50i-a64-ccu.h index 175892189e9d..4f220ea7a23c 100644 --- a/include/dt-bindings/clock/sun50i-a64-ccu.h +++ b/include/dt-bindings/clock/sun50i-a64-ccu.h @@ -44,7 +44,9 @@ #define _DT_BINDINGS_CLK_SUN50I_A64_H_ #define CLK_...
68a3a65003145644efcbb651e91db249ccd96281
Analyze and fix the following issue in the Linux kernel code: libfs: Replace simple_offset end-of-directory detection
Problem Details: According to getdents(3), the d_off field in each returned directory entry points to the next entry in the directory. The d_off field in the last returned entry in the readdir buffer must contain a valid offset value, but if it points to an actual directory entry, then readdir/getdents can loop. This ...
```diff diff --git a/fs/libfs.c b/fs/libfs.c index 8c9364a0174c..47399f90511a 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -245,9 +245,15 @@ const struct inode_operations simple_dir_inode_operations = { }; EXPORT_SYMBOL(simple_dir_inode_operations); -/* 0 is '.', 1 is '..', so always start with offset 2 or more */ +...
b662d858131da9a8a14e68661656989b14dbf113
Analyze and fix the following issue in the Linux kernel code: Revert "libfs: fix infinite directory reads for offset dir"
Problem Details: The current directory offset allocator (based on mtree_alloc_cyclic) stores the next offset value to return in octx->next_offset. This mechanism typically returns values that increase monotonically over time. Eventually, though, the newly allocated offset value wraps back to a low number (say, 2) which...
```diff diff --git a/fs/libfs.c b/fs/libfs.c index 8380d9314ebd..8c9364a0174c 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -422,14 +422,6 @@ void simple_offset_destroy(struct offset_ctx *octx) mtree_destroy(&octx->mt); } -static int offset_dir_open(struct inode *inode, struct file *file) -{ - struct offset_ctx *ctx...
903dc9c43a155e0893280c7472d4a9a3a83d75a6
Analyze and fix the following issue in the Linux kernel code: libfs: Return ENOSPC when the directory offset range is exhausted
Problem Details: Testing shows that the EBUSY error return from mtree_alloc_cyclic() leaks into user space. The ERRORS section of "man creat(2)" says: > EBUSY O_EXCL was specified in flags and pathname refers > to a block device that is in use by the system > (e.g., it is mounted). ENOSPC is closer to what applicat...
```diff diff --git a/fs/libfs.c b/fs/libfs.c index 748ac5923154..3da58a92f48f 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -292,8 +292,8 @@ int simple_offset_add(struct offset_ctx *octx, struct dentry *dentry) ret = mtree_alloc_cyclic(&octx->mt, &offset, dentry, DIR_OFFSET_MIN, LONG_MAX, &octx->next_offset, GF...
ab251dacfbae28772c897f068a4184f478189ff2
Analyze and fix the following issue in the Linux kernel code: fs/proc: do_task_stat: Fix ESP not readable during coredump
Problem Details: The field "eip" (instruction pointer) and "esp" (stack pointer) of a task can be read from /proc/PID/stat. These fields can be interesting for coredump. However, these fields were disabled by commit 0a1eb2d474ed ("fs/proc: Stop reporting eip and esp in /proc/PID/stat"), because it is generally unsafe ...
```diff diff --git a/fs/proc/array.c b/fs/proc/array.c index 55ed3510d2bb..d6a0369caa93 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -500,7 +500,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, * a program is not able to use ptrace(2) in that case. It is * safe because the tas...
03f275adb8fbd7b4ebe96a1ad5044d8e602692dc
Analyze and fix the following issue in the Linux kernel code: fuse: respect FOPEN_KEEP_CACHE on opendir
Problem Details: The re-factoring of fuse_dir_open() missed the need to invalidate directory inode page cache with open flag FOPEN_KEEP_CACHE. Fixes: 7de64d521bf92 ("fuse: break up fuse_open_common()") Reported-by: Prince Kumar <princer@google.com> Closes: https://lore.kernel.org/linux-fsdevel/CAEW=TRr7CYb4LtsvQPLj-zx...
```diff diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 494ac372ace0..e540d05549ff 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1681,6 +1681,8 @@ static int fuse_dir_open(struct inode *inode, struct file *file) */ if (ff->open_flags & (FOPEN_STREAM | FOPEN_NONSEEKABLE)) nonseekable_open(inode, file); ...
fee7aaee11f52c231f886d3232c1c20a6a830e45
Analyze and fix the following issue in the Linux kernel code: accel/amdxdna: Declare npu6_dev_priv as static
Problem Details: Fix sparse warning: symbol 'npu6_dev_priv' was not declared. Should it be static? Fixes: 273b5176ac17 ("accel/amdxdna: Add RyzenAI-npu6 support") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202412311819.9mz11Uak-lkp@intel.com/ Signed-off-by: Lizhi Hou...
```diff diff --git a/drivers/accel/amdxdna/npu6_regs.c b/drivers/accel/amdxdna/npu6_regs.c index f46c760cefc7..94a7005685a7 100644 --- a/drivers/accel/amdxdna/npu6_regs.c +++ b/drivers/accel/amdxdna/npu6_regs.c @@ -61,7 +61,7 @@ #define NPU6_SMU_BAR_BASE MMNPU_APERTURE4_BASE #define NPU6_SRAM_BAR_BASE MMNPU_APERTURE1...
3b5bcf64a65b36e91b6bead03de1df6f2705ad94
Analyze and fix the following issue in the Linux kernel code: accel/amdxdna: Add __user to second parameter of aie2_query_status
Problem Details: The second parameter of aie2_query_status() is a userspace pointer. Declaring it as 'char __user *' to fix sparse warning. Fixes: 850d71f6bf4c ("accel/amdxdna: Add query functions") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202412311655.YBvq2wJb-lkp@i...
```diff diff --git a/drivers/accel/amdxdna/aie2_pci.h b/drivers/accel/amdxdna/aie2_pci.h index cc159cadff9f..f2d95531ddc2 100644 --- a/drivers/accel/amdxdna/aie2_pci.h +++ b/drivers/accel/amdxdna/aie2_pci.h @@ -269,7 +269,7 @@ int aie2_query_firmware_version(struct amdxdna_dev_hdl *ndev, int aie2_create_context(struct...
72e487b47d249f9226093b1c8eefba06c32803ef
Analyze and fix the following issue in the Linux kernel code: accel/amdxdna: Declare force_cmdlist as static
Problem Details: Fix sparse warning: symbol 'force_cmdlist' was not declared. Should it be static? Fixes: aac243092b70 ("accel/amdxdna: Add command execution") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202412311448.GKQj7uPZ-lkp@intel.com/ Signed-off-by: Lizhi Hou <l...
```diff diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c index 9facf45818f9..5f43db02b240 100644 --- a/drivers/accel/amdxdna/aie2_ctx.c +++ b/drivers/accel/amdxdna/aie2_ctx.c @@ -22,7 +22,7 @@ #include "amdxdna_mailbox.h" #include "amdxdna_pci_drv.h" -bool force_cmdlist; +static bool...
1f74400529488906dd0c57a4d1520a639bfd91d8
Analyze and fix the following issue in the Linux kernel code: accel/amdxdna: Use rcu_access_pointer for __rcu pointer
Problem Details: Use rcu_access_pointer for pid in struct drm_file. This fixes sparse warning. Fixes: be462c97b7df ("accel/amdxdna: Add hardware context") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202412311210.LfeHTzLw-lkp@intel.com/ Signed-off-by: Lizhi Hou <lizhi.ho...
```diff diff --git a/drivers/accel/amdxdna/amdxdna_pci_drv.c b/drivers/accel/amdxdna/amdxdna_pci_drv.c index 194e44fc243d..97d4a032171f 100644 --- a/drivers/accel/amdxdna/amdxdna_pci_drv.c +++ b/drivers/accel/amdxdna/amdxdna_pci_drv.c @@ -61,7 +61,7 @@ static int amdxdna_drm_open(struct drm_device *ddev, struct drm_fil...
c199310be29a08ad1c0b178fdace7e5a8d2d6515
Analyze and fix the following issue in the Linux kernel code: accel/amdxdna: Declare aie2_max_col as static
Problem Details: Fix the sparse warning: symbol 'aie2_max_col' was not declared. Should it be static? Fixes: c88d3325ae69 ("accel/amdxdna: Add hardware resource solver") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202412311028.x2UtcSHm-lkp@intel.com/ Signed-off-by: Li...
```diff diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c index 8b273bc7db44..5a058e565b01 100644 --- a/drivers/accel/amdxdna/aie2_pci.c +++ b/drivers/accel/amdxdna/aie2_pci.c @@ -25,7 +25,7 @@ #include "amdxdna_mailbox.h" #include "amdxdna_pci_drv.h" -int aie2_max_col = XRS_MAX_COL; ...
3c8cfec3fcc4fe53f2bd87ec91ef31df4fa6dc0d
Analyze and fix the following issue in the Linux kernel code: accel/amdxdna: Declare mailbox register base as __iomem pointer
Problem Details: Declare mailbox ringbuf_base and mbox_base as 'void __iomem *' to fix sparse warnings: cast removes address space '__iomem' of expression incorrect type in argument 2 (different address spaces) Fixes: b87f920b9344 ("accel/amdxdna: Support hardware mailbox") Reported-by: kernel test robot <lkp@inte...
```diff diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c index 8de8f3bd4987..8b273bc7db44 100644 --- a/drivers/accel/amdxdna/aie2_pci.c +++ b/drivers/accel/amdxdna/aie2_pci.c @@ -380,9 +380,9 @@ static int aie2_hw_start(struct amdxdna_dev *xdna) goto stop_psp; } - mbox_res.ringbuf...
71486e48370e8902e0816bba8b51a22871e5e653
Analyze and fix the following issue in the Linux kernel code: accel/amdxdna: Declare npu device profile as static variables
Problem Details: Declare the variables as static to fix the sparse warnings: symbol 'npu5_dev_priv' was not declared. Should it be static? symbol 'npu1_dev_priv' was not declared. Should it be static? symbol 'npu4_dev_priv' was not declared. Should it be static? symbol 'npu2_dev_priv' was not declared. Should it be sta...
```diff diff --git a/drivers/accel/amdxdna/npu1_regs.c b/drivers/accel/amdxdna/npu1_regs.c index e408af57e378..e4f6dac7d00f 100644 --- a/drivers/accel/amdxdna/npu1_regs.c +++ b/drivers/accel/amdxdna/npu1_regs.c @@ -62,7 +62,7 @@ const struct dpm_clk_freq npu1_dpm_clk_table[] = { { 0 } }; -const struct amdxdna_dev_...
9ff6e943bce67d125781fe4780a5d6f072dc44c0
Analyze and fix the following issue in the Linux kernel code: padata: fix sysfs store callback check
Problem Details: padata_sysfs_store() was copied from padata_sysfs_show() but this check was not adapted. Today there is no attribute which can fail this check, but if there is one it may as well be correct. Fixes: 5e017dc3f8bc ("padata: Added sysfs primitives to padata subsystem") Signed-off-by: Thomas Weißschuh <lin...
```diff diff --git a/kernel/padata.c b/kernel/padata.c index d51bbc76b227..cf63d9bcf482 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -970,7 +970,7 @@ static ssize_t padata_sysfs_store(struct kobject *kobj, struct attribute *attr, pinst = kobj2pinst(kobj); pentry = attr2pentry(attr); - if (pentry->show) +...
5001ef3af8f2c972d6fd9c5221a8457556f8bea6
Analyze and fix the following issue in the Linux kernel code: drm/xe: Fix tlb invalidation when wedging
Problem Details: If GuC fails to load, the driver wedges, but in the process it tries to do stuff that may not be initialized yet. This moves the xe_gt_tlb_invalidation_init() to be done earlier: as its own doc says, it's a software-only initialization and should had been named with the _early() suffix. Move it to be ...
```diff diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c index 41ab7fbebc19..26e64530ada2 100644 --- a/drivers/gpu/drm/xe/xe_gt.c +++ b/drivers/gpu/drm/xe/xe_gt.c @@ -387,6 +387,10 @@ int xe_gt_init_early(struct xe_gt *gt) xe_force_wake_init_gt(gt, gt_to_fw(gt)); spin_lock_init(&gt->global_invl_...
c2398e6d5f16e15598d3a37e17107fea477e3f91
Analyze and fix the following issue in the Linux kernel code: ps3disk: Do not use dev->bounce_size before it is set
Problem Details: dev->bounce_size is only initialized after it is used to set the queue limits. Fix this by using BOUNCE_SIZE instead. Fixes: a7f18b74dbe17162 ("ps3disk: pass queue_limits to blk_mq_alloc_disk") Reported-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Closes: https://lore.kernel.org/39256db9-3d73-...
```diff diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c index 68fed46c463e..dc9e4a14b885 100644 --- a/drivers/block/ps3disk.c +++ b/drivers/block/ps3disk.c @@ -384,9 +384,9 @@ static int ps3disk_probe(struct ps3_system_bus_device *_dev) unsigned int devidx; struct queue_limits lim = { .logical_blo...
457ef47c08d2979f3e59ce66267485c3faed70c8
Analyze and fix the following issue in the Linux kernel code: block: retry call probe after request_module in blk_request_module
Problem Details: Set kernel config: CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_LOOP_MIN_COUNT=0 Do latter: mknod loop0 b 7 0 exec 4<> loop0 Before commit e418de3abcda ("block: switch gendisk lookup to a simple xarray"), lookup_gendisk will first use base_probe to load module loop, and then the retry will call loop_pr...
```diff diff --git a/block/genhd.c b/block/genhd.c index 5678194b6b1a..5da3c9a64e64 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -797,7 +797,7 @@ static ssize_t disk_badblocks_store(struct device *dev, } #ifdef CONFIG_BLOCK_LEGACY_AUTOLOAD -void blk_request_module(dev_t devt) +static bool blk_probe_dev(dev_t d...
9f9eef9ec1a2b57d95a86fe81df758e8253a7766
Analyze and fix the following issue in the Linux kernel code: drm/bridge: it6505: fix HDCP CTS KSV list wait timer
Problem Details: HDCP must disabled encryption and restart authentication after waiting KSV for 5s. The original method uses a counter in a waitting loop that may wait much longer than it is supposed to. Use time_after() for KSV wait timeout. Signed-off-by: Hermes Wu <hermes.wu@ite.com.tw> Reviewed-by: AngeloGioacchin...
```diff diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c index e6badb2540f3..264779f14366 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2096,12 +2096,13 @@ static void it6505_hdcp_wait_ksv_list(struct work_struct *work) struct it65...
0989c02c7a5c887c70afeae80c64d0291624e1a7
Analyze and fix the following issue in the Linux kernel code: drm/bridge: it6505: fix HDCP CTS compare V matching
Problem Details: When HDCP negotiation with a repeater device. Checking SHA V' matching must retry 3 times before restarting HDCP. Signed-off-by: Hermes Wu <hermes.wu@ite.com.tw> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.o...
```diff diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c index 93e4c5c552d0..e6badb2540f3 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2058,7 +2058,7 @@ static bool it6505_hdcp_part2_ksvlist_check(struct it6505 *it6505) { struct ...
aa97239300e3f2a9ecbccf7ebfa240860bdddafb
Analyze and fix the following issue in the Linux kernel code: drm/bridge: it6505: fix HDCP CTS KSV list read with UNIGRAF DPR-100.
Problem Details: When running the HDCP CTS test with UNIGRAF DPR-100. KSV list must be read from DP_AUX_HDCP_KSV_FIFO in an AUX request, and can not separate with multiple read requests. The AUX operation command "CMD_AUX_GET_KSV_LIST" reads the KSV list with AUX FIFO and is able to read DP_AUX_HDCP_KSV_FIFO in an AUX...
```diff diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c index 1d3523382bf1..93e4c5c552d0 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -1189,6 +1189,37 @@ static int it6505_get_edid_block(void *data, u8 *buf, unsigned int block, re...
8c01b0bae2f9e58f2fee0e811cb90d8331986554
Analyze and fix the following issue in the Linux kernel code: drm/bridge: it6505: fix HDCP encryption when R0 ready
Problem Details: When starting HDCP authentication, HDCP encryption should be enabled when R0'is checked. Change encryption enables time at R0' ready. The hardware HDCP engine trigger is changed and the repeater KSV fails will restart HDCP. Signed-off-by: Hermes Wu <hermes.wu@ite.com.tw> Reviewed-by: AngeloGioacchino...
```diff diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c index 371ca74bc69c..1d3523382bf1 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2092,15 +2092,12 @@ static void it6505_hdcp_wait_ksv_list(struct work_struct *work) ksv_list_ch...
0fd2ff47d8c207fa3173661de04bb9e8201c0ad2
Analyze and fix the following issue in the Linux kernel code: drm/bridge: it6505: fix HDCP Bstatus check
Problem Details: When HDCP is activated, a DisplayPort source receiving CP_IRQ from the sink shall check Bstatus from DPCD and process the corresponding value Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Hermes Wu <hermes.wu@ite.com.tw> Reviewed-by: AngeloGioacchino Del Regno <angelogioac...
```diff diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c index 84417ffd9b30..371ca74bc69c 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2323,14 +2323,20 @@ static int it6505_process_hpd_irq(struct it6505 *it6505) DRM_DEV_DEBUG_DRIV...
c14870218c14532b0f0a7805b96a4d3c92d06fb2
Analyze and fix the following issue in the Linux kernel code: drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE
Problem Details: The hardware AUX FIFO is 16 bytes Change definition of AUX_FIFO_MAX_SIZE to 16 Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Hermes Wu <hermes.wu@ite.com.tw> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.del...
```diff diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c index 0faad10ba8e4..6a3f76498632 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -300,7 +300,7 @@ #define MAX_CR_LEVEL 0x03 #define MAX_EQ_LEVEL 0x03 #define AUX_WAIT_TIMEOUT_M...
96ea081ed52bf077cad6d00153b6fba68e510767
Analyze and fix the following issue in the Linux kernel code: bpf: Reject struct_ops registration that uses module ptr and the module btf_id is missing
Problem Details: There is a UAF report in the bpf_struct_ops when CONFIG_MODULES=n. In particular, the report is on tcp_congestion_ops that has a "struct module *owner" member. For struct_ops that has a "struct module *owner" member, it can be extended either by the regular kernel module or by the bpf_struct_ops. bpf_...
```diff diff --git a/include/linux/btf.h b/include/linux/btf.h index 4214e76c9168..2a08a2b55592 100644 --- a/include/linux/btf.h +++ b/include/linux/btf.h @@ -353,6 +353,11 @@ static inline bool btf_type_is_scalar(const struct btf_type *t) return btf_type_is_int(t) || btf_type_is_enum(t); } +static inline bool btf...
ed123c948d06688d10f3b10a7bce1d6fbfd1ed07
Analyze and fix the following issue in the Linux kernel code: io_uring/kbuf: use pre-committed buffer address for non-pollable file
Problem Details: For non-pollable files, buffer ring consumption will commit upfront. This is fine, but io_ring_buffer_select() will return the address of the buffer after having committed it. For incrementally consumed buffers, this is incorrect as it will modify the buffer address. Store the pre-committed value and ...
```diff diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c index d407576ddfb7..eec5eb7de843 100644 --- a/io_uring/kbuf.c +++ b/io_uring/kbuf.c @@ -139,6 +139,7 @@ static void __user *io_ring_buffer_select(struct io_kiocb *req, size_t *len, struct io_uring_buf_ring *br = bl->buf_ring; __u16 tail, head = bl->head; stru...
fd604ae6c261c5a56bb977ae99f875bbd7264a3f
Analyze and fix the following issue in the Linux kernel code: cpufreq/amd-pstate: Fix prefcore rankings
Problem Details: commit 50a062a76200 ("cpufreq/amd-pstate: Store the boost numerator as highest perf again") updated the value stored for highest perf to no longer store the highest perf value but instead the boost numerator. This is a fixed value for systems with preferred cores and not appropriate for use ITMT ranki...
```diff diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index d7b1de97727a..2330903a8b45 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -815,7 +815,7 @@ static void amd_pstate_init_prefcore(struct amd_cpudata *cpudata) * sched_set_itmt_support(true) has been ...
656cc2e892f128b03ea9ef19bd11d70f71d5472b
Analyze and fix the following issue in the Linux kernel code: gpio: virtuser: fix handling of multiple conn_ids in lookup table
Problem Details: Creating a virtuser device via configfs with multiple conn_ids fails due to incorrect indexing of lookup entries. Correct the indexing logic to ensure proper functionality when multiple gpio_virtuser_lookup are created. Fixes: 91581c4b3f29 ("gpio: virtuser: new virtual testing driver for the GPIO API"...
```diff diff --git a/drivers/gpio/gpio-virtuser.c b/drivers/gpio/gpio-virtuser.c index e89b1239b635..d6244f0d3bc7 100644 --- a/drivers/gpio/gpio-virtuser.c +++ b/drivers/gpio/gpio-virtuser.c @@ -1410,7 +1410,7 @@ gpio_virtuser_make_lookup_table(struct gpio_virtuser_device *dev) size_t num_entries = gpio_virtuser_get_...
a619cba8c69c434258ff4101d463322cd63e1bdc
Analyze and fix the following issue in the Linux kernel code: gpio: virtuser: fix missing lookup table cleanups
Problem Details: When a virtuser device is created via configfs and the probe fails due to an incorrect lookup table, the table is not removed. This prevents subsequent probe attempts from succeeding, even if the issue is corrected, unless the device is released. Additionally, cleanup is also needed in the less likely ...
```diff diff --git a/drivers/gpio/gpio-virtuser.c b/drivers/gpio/gpio-virtuser.c index 91b6352c957c..e89b1239b635 100644 --- a/drivers/gpio/gpio-virtuser.c +++ b/drivers/gpio/gpio-virtuser.c @@ -1439,6 +1439,15 @@ gpio_virtuser_make_lookup_table(struct gpio_virtuser_device *dev) return 0; } +static void +gpio_virt...
6df90c02bae468a3a6110bafbc659884d0c4966c
Analyze and fix the following issue in the Linux kernel code: dm-verity FEC: Fix RS FEC repair for roots unaligned to block size (take 2)
Problem Details: This patch fixes an issue that was fixed in the commit df7b59ba9245 ("dm verity: fix FEC for RS roots unaligned to block size") but later broken again in the commit 8ca7cab82bda ("dm verity fec: fix misaligned RS roots IO") If the Reed-Solomon roots setting spans multiple blocks, the code does not...
```diff diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c index 62b1a44b8dd2..6bd9848518d4 100644 --- a/drivers/md/dm-verity-fec.c +++ b/drivers/md/dm-verity-fec.c @@ -60,15 +60,19 @@ static int fec_decode_rs8(struct dm_verity *v, struct dm_verity_fec_io *fio, * to the data block. Caller is respons...
09dfc8a5f2ce897005a94bf66cca4f91e4e03700
Analyze and fix the following issue in the Linux kernel code: vfio/pci: Fallback huge faults for unaligned pfn
Problem Details: The PFN must also be aligned to the fault order to insert a huge pfnmap. Test the alignment and fallback when unaligned. Fixes: f9e54c3a2f5b ("vfio/pci: implement huge_fault support") Link: https://bugzilla.kernel.org/show_bug.cgi?id=219619 Reported-by: Athul Krishna <athul.krishna.kr@protonmail.com>...
```diff diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c index 1ab58da9f38a..1a4ed5a357d3 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c @@ -1661,14 +1661,15 @@ static vm_fault_t vfio_pci_mmap_huge_fault(struct vm_fault *vmf, unsigned long pfn, pgo...
866e43b945bf98f8e807dfa45eca92f931f3a032
Analyze and fix the following issue in the Linux kernel code: drm/msm: UAPI error reporting
Problem Details: Debugging incorrect UAPI usage tends to be a bit painful, so add a helper macro to make it easier to add debug logging which can be enabled at runtime via drm.debug. Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com> Patchwork: https://patchwork.fr...
```diff diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c index c7454b6cfb7f..1238f3265978 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c @@ -310,10 +310,11 @@ int adreno_get_param(struct msm_gpu *gpu, struct msm_file_priva...
19dbdbfb747ad7afed88dc7661697744ce192d3b
Analyze and fix the following issue in the Linux kernel code: drm/msm/a5xx: remove null pointer check on pdev
Problem Details: The call chain on a5xx_gpu_init is such that pdev is not going to be null, so the null check on pdev can be removed. This also cleans up a static analysis warning where pdev is dereferenced before the null check which cannot actually occur. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Review...
```diff diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index caf2c0a7a29f..71dca78cd7a5 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -1760,11 +1760,6 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) unsigned int n...
3a47f4b439beb98e955d501c609dfd12b7836d61
Analyze and fix the following issue in the Linux kernel code: drm/msm/gem: prevent integer overflow in msm_ioctl_gem_submit()
Problem Details: The "submit->cmd[i].size" and "submit->cmd[i].offset" variables are u32 values that come from the user via the submit_lookup_cmds() function. This addition could lead to an integer wrapping bug so use size_add() to prevent that. Fixes: 198725337ef1 ("drm/msm: fix cmdstream size check") Cc: stable@vger...
```diff diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index fba78193127d..f775638d239a 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -787,8 +787,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, goto out; ...
0094014be0cd75273ef7f2934c17fb8cffd4db6e
Analyze and fix the following issue in the Linux kernel code: x86/ioapic: Remove a stray tab in the IO-APIC type string
Problem Details: The type "physic al" should be "physical". [ bp: Massage commit message. ] Fixes: 54cd3795b471 ("x86/ioapic: Cleanup guarded debug printk()s") Signed-off-by: Alan Song <syfmark114@163.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20241230065706.16789-1-syf...
```diff diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 1029ea4ac8ba..03062469e1af 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -1165,7 +1165,7 @@ static void io_apic_print_entries(unsigned int apic, unsigned int nr_entries) (entry.ir_index...