id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
668135b9348c53fd205f5e07d11e82b10f31b55b
Analyze and fix the following issue in the Linux kernel code: NFSv4.2: mark OFFLOAD_CANCEL MOVEABLE
Problem Details: OFFLOAD_CANCEL should be marked MOVEABLE for when we need to move tasks off a non-functional transport. Fixes: c975c2092657 ("NFS send OFFLOAD_CANCEL when COPY killed") Signed-off-by: Olga Kornievskaia <okorniev@redhat.com> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
```diff diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index 9d716907cf30..f01a42965254 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -552,7 +552,7 @@ static int nfs42_do_offload_cancel_async(struct file *dst, .rpc_message = &msg, .callback_ops = &nfs42_offload_cancel_ops, .workqueue = nfsi...
e8380c2d06055665b3df6c03964911375d7f9290
Analyze and fix the following issue in the Linux kernel code: NFSv4.2: fix COPY_NOTIFY xdr buf size calculation
Problem Details: We need to include sequence size in the compound. Fixes: 0491567b51ef ("NFS: add COPY_NOTIFY operation") Signed-off-by: Olga Kornievskaia <okorniev@redhat.com> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
```diff diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c index ef5730c5e704..5072d7ea72e9 100644 --- a/fs/nfs/nfs42xdr.c +++ b/fs/nfs/nfs42xdr.c @@ -144,9 +144,11 @@ decode_putfh_maxsz + \ decode_offload_cancel_maxsz) #define NFS4_enc_copy_notify_sz (compound_encode_hdr_maxsz + \ + encode_sequenc...
36f4e9ef84bb334392628bcc21557ddad7dc8e5f
Analyze and fix the following issue in the Linux kernel code: NFS: Fix typo in OFFLOAD_CANCEL comment
Problem Details: Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
```diff diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c index 9e3ae53e2205..ef5730c5e704 100644 --- a/fs/nfs/nfs42xdr.c +++ b/fs/nfs/nfs42xdr.c @@ -549,7 +549,7 @@ static void nfs4_xdr_enc_copy(struct rpc_rqst *req, } /* - * Encode OFFLOAD_CANEL request + * Encode OFFLOAD_CANCEL request */ static void nfs4_xd...
90190ba1c3b11687e2c251fda1f5d9893b4bab17
Analyze and fix the following issue in the Linux kernel code: nfs: Make NFS_FSCACHE select NETFS_SUPPORT instead of depending on it
Problem Details: Having the NFS_FSCACHE option depend on the NETFS_SUPPORT options makes selecting NFS_FSCACHE impossible unless another option that additionally selects NETFS_SUPPORT is already selected. As a result, for example, being able to reach and select the NFS_FSCACHE option requires the CEPH_FS or CIFS optio...
```diff diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig index 0eb20012792f..d3f76101ad4b 100644 --- a/fs/nfs/Kconfig +++ b/fs/nfs/Kconfig @@ -170,7 +170,8 @@ config ROOT_NFS config NFS_FSCACHE bool "Provide NFS client caching support" - depends on NFS_FS=m && NETFS_SUPPORT || NFS_FS=y && NETFS_SUPPORT=y + depends on ...
ead11ac50ad4b8ef1b64806e962ea984862d96ad
Analyze and fix the following issue in the Linux kernel code: nfs: fix incorrect error handling in LOCALIO
Problem Details: nfs4_stat_to_errno() expects a NFSv4 error code as an argument and returns a POSIX errno. The problem is LOCALIO is passing nfs4_stat_to_errno() the POSIX errno return values from filp->f_op->read_iter(), filp->f_op->write_iter() and vfs_fsync_range(). So the POSIX errno that nfs_local_pgio_done() an...
```diff diff --git a/fs/nfs/localio.c b/fs/nfs/localio.c index 1eee5aac2884..5c21caeae075 100644 --- a/fs/nfs/localio.c +++ b/fs/nfs/localio.c @@ -388,7 +388,7 @@ nfs_local_pgio_done(struct nfs_pgio_header *hdr, long status) hdr->res.op_status = NFS4_OK; hdr->task.tk_status = 0; } else { - hdr->res.op_status =...
e02938613eb206ebf788e2d3d4fccf534e4ea12e
Analyze and fix the following issue in the Linux kernel code: f2fs: avoid trying to get invalid block address
Problem Details: In f2fs_new_inode(), if we fail to get a new inode, we go iput(), followed by f2fs_evict_inode(). If the inode is not marked as bad, it'll try to call f2fs_remove_inode_page() which tries to read the inode block given node id. But, there's no block address allocated yet, which gives a chance to access ...
```diff diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 57d46e1439de..a278c7da8177 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -341,6 +341,7 @@ fail_drop: trace_f2fs_new_inode(inode, err); dquot_drop(inode); inode->i_flags |= S_NOQUOTA; + make_bad_inode(inode); if (nid_free) set_inode_flag(ino...
235c2b197a8de2887f13990094a3343d2392155b
Analyze and fix the following issue in the Linux kernel code: PCI: endpoint: pci-epf-test: Fix check for DMA MEMCPY test
Problem Details: Currently, if DMA MEMCPY test is requested by the host, and if the endpoint DMA controller supports DMA_PRIVATE, the test will fail. This is not correct since there is no check for DMA_MEMCPY capability and the DMA controller can support both DMA_PRIVATE and DMA_MEMCPY. Fix the check and also reword t...
```diff diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c index d90c8be7371e..b2fdd8c82c43 100644 --- a/drivers/pci/endpoint/functions/pci-epf-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-test.c @@ -328,8 +328,8 @@ static void pci_epf_test_copy(struct pci_...
b1b1f4b12969130c0a6ec0cf0299460cb01e799c
Analyze and fix the following issue in the Linux kernel code: PCI: endpoint: pci-epf-test: Set dma_chan_rx pointer to NULL on error
Problem Details: If dma_chan_tx allocation fails, set dma_chan_rx to NULL after it is freed. Link: https://lore.kernel.org/r/20241227160841.92382-1-khalfella@gmail.com Fixes: 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities") Signed-off-by: Mohamed Khalfella <khalfella@gmail.com> [kwi...
```diff diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c index ef6677f34116..d90c8be7371e 100644 --- a/drivers/pci/endpoint/functions/pci-epf-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-test.c @@ -251,7 +251,7 @@ static int pci_epf_test_init_dma_chan(str...
3028583d1314a70ca273c51e0265f698c0bd5760
Analyze and fix the following issue in the Linux kernel code: regulator: TPS6287X: Use min/max uV to get VRANGE
Problem Details: Changing voltage might ignore slew rate and cause a current surge. With current implementation the driver will get the regulator to change the voltage range used during run time. According to communication I have had with Texas Instruments, this is not intended, since the Dynamic Voltage Scaling in th...
```diff diff --git a/drivers/regulator/tps6287x-regulator.c b/drivers/regulator/tps6287x-regulator.c index 97f5ce138548..c0f5f0a186a3 100644 --- a/drivers/regulator/tps6287x-regulator.c +++ b/drivers/regulator/tps6287x-regulator.c @@ -44,10 +44,35 @@ static const unsigned int tps6287x_voltage_range_sel[] = { 0x0, 0x1...
5323186e2e8d33c073fad51e24f18e2d6dbae2da
Analyze and fix the following issue in the Linux kernel code: ASoC: rockchip: i2s_tdm: Re-add the set_sysclk callback
Problem Details: In commit 9e2ab4b18ebd ("ASoC: rockchip: i2s-tdm: Fix inaccurate sampling rates"), the set_sysclk callback was removed as considered unused as the mclk rate can be set in the hw_params callback. The difference between hw_params and set_sysclk is that the former is called with the audio sampling rate se...
```diff diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c index bd0dc586e24a..7f5fcaecee4b 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -22,7 +22,6 @@ #define DRV_NAME "rockchip-i2s-tdm" -#define DEFAULT_MCLK_FS 256 #...
42fdbe94b69ceed77622e58b33701546f49283a4
Analyze and fix the following issue in the Linux kernel code: drm/i915: Allow fastboot to fix up the vblank delay
Problem Details: GOP might not agree with our idea of what the vblank delay should be. Reuse the LRR codepaths to fix that up via a fastset. The relevant registers aren't actually double buffered so this is a little bit dodgy. While I've not seen any real issues from frobbing these live, let's limit this to just the f...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index b5e38137ef4d..950505c94224 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -5358,6 +5358,19 @@ pipe_config_cx0pll_mismatch(struct drm_pri...
8a2392fec5b4b96d738feb6ecef02b9958bb64b1
Analyze and fix the following issue in the Linux kernel code: drm/xe/dp: Fix non-display builds with DP tunnelling incorrectly enabled
Problem Details: Code for the DP tunnelling functionality in the xe driver can be built only if the display code is also built, adjust the kconfig dependency accordingly. Cc: Suraj Kandpal <suraj.kandpal@intel.com> Fixes: 73900dce57e4 ("drm/xe/dp: Enable DP tunneling") Reported-by: Lucas De Marchi <lucas.demarchi@inte...
```diff diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig index 50cf80df5190..99219c16e8aa 100644 --- a/drivers/gpu/drm/xe/Kconfig +++ b/drivers/gpu/drm/xe/Kconfig @@ -61,7 +61,7 @@ config DRM_XE_DISPLAY config DRM_XE_DP_TUNNEL bool "Enable DP tunnel support" - depends on DRM_XE + depends on DRM...
b73de0da50129d790975bb8a9893b421cc38bc24
Analyze and fix the following issue in the Linux kernel code: io_uring/rsrc: remove unused parameter ctx for io_rsrc_node_alloc()
Problem Details: io_uring_ctx parameter for io_rsrc_node_alloc() is unused for now. This patch removes the parameter and fixes the callers accordingly. Signed-off-by: Sidong Yang <sidong.yang@furiosa.ai> Link: https://lore.kernel.org/r/20250115142033.658599-1-sidong.yang@furiosa.ai Signed-off-by: Jens Axboe <axboe@ker...
```diff diff --git a/io_uring/filetable.c b/io_uring/filetable.c index a21660e3145a..dd8eeec97acf 100644 --- a/io_uring/filetable.c +++ b/io_uring/filetable.c @@ -68,7 +68,7 @@ static int io_install_fixed_file(struct io_ring_ctx *ctx, struct file *file, if (slot_index >= ctx->file_table.data.nr) return -EINVAL; ...
5719e2823565a304a2afb752d4792c622a693e22
Analyze and fix the following issue in the Linux kernel code: io_uring/rsrc: Simplify buffer cloning by locking both rings
Problem Details: The locking in the buffer cloning code is somewhat complex because it goes back and forth between locking the source ring and the destination ring. Make it easier to reason about by locking both rings at the same time. To avoid ABBA deadlocks, lock the rings in ascending kernel address order, just lik...
```diff diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index e32ac5853391..a1c7c8db5545 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -921,6 +921,16 @@ int io_import_fixed(int ddir, struct iov_iter *iter, return 0; } +/* Lock two rings at once. The rings must be different! */ +static void lock_two_rings(st...
2218704997979fbf11765281ef752f07c5cf25bb
Analyze and fix the following issue in the Linux kernel code: drm/xe: Remove double pageflip
Problem Details: This is already handled below in the code by fixup_initial_plane_config. Fixes: a8153627520a ("drm/i915: Try to relocate the BIOS fb to the start of ggtt") Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com> Reviewed-by: Lucas De Marchi <l...
```diff diff --git a/drivers/gpu/drm/xe/display/xe_plane_initial.c b/drivers/gpu/drm/xe/display/xe_plane_initial.c index 2eb9633f163a..2a2f250fa495 100644 --- a/drivers/gpu/drm/xe/display/xe_plane_initial.c +++ b/drivers/gpu/drm/xe/display/xe_plane_initial.c @@ -194,8 +194,6 @@ intel_find_initial_plane_obj(struct intel...
a46ea12eca59fd3741ddfec3042d43f87fadf58f
Analyze and fix the following issue in the Linux kernel code: drm/xe/uapi: Fix documentation indentation
Problem Details: Fix these issues: Documentation/gpu/driver-uapi:29: include/uapi/drm/xe_drm.h:817: WARNING: +Bullet list ends without a blank line; unexpected unindent. Documentation/gpu/driver-uapi:29: include/uapi/drm/xe_drm.h:835: WARNING: +Definition list ends without a blank line; unexpected unindent. Fixes: 75...
```diff diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h index cac607a30f6d..e2160330ad01 100644 --- a/include/uapi/drm/xe_drm.h +++ b/include/uapi/drm/xe_drm.h @@ -814,29 +814,29 @@ struct drm_xe_gem_create { * * The @flags can be: * - %DRM_XE_MMAP_OFFSET_FLAG_PCI_BARRIER - For user to query s...
a07eb4f67ed085f32002a1af2b6073546d67de3f
Analyze and fix the following issue in the Linux kernel code: spi: omap2-mcspi: Correctly handle devm_clk_get_optional() errors
Problem Details: devm_clk_get_optional() returns NULL for missing clocks and a PTR_ERR() if there is a clock but we fail to get it, but currently we only handle the latter case and do so as though the clock was missing. If we get an error back we should handle that as an error since the clock exists but we failed to g...
```diff diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index add6247d3481..29c616e2c408 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -1561,10 +1561,15 @@ static int omap2_mcspi_probe(struct platform_device *pdev) } mcspi->ref_clk = devm_clk_get_opti...
3429dd57f0deb1a602c2624a1dd7c4c11b6c4734
Analyze and fix the following issue in the Linux kernel code: sched/fair: Fix inaccurate h_nr_runnable accounting with delayed dequeue
Problem Details: set_delayed() adjusts cfs_rq->h_nr_runnable for the hierarchy when an entity is delayed irrespective of whether the entity corresponds to a task or a cfs_rq. Consider the following scenario: root / \ A B (*) delayed since B is no longer eligible on root | | Task0 ...
```diff diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 26958431deb7..f4e4d3ed943c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5372,6 +5372,15 @@ static __always_inline void return_cfs_rq_runtime(struct cfs_rq *cfs_rq); static void set_delayed(struct sched_entity *se) { se->sched_del...
f4a9dd57e549a17a7dac1c1defec26abd7e5c2d4
Analyze and fix the following issue in the Linux kernel code: drm/modeset: Handle tiled displays in pan_display_atomic.
Problem Details: Tiled displays have a different x/y offset to begin with. Instead of attempting to remember this, just apply a delta instead. This fixes the first tile being duplicated on other tiles when vt switching. Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/ms...
```diff diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index c9008113111b..fb3614a7ba44 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1354,14 +1354,14 @@ int drm_fb_helper_set_par(struct fb_info *info) } EXPORT_SYMBOL(drm_fb_helper_set_par); -...
885f5669f2abd0db34c9832259f77240d5350e36
Analyze and fix the following issue in the Linux kernel code: pmdomain: airoha: Fix compilation error with Clang-20 and Thumb2 mode
Problem Details: The use of R7 in the SMCCC conflicts with the compiler's use of R7 as a frame pointer in Thumb2 mode, which is forcibly enabled by Clang when profiling hooks are inserted via the -pg switch. This is a known issue and similar driver workaround this with a Makefile ifdef. Exact workaround are applied in...
```diff diff --git a/drivers/pmdomain/mediatek/Makefile b/drivers/pmdomain/mediatek/Makefile index 0f6edce9239b..18ba92e3c418 100644 --- a/drivers/pmdomain/mediatek/Makefile +++ b/drivers/pmdomain/mediatek/Makefile @@ -2,3 +2,10 @@ obj-$(CONFIG_MTK_SCPSYS) += mtk-scpsys.o obj-$(CONFIG_MTK_SCPSYS_PM_DOMAINS) += mtk-...
e8d9fab39d1f87b52932646b2f1e7877aa3fc0f4
Analyze and fix the following issue in the Linux kernel code: KEYS: trusted: dcp: fix improper sg use with CONFIG_VMAP_STACK=y
Problem Details: With vmalloc stack addresses enabled (CONFIG_VMAP_STACK=y) DCP trusted keys can crash during en- and decryption of the blob encryption key via the DCP crypto driver. This is caused by improperly using sg_init_one() with vmalloc'd stack buffers (plain_key_blob). Fix this by always using kmalloc() for b...
```diff diff --git a/security/keys/trusted-keys/trusted_dcp.c b/security/keys/trusted-keys/trusted_dcp.c index e908c53a803c..7b6eb655df0c 100644 --- a/security/keys/trusted-keys/trusted_dcp.c +++ b/security/keys/trusted-keys/trusted_dcp.c @@ -201,12 +201,16 @@ static int trusted_dcp_seal(struct trusted_key_payload *p, ...
5f56d41a21b6d17b59525958a57feffe597b7de5
Analyze and fix the following issue in the Linux kernel code: keys: drop shadowing dead prototype
Problem Details: The global variable pkcs7 does not exist. Drop the variable declaration, but keep the struct prototype needed for is_key_on_revocation_list(). Reported by clang: ./include/keys/system_keyring.h:104:67: warning: declaration shadows a variable in the global scope [-Wshadow] 104 | static inlin...
```diff diff --git a/include/keys/system_keyring.h b/include/keys/system_keyring.h index 8365adf842ef..a6c2897bcc63 100644 --- a/include/keys/system_keyring.h +++ b/include/keys/system_keyring.h @@ -73,7 +73,6 @@ static inline void __init set_machine_trusted_keys(struct key *keyring) } #endif -extern struct pkcs7_m...
9bcbb6104a344d3526e185ee1e7b985509914e90
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Flush hyp bss section after initialization of variables in bss
Problem Details: To determine CPU features during initialization, the nVHE hypervisor utilizes sanitized values of the host's CPU features registers. These values, stored in u64 idaa64*_el1_sys_val variables are updated by the kvm_hyp_init_symbols() function at EL1. To ensure EL2 visibility with the MMU off, the data c...
```diff diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index bcc4f7e92634..0725a0b50a3e 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -2400,6 +2400,13 @@ static void kvm_hyp_init_symbols(void) kvm_nvhe_sym(id_aa64smfr0_el1_sys_val) = read_sanitised_ftr_reg(SYS_ID_AA64SMFR0_EL1); kvm_nvhe...
40724ecafccb1fb62b66264854e8c3ad394c8f3d
Analyze and fix the following issue in the Linux kernel code: rseq: Fix rseq unregistration regression
Problem Details: A logic inversion in rseq_reset_rseq_cpu_node_id() causes the rseq unregistration to fail when rseq_validate_ro_fields() succeeds rather than the opposite. This affects both CONFIG_DEBUG_RSEQ=y and CONFIG_DEBUG_RSEQ=n. Fixes: 7d5265ffcd8b ("rseq: Validate read-only fields under DEBUG_RSEQ config") Si...
```diff diff --git a/kernel/rseq.c b/kernel/rseq.c index e04bb30a2eb8..442aba29bc4c 100644 --- a/kernel/rseq.c +++ b/kernel/rseq.c @@ -201,7 +201,7 @@ static int rseq_reset_rseq_cpu_node_id(struct task_struct *t) /* * Validate read-only rseq fields. */ - if (!rseq_validate_ro_fields(t)) + if (rseq_validate_ro_f...
08bd5b7c9a2401faabdaa1472d45c7de0755fd7e
Analyze and fix the following issue in the Linux kernel code: Input: synaptics - fix crash when enabling pass-through port
Problem Details: When enabling a pass-through port an interrupt might come before psmouse driver binds to the pass-through port. However synaptics sub-driver tries to access psmouse instance presumably associated with the pass-through port to figure out if only 1 byte of response or entire protocol packet needs to be f...
```diff diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 2735f86c23cc..aba57abe6978 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -665,23 +665,50 @@ static void synaptics_pt_stop(struct serio *serio) priv->pt_port = NULL; } +static int syn...
17391cb2613b82f8c405570fea605af3255ff8d2
Analyze and fix the following issue in the Linux kernel code: powerpc/pseries/iommu: Don't unset window if it was never set
Problem Details: On pSeries, when user attempts to use the same vfio container used by different iommu group, the spapr_tce_set_window() returns -EPERM and the subsequent cleanup leads to the below crash. Kernel attempted to read user page (308) - exploit attempt? BUG: Kernel NULL pointer dereference on read at ...
```diff diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index 29f1a0cc59cd..ae6f7a235d8b 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c @@ -2208,6 +2208,9 @@ static long spapr_tce_unset_window(struct iommu_table_group *table_...
11b93559000c686ad7e5ab0547e76f21cc143844
Analyze and fix the following issue in the Linux kernel code: powerpc/pseries/eeh: Fix get PE state translation
Problem Details: The PE Reset State "0" returned by RTAS calls "ibm_read_slot_reset_[state|state2]" indicates that the reset is deactivated and the PE is in a state where MMIO and DMA are allowed. However, the current implementation of "pseries_eeh_get_state()" does not reflect this, causing drivers to incorrectly assu...
```diff diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c index 1893f66371fa..b12ef382fec7 100644 --- a/arch/powerpc/platforms/pseries/eeh_pseries.c +++ b/arch/powerpc/platforms/pseries/eeh_pseries.c @@ -580,8 +580,10 @@ static int pseries_eeh_get_state(struct eeh_...
2499212e21601740ed7d5563563f39cf7e7d833a
Analyze and fix the following issue in the Linux kernel code: drm/i915/hdcp: Use correct function to check if encoder is HDMI
Problem Details: Use intel_encoder_is_hdmi function which was recently introduced to see if encoder is HDMI or not. --v2 -Add Fixes tag [Jani] Fixes: 6a3691ca4799 ("drm/i915/hdcp: Disable HDCP Line Rekeying for HDCP2.2 on HDMI") Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com> Reviewed-by: Jani Nikula <jani.nik...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index c60b22aaa819..1bab7c34a794 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -41,7 +41,7 @@ intel_hdcp_adjust_hdcp_line_rekeying(struct intel_encoder *...
d640627663bfe7d8963c7615316d7d4ef60f3b0b
Analyze and fix the following issue in the Linux kernel code: net/rose: prevent integer overflows in rose_setsockopt()
Problem Details: In case of possible unpredictably large arguments passed to rose_setsockopt() and multiplied by extra values on top of that, integer overflows may occur. Do the safest minimum and fix these issues by checking the contents of 'opt' and returning -EINVAL if they are too large. Also, switch to unsigned i...
```diff diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 59050caab65c..72c65d938a15 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c @@ -397,15 +397,15 @@ static int rose_setsockopt(struct socket *sock, int level, int optname, { struct sock *sk = sock->sk; struct rose_sock *rose = rose_sk(sk); - ...
b1754a69e7be48a64b3cdb0df60a96d97959da73
Analyze and fix the following issue in the Linux kernel code: net: phylink: fix regression when binding a PHY
Problem Details: Some PHYs don't support clause 45 access, and return -EOPNOTSUPP from phy_modify_mmd(), which causes phylink_bringup_phy() to fail. Prevent this failure by allowing -EOPNOTSUPP to also mean success. Reported-by: Jiawen Wu <jiawenwu@trustnetic.com> Tested-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-...
```diff diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index d130634d3bc7..214b62fba991 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -2268,7 +2268,11 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy, /* Explicitly configure whether the PHY i...
22412b72cafd1b2570c2f9f14b7a133bdff8b80c
Analyze and fix the following issue in the Linux kernel code: tracing: Rename update_cache() to update_mod_cache()
Problem Details: The static function in trace_events.c called update_cache() is too generic and conflicts with the function defined in arch/openrisc/include/asm/pgtable.h Rename it to update_mod_cache() to make it less generic. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@effici...
```diff diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index bb1406719c3f..51c5014877e8 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -3580,7 +3580,7 @@ EXPORT_SYMBOL_GPL(trace_remove_event_call); event++) #ifdef CONFIG_MODULES -static void update_cache(...
71ca4715151e033c16427b8cfaa9b5393dd6a010
Analyze and fix the following issue in the Linux kernel code: drm/i915: Relocate xe AUX hack
Problem Details: Move the xe AUX neutering out from skl_get_plane_caps() into the caller so that it'll be easier to refactor skl_get_plane_caps() into a more readable shape. This isn't really hardware specific anyway, and just some kind of bug/misfeature of xe. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.c...
```diff diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c index 4bede904e1b5..aa8a38c0ca3c 100644 --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c @@ -2652,9 +2652,6 @@ static u8 skl_get_p...
f6f2e946aa4da1b378f44dbc79708b546f2a0c0e
Analyze and fix the following issue in the Linux kernel code: net: mii: Fix the Speed display when the network cable is not connected
Problem Details: Two different models of usb card, the drivers are r8152 and asix. If no network cable is connected, Speed = 10Mb/s. This problem is repeated in linux 3.10, 4.19, 5.4, 6.12. This problem also exists on the latest kernel. Both drivers call mii_ethtool_get_link_ksettings, but the value of cmd->base.speed ...
```diff diff --git a/drivers/net/mii.c b/drivers/net/mii.c index 22680f47385d..37bc3131d31a 100644 --- a/drivers/net/mii.c +++ b/drivers/net/mii.c @@ -213,6 +213,9 @@ void mii_ethtool_get_link_ksettings(struct mii_if_info *mii, lp_advertising = 0; } + if (!(bmsr & BMSR_LSTATUS)) + cmd->base.speed = SPEED_UNKNOW...
bee018052d1bbfa6d33ca016a42e8e2534429492
Analyze and fix the following issue in the Linux kernel code: eth: bnxt: allocate enough buffer space to meet HDS threshold
Problem Details: Now that we can configure HDS threshold separately from the rx_copybreak HDS threshold may be higher than rx_copybreak. We need to make sure that we have enough space for the headers. Fixes: 6b43673a25c3 ("bnxt_en: add support for hds-thresh ethtool command") Reviewed-by: Michael Chan <michael.chan@b...
```diff diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 2eeed4c11b64..19e723493c4e 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -4671,9 +4671,10 @@ void bnxt_set_ring_params(struct bnxt *bp) ALIG...
e58263e9111733c4bfbbf07517d1f98f21134c52
Analyze and fix the following issue in the Linux kernel code: eth: bnxt: apply hds_thrs settings correctly
Problem Details: Use the pending config for hds_thrs. Core will only update the "current" one after we return success. Without this change 2 reconfigs would be required for the setting to reach the device. Fixes: 6b43673a25c3 ("bnxt_en: add support for hds-thresh ethtool command") Reviewed-by: Michael Chan <michael.ch...
```diff diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 0998b20578b4..2eeed4c11b64 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -6585,7 +6585,7 @@ static void bnxt_hwrm_update_rss_hash_cfg(struct bnxt *...
df1b8d6e89db0edd572a1e375f5d3dd5575b9a9b
Analyze and fix the following issue in the Linux kernel code: MIPS: pci-legacy: Override pci_address_to_pio
Problem Details: pci-legacy systems are not using logic_pio to managed PIO allocations, thus the generic pci_address_to_pio won't work when PCI_IOBASE is defined. Override the function to use architecture implementation to fix the problem. Cc: stable@vger.kernel.org Fixes: 4bfb53e7d317 ("mips: add <asm-generic/io.h> ...
```diff diff --git a/arch/mips/pci/pci-legacy.c b/arch/mips/pci/pci-legacy.c index ec2567f8efd8..66898fd182dc 100644 --- a/arch/mips/pci/pci-legacy.c +++ b/arch/mips/pci/pci-legacy.c @@ -29,6 +29,14 @@ static LIST_HEAD(controllers); static int pci_initialized; +unsigned long pci_address_to_pio(phys_addr_t address)...
454d402481d45af79ee7eea7e64bce02bbbe9766
Analyze and fix the following issue in the Linux kernel code: net: dropreason: Gather SOCKET_ drop reasons.
Problem Details: The following patch adds a new drop reason starting with the SOCKET_ prefix. Let's gather the existing SOCKET_ reasons. Note that the order is not part of uAPI. Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Link: https://patch.msgid.link/20250116053441.5758-2-kuniyu@amazon.com Signed-off-by: ...
```diff diff --git a/include/net/dropreason-core.h b/include/net/dropreason-core.h index ed864934e20b..f3714cbea50d 100644 --- a/include/net/dropreason-core.h +++ b/include/net/dropreason-core.h @@ -6,9 +6,10 @@ #define DEFINE_DROP_REASON(FN, FNe) \ FN(NOT_SPECIFIED) \ FN(NO_SOCKET) \ + FN(SOCKET_FILTER) \ + F...
3a0b7fa095212b51ed63892540c4f249991a2d74
Analyze and fix the following issue in the Linux kernel code: selftests/net/ipsec: Fix Null pointer dereference in rtattr_pack()
Problem Details: Address Null pointer dereference / undefined behavior in rtattr_pack (note that size is 0 in the bad case). Flagged by cppcheck as: tools/testing/selftests/net/ipsec.c:230:25: warning: Possible null pointer dereference: payload [nullPointer] memcpy(RTA_DATA(attr), payload, size); ...
```diff diff --git a/tools/testing/selftests/net/ipsec.c b/tools/testing/selftests/net/ipsec.c index be4a30a0d02a..9b44a091802c 100644 --- a/tools/testing/selftests/net/ipsec.c +++ b/tools/testing/selftests/net/ipsec.c @@ -227,7 +227,8 @@ static int rtattr_pack(struct nlmsghdr *nh, size_t req_sz, attr->rta_len = RT...
b881532991f81f5e3a069fe6d1a3e091400042b5
Analyze and fix the following issue in the Linux kernel code: PCI: imx6: Clean up comments and whitespace
Problem Details: For readability, fix typos and comments that needlessly exceed 80 columns. Link: https://lore.kernel.org/r/20250118210727.795559-1-helgaas@kernel.org Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Frank Li <Frank.Li@nxp.com>
```diff diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 06d22f23c6b3..d70e6c427976 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -236,11 +236,11 @@ static void imx_pcie_configure_type(struct imx_pcie *imx_pcie) id =...
a925df6f5036013b6592eef28f7ec4a45bf465a9
Analyze and fix the following issue in the Linux kernel code: tracing: Fix #if CONFIG_MODULES to #ifdef CONFIG_MODULES
Problem Details: A typo was introduced when adding the ":mod:" command that did a "#if CONFIG_MODULES" instead of a "#ifdef CONFIG_MODULES". Fix it. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.ke...
```diff diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index f762e554fad4..bb1406719c3f 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -857,7 +857,7 @@ static int ftrace_event_enable_disable(struct trace_event_file *file, return __ftrace_event_enable_disable(file...
58f038e6d209d2dd862fcf5de55407855856794d
Analyze and fix the following issue in the Linux kernel code: bpf: Cancel the running bpf_timer through kworker for PREEMPT_RT
Problem Details: During the update procedure, when overwrite element in a pre-allocated htab, the freeing of old_element is protected by the bucket lock. The reason why the bucket lock is necessary is that the old_element has already been stashed in htab->extra_elems after alloc_htab_elem() returns. If freeing the old_...
```diff diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index bcda671feafd..f27ce162427a 100644 --- a/kernel/bpf/helpers.c +++ b/kernel/bpf/helpers.c @@ -1593,10 +1593,24 @@ void bpf_timer_cancel_and_free(void *val) * To avoid these issues, punt to workqueue context when we are in a * timer callback. ...
47363f1553e69b8c2e3269f9883799a4ea898cd4
Analyze and fix the following issue in the Linux kernel code: bpf: Free element after unlock in __htab_map_lookup_and_delete_elem()
Problem Details: The freeing of special fields in map value may acquire a spin-lock (e.g., the freeing of bpf_timer), however, the lookup_and_delete_elem procedure has already held a raw-spin-lock, which violates the lockdep rule. The running context of __htab_map_lookup_and_delete_elem() has already disabled the migr...
```diff diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c index 6545ef40e128..4a9eeb7aef85 100644 --- a/kernel/bpf/hashtab.c +++ b/kernel/bpf/hashtab.c @@ -1663,14 +1663,16 @@ static int __htab_map_lookup_and_delete_elem(struct bpf_map *map, void *key, check_and_init_map_value(map, value); } hlist_nulls_d...
3d49020a327cd7d069059317c11df24e407ccfa3
Analyze and fix the following issue in the Linux kernel code: iommufd/fault: Use a separate spinlock to protect fault->deliver list
Problem Details: The fault->mutex serializes the fault read()/write() fops and the iommufd_fault_auto_response_faults(), mainly for fault->response. Also, it was conveniently used to fence the fault->deliver in poll() fop and iommufd_fault_iopf_handler(). However, copy_from/to_user() may sleep if pagefaults are enable...
```diff diff --git a/drivers/iommu/iommufd/fault.c b/drivers/iommu/iommufd/fault.c index 685510224d05..a9160f4443d2 100644 --- a/drivers/iommu/iommufd/fault.c +++ b/drivers/iommu/iommufd/fault.c @@ -103,15 +103,23 @@ static void iommufd_auto_response_faults(struct iommufd_hw_pagetable *hwpt, { struct iommufd_fault *...
abe01a78bfc8be9cc025a73b991c4e77431de9de
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl_asrc_m2m: return error value in asrc_m2m_device_run()
Problem Details: The asrc_m2m_device_run() function is the main process function of converting, the error need to be returned to user, that user can handle error case properly. Fixes: 24a01710f627 ("ASoC: fsl_asrc_m2m: Add memory to memory function") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Da...
```diff diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c index ab9033ccb01e..f46881f71e43 100644 --- a/sound/soc/fsl/fsl_asrc_m2m.c +++ b/sound/soc/fsl/fsl_asrc_m2m.c @@ -183,7 +183,7 @@ static int asrc_dmaconfig(struct fsl_asrc_pair *pair, } /* main function of converter */ -static void asr...
d12ca6d4c31bf974ecc80e36761488f41d05d18b
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl_asrc_m2m: only handle pairs for m2m in the suspend
Problem Details: ASRC memory to memory cases and memory to peripheral cases are sharing the same pair pools, the pairs got for m2m suspend function may be used for memory to peripheral, which is handled memory to peripheral driver and can't be handled in memory to memory suspend function. Use the "pair->dma_buffer" as...
```diff diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c index 4906843e2a8f..ab9033ccb01e 100644 --- a/sound/soc/fsl/fsl_asrc_m2m.c +++ b/sound/soc/fsl/fsl_asrc_m2m.c @@ -633,7 +633,7 @@ int fsl_asrc_m2m_suspend(struct fsl_asrc *asrc) for (i = 0; i < PAIR_CTX_NUM; i++) { pair = asrc->pair...
1256961d865cb6e8ab131351283036117f895283
Analyze and fix the following issue in the Linux kernel code: ALSA: hda: tas2781-spi: Fix -Wsometimes-uninitialized in tasdevice_spi_switch_book()
Problem Details: Clang warns (or errors with CONFIG_WERROR=y): sound/pci/hda/tas2781_hda_spi.c:110:6: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] 110 | if (tas_priv->cur_book != TASDEVICE_BOOK_ID(reg)) { | ^~~~~~~~~~...
```diff diff --git a/sound/pci/hda/tas2781_hda_spi.c b/sound/pci/hda/tas2781_hda_spi.c index 8068c70b7014..5be71b538ce0 100644 --- a/sound/pci/hda/tas2781_hda_spi.c +++ b/sound/pci/hda/tas2781_hda_spi.c @@ -105,18 +105,17 @@ static const struct regmap_config tasdevice_regmap = { static int tasdevice_spi_switch_book(st...
25c1a9ca53db5780757e7f53e688b8f916821baa
Analyze and fix the following issue in the Linux kernel code: tcp_cubic: fix incorrect HyStart round start detection
Problem Details: I noticed that HyStart incorrectly marks the start of rounds, leading to inaccurate measurements of ACK train lengths and resetting the `ca->sample_cnt` variable. This inaccuracy can impact HyStart's functionality in terminating exponential cwnd growth during Slow-Start, potentially degrading TCP perfo...
```diff diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c index 5dbed91c6178..76c23675ae50 100644 --- a/net/ipv4/tcp_cubic.c +++ b/net/ipv4/tcp_cubic.c @@ -392,6 +392,10 @@ static void hystart_update(struct sock *sk, u32 delay) if (after(tp->snd_una, ca->end_seq)) bictcp_hystart_reset(sk); + /* hystart tr...
5fe71fda89745fc3cd95f70d06e9162b595c3702
Analyze and fix the following issue in the Linux kernel code: tipc: re-order conditions in tipc_crypto_key_rcv()
Problem Details: On a 32bit system the "keylen + sizeof(struct tipc_aead_key)" math could have an integer wrapping issue. It doesn't matter because the "keylen" is checked on the next line, but just to make life easier for static analysis tools, let's re-order these conditions and avoid the integer overflow. Signed-o...
```diff diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c index 43c3f1c971b8..c524421ec652 100644 --- a/net/tipc/crypto.c +++ b/net/tipc/crypto.c @@ -2293,8 +2293,8 @@ static bool tipc_crypto_key_rcv(struct tipc_crypto *rx, struct tipc_msg *hdr) keylen = ntohl(*((__be32 *)(data + TIPC_AEAD_ALG_NAME))); /* Verify...
3ef4ea516c2f8a2f1ff8ca59b156fb2e4472c2a4
Analyze and fix the following issue in the Linux kernel code: platform/x86: acer-wmi: Fix initialization of last_non_turbo_profile
Problem Details: On machines that do not support the balanced profile the value of last_non_turbo_profile is invalid after initialization which might cause the driver to switch to an unsupported platform profile later. Fix this by only setting last_non_turbo_profile to supported platform profile values. Fixes: 191e21...
```diff diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index a85c881d1f24..69336bd778ee 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -792,7 +792,7 @@ static bool platform_profile_support; * The profile used before turbo mode. This variable is ne...
68e6b7d98bc64bbf1a54d963ca85111432f3a0b4
Analyze and fix the following issue in the Linux kernel code: samples/vfs: fix build warnings
Problem Details: Fix build warnings reported from linux-next. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Link: https://lore.kernel.org/r/20250120192504.4a1965a0@canb.auug.org.au Signed-off-by: Christian Brauner <brauner@kernel.org>
```diff diff --git a/samples/vfs/test-list-all-mounts.c b/samples/vfs/test-list-all-mounts.c index 23d028881263..1a02ea4593e3 100644 --- a/samples/vfs/test-list-all-mounts.c +++ b/samples/vfs/test-list-all-mounts.c @@ -5,6 +5,7 @@ #include <errno.h> #include <limits.h> #include <linux/types.h> +#include <inttypes.h>...
f9d94f78a8749e15de8aeb2e281898aa980e62d9
Analyze and fix the following issue in the Linux kernel code: samples/vfs: use shared header
Problem Details: Share some infrastructure between sample programs and fix a build failure that was reported. Reported-by: Sasha Levin <sashal@kernel.org> Link: https://lore.kernel.org/r/Z42UkSXx0MS9qZ9w@lappy Link: https://qa-reports.linaro.org/lkft/sashal-linus-next/build/v6.13-rc7-511-g109a8e0fa9d6/testrun/26809210...
```diff diff --git a/samples/vfs/mountinfo.c b/samples/vfs/mountinfo.c index f47c035cc339..bc78275cac69 100644 --- a/samples/vfs/mountinfo.c +++ b/samples/vfs/mountinfo.c @@ -8,11 +8,6 @@ #define __SANE_USERSPACE_TYPES__ #include <stdio.h> #include <stdint.h> -#include <sys/ioctl.h> -#include <sys/syscall.h> -#inclu...
4395a44acb15850e492dd1de9ec4b6479d96bc80
Analyze and fix the following issue in the Linux kernel code: net: ethernet: ti: am65-cpsw: fix freeing IRQ in am65_cpsw_nuss_remove_tx_chns()
Problem Details: When getting the IRQ we use k3_udma_glue_tx_get_irq() which returns negative error value on error. So not NULL check is not sufficient to deteremine if IRQ is valid. Check that IRQ is greater then zero to ensure it is valid. There is no issue at probe time but at runtime user can invoke .set_channels ...
```diff diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index 5465bf872734..e1de45fb18ae 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -2248,7 +2248,7 @@ static void am65_cpsw_nuss_remove_tx_chns(struct am65_cpsw_...
6d002348789bc16e9203e9818b7a3688787e3b29
Analyze and fix the following issue in the Linux kernel code: Grab mm lock before grabbing pt lock
Problem Details: Function xen_pin_page calls xen_pte_lock, which in turn grab page table lock (ptlock). When locking, xen_pte_lock expect mm->page_table_lock to be held before grabbing ptlock, but this does not happen when pinning is caused by xen_mm_pin_all. This commit addresses lockdep warning below, which shows up...
```diff diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c index 55a4996d0c04..2c70cd35e72c 100644 --- a/arch/x86/xen/mmu_pv.c +++ b/arch/x86/xen/mmu_pv.c @@ -781,6 +781,7 @@ void xen_mm_pin_all(void) { struct page *page; + spin_lock(&init_mm.page_table_lock); spin_lock(&pgd_lock); list_for_each_entr...
a12c76a03386e32413ae8eaaefa337e491880632
Analyze and fix the following issue in the Linux kernel code: net: sched: refine software bypass handling in tc_run
Problem Details: This patch addresses issues with filter counting in block (tcf_block), particularly for software bypass scenarios, by introducing a more accurate mechanism using useswcnt. Previously, filtercnt and skipswcnt were introduced by: Commit 2081fd3445fe ("net: sched: cls_api: add filter counter") and C...
```diff diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index 22c5ab4269d7..c64fd896b1f9 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h @@ -75,11 +75,11 @@ static inline bool tcf_block_non_null_shared(struct tcf_block *block) } #ifdef CONFIG_NET_CLS_ACT -DECLARE_STATIC_KEY_FALSE(tcf_bypas...
98b34d52004b5a35db1c1b2c2133f52d67bede0f
Analyze and fix the following issue in the Linux kernel code: mtd: spinand: skyhigh: Align with recent read from cache variant changes
Problem Details: The SPINAND_PAGE_READ_FROM_CACHE_OP macro has just been changed to stop encoding the "fast" parameter (the macro has been duplicated and renamed). The Skyhigh driver is new and is still using the old style macro. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-...
```diff diff --git a/drivers/mtd/nand/spi/skyhigh.c b/drivers/mtd/nand/spi/skyhigh.c index 8b32b74ff34b..961df0d74984 100644 --- a/drivers/mtd/nand/spi/skyhigh.c +++ b/drivers/mtd/nand/spi/skyhigh.c @@ -21,8 +21,8 @@ static SPINAND_OP_VARIANTS(read_cache_variants, SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0), ...
69146a8c893f734cefaac0af6f917f894f29077e
Analyze and fix the following issue in the Linux kernel code: ubi: ubi_get_ec_info: Fix compiling error 'cast specifies array type'
Problem Details: On risc V platform, there is a type conversion for the return value (unsigned long type) of __untagged_addr_remote() in function untagged_addr(). The compiler will complain when the parameter 'addr' is an array type: arch/riscv/include/asm/uaccess.h:33:9: error: cast specifies array type (__force ...
```diff diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index 4c3e4edb6853..b700a0efaa93 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c @@ -851,7 +851,8 @@ static int ubi_get_ec_info(struct ubi_device *ubi, struct ubi_ecinfo_req __user end_peb = ubi->peb_count; /* Check access righ...
8cd671d65b4255bb7ce368b4258ef4fd52798468
Analyze and fix the following issue in the Linux kernel code: ALSA: hda: tas2781-spi: select CRC32 instead of CRC32_SARWATE
Problem Details: Just like the I2C driver (as in commit 86c96e7289c5 "ALSA: hda/tas2781: select CRC32 instead of CRC32_SARWATE"), the new tas2781 SPI driver has to select CONFIG_CRC32 instead of CONFIG_CRC32_SARWATE for fixing the build failures. Fixes: bb5f86ea50ff ("ALSA: hda/tas2781: Add tas2781 hda SPI driver") Su...
```diff diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig index ca3f5b69b521..e393578cbe68 100644 --- a/sound/pci/hda/Kconfig +++ b/sound/pci/hda/Kconfig @@ -212,7 +212,7 @@ config SND_HDA_SCODEC_TAS2781_SPI depends on ACPI depends on EFI depends on SND_SOC - select CRC32_SARWATE + select CRC32 help ...
f95719b069dc6d04d752469a76285f3c52261a32
Analyze and fix the following issue in the Linux kernel code: ALSA: usb: fcp: Fix hwdep read ops types
Problem Details: The FCP driver defined hwdep read function with ssize_t, but it should be long due to historical reason. This caused build errors on 32bit archs. Fixes: 46757a3e7d50 ("ALSA: FCP: Add Focusrite Control Protocol driver") Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Link: https://patch.msgid.l...
```diff diff --git a/sound/usb/fcp.c b/sound/usb/fcp.c index 655e4f7338ed..ecdd18335ab7 100644 --- a/sound/usb/fcp.c +++ b/sound/usb/fcp.c @@ -815,13 +815,13 @@ static int fcp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, /* not reached */ } -static ssize_t fcp_hwdep_read(struct snd_hwdep *hw, char __user *...
1620c88887b16940e00dbe57dd38c74eda9bad9e
Analyze and fix the following issue in the Linux kernel code: xfrm: Fix the usage of skb->sk
Problem Details: xfrm assumed to always have a full socket at skb->sk. This is not always true, so fix it by converting to a full socket before it is used. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Reviewed-by: Eric Dumazet <edumazet@google.com>
```diff diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index f3281312eb5e..8cf5f6634775 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c @@ -279,7 +279,7 @@ static void esp_output_done(void *data, int err) x->encap && x->encap->encap_type == TCP_ENCAP_ESPINTCP) esp_output_tail_tcp(x, skb); else - xfrm...
6d08851c601328025615d779c08753067ecefa34
Analyze and fix the following issue in the Linux kernel code: cifs: Fix printing Status code into dmesg
Problem Details: NT Status code is 32-bit number, so for comparing two NT Status codes is needed to check all 32 bits, and not just low 24 bits. Before this change kernel printed message: "Status code returned 0x8000002d NT_STATUS_NOT_COMMITTED" It was incorrect as because NT_STATUS_NOT_COMMITTED is defined as 0xC000...
```diff diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c index 2a8d71221e5e..17b3e21ea868 100644 --- a/fs/smb/client/netmisc.c +++ b/fs/smb/client/netmisc.c @@ -775,10 +775,10 @@ cifs_print_status(__u32 status_code) int idx = 0; while (nt_errs[idx].nt_errstr != NULL) { - if (((nt_errs[idx].nt_errco...
4e2ee328291585b7224ac8cc025625841ccfbf03
Analyze and fix the following issue in the Linux kernel code: cifs: Fix endian types in struct rfc1002_session_packet
Problem Details: All fields in struct rfc1002_session_packet are in big endian. This is because all NetBIOS packet headers are in big endian as opposite of SMB structures which are in little endian. Therefore use __be16 and __be32 types instead of __u16 and __u32 in struct rfc1002_session_packet. Reported-by: kernel ...
```diff diff --git a/fs/smb/client/rfc1002pdu.h b/fs/smb/client/rfc1002pdu.h index ae1d025da294..ac82c2f3a4a2 100644 --- a/fs/smb/client/rfc1002pdu.h +++ b/fs/smb/client/rfc1002pdu.h @@ -24,7 +24,7 @@ struct rfc1002_session_packet { __u8 type; __u8 flags; - __u16 length; + __be16 length; union { struct { ...
015683d4ed0d23698c71f2194f09bd17dbfad044
Analyze and fix the following issue in the Linux kernel code: cifs: Use cifs_autodisable_serverino() for disabling CIFS_MOUNT_SERVER_INUM in readdir.c
Problem Details: In all other places is used function cifs_autodisable_serverino() for disabling CIFS_MOUNT_SERVER_INUM mount flag. So use is also in readir.c _initiate_cifs_search() function. Benefit of cifs_autodisable_serverino() is that it also prints dmesg message that server inode numbers are being disabled. Fix...
```diff diff --git a/fs/smb/client/readdir.c b/fs/smb/client/readdir.c index 273358d20a46..50f96259d9ad 100644 --- a/fs/smb/client/readdir.c +++ b/fs/smb/client/readdir.c @@ -413,7 +413,7 @@ ffirst_retry: cifsFile->invalidHandle = false; } else if ((rc == -EOPNOTSUPP) && (cifs_sb->mnt_cifs_flags & CIFS_MOUNT...
72cf9e94f32fc18096be3cc21216a78f50220e03
Analyze and fix the following issue in the Linux kernel code: smb3: add missing tracepoint for querying wsl EAs
Problem Details: We had tracepoints for the return code for querying WSL EAs (trace_smb3_query_wsl_ea_compound_err and trace_smb3_query_wsl_ea_compound_done) but were missing one for trace_smb3_query_wsl_ea_compound_enter. Fixes: ea41367b2a60 ("smb: client: introduce SMB2_OP_QUERY_WSL_EA") Signed-off-by: Steve French ...
```diff diff --git a/fs/smb/client/smb2inode.c b/fs/smb/client/smb2inode.c index 274672755c19..7d3685dd655a 100644 --- a/fs/smb/client/smb2inode.c +++ b/fs/smb/client/smb2inode.c @@ -584,6 +584,8 @@ replay_again: goto finished; } num_rqst++; + trace_smb3_query_wsl_ea_compound_enter(xid, tcon->tid, + ...
11f8b80ab9f99291dc88d09855b9f8f43b772335
Analyze and fix the following issue in the Linux kernel code: smb: client: fix order of arguments of tracepoints
Problem Details: The tracepoints based on smb3_inf_compound_*_class have tcon id and session id swapped around. This results in incorrect output in `trace-cmd report`. Fix the order of arguments to resolve this issue. The trace-cmd output below shows the before and after of the smb3_delete_enter and smb3_delete_done e...
```diff diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c index 864b194dbaa0..1822493dd084 100644 --- a/fs/smb/client/dir.c +++ b/fs/smb/client/dir.c @@ -627,7 +627,7 @@ int cifs_mknod(struct mnt_idmap *idmap, struct inode *inode, goto mknod_out; } - trace_smb3_mknod_enter(xid, tcon->ses->Suid, tcon->tid, f...
be7a6a77669588bfa5022a470989702bbbb11e7f
Analyze and fix the following issue in the Linux kernel code: smb: client: fix oops due to unset link speed
Problem Details: It isn't guaranteed that NETWORK_INTERFACE_INFO::LinkSpeed will always be set by the server, so the client must handle any values and then prevent oopses like below from happening: Oops: divide error: 0000 [#1] PREEMPT SMP KASAN NOPTI CPU: 0 UID: 0 PID: 1323 Comm: cat Not tainted 6.13.0-rc7 #2 Hardwar...
```diff diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index 0af4abf78a8e..7d9a209fe6e0 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -658,7 +658,8 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf, while (bytes_left >= (ssize_t)sizeof(*p)) { memset(&...
bfc1155030151912e7c5426449c7703dad45a890
Analyze and fix the following issue in the Linux kernel code: smb: client: fix return value of parse_dfs_referrals()
Problem Details: Return -ENOENT in parse_dfs_referrals() when server returns no targets for a referral request as specified in MS-DFSC 3.1.5.4.3 Receiving a Root Referral Response or Link Referral Response: > If the referral request is successful, but the NumberOfReferrals > field in the referral header (...
```diff diff --git a/fs/smb/client/misc.c b/fs/smb/client/misc.c index a6efd3644e6a..b328dc5c7988 100644 --- a/fs/smb/client/misc.c +++ b/fs/smb/client/misc.c @@ -909,9 +909,9 @@ parse_dfs_referrals(struct get_dfs_referral_rsp *rsp, u32 rsp_size, *num_of_nodes = le16_to_cpu(rsp->NumberOfReferrals); if (*num_of_no...
ad46faff1afcc8db72f9954a6ea2296d31259217
Analyze and fix the following issue in the Linux kernel code: smb: client: fix DFS mount against old servers with NTLMSSP
Problem Details: Old Windows servers will return not fully qualified DFS targets by default as specified in MS-DFSC 3.2.5.5 Receiving a Root Referral Request or Link Referral Request | Servers SHOULD<30> return fully qualified DNS host names of | targets in responses to root referral requests and link ref...
```diff diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h index e5982136e66f..c747b6f9baca 100644 --- a/fs/smb/client/cifsglob.h +++ b/fs/smb/client/cifsglob.h @@ -828,6 +828,7 @@ struct TCP_Server_Info { */ char *leaf_fullpath; bool dfs_conn:1; + char dns_dom[CIFS_MAX_DOMAINNAME_LEN + 1]; }; ...
361cb056e2468be534f47c1a6745f96581a721e3
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: Correct immediate cfg_len calculation for scan_offload_be
Problem Details: Ensures the correct calculation of `cfg_len` prior to the allocation of the skb in the `rtw89_fw_h2c_scan_offload_be` function, particularly when the `SCAN_OFFLOAD_BE_V0` firmware feature is enabled. It addresses an issue where an incorrect skb size might be allocated due to a delayed setting of `cfg_l...
```diff diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c index 5d4ad23cc3bd..5cc9ab78c09f 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -5311,6 +5311,7 @@ int rtw89_fw_h2c_scan_offload_be(struct rtw89_dev *rtwdev, u8...
dbb6a738f6cb55c542df286f028fb7d524f71077
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: coex: Update Wi-Fi/Bluetooth coexistence version to 7.0.2
Problem Details: With this version, fix Wi-Fi scan/connecting/RF calibration triggered A2DP sound lag related issues. Signed-off-by: Ching-Te Ku <ku920601@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20250110015416.10704-4-pkshih@realtek.com
```diff diff --git a/drivers/net/wireless/realtek/rtw89/coex.c b/drivers/net/wireless/realtek/rtw89/coex.c index cde65ee43bac..7e43ba0c4098 100644 --- a/drivers/net/wireless/realtek/rtw89/coex.c +++ b/drivers/net/wireless/realtek/rtw89/coex.c @@ -10,7 +10,7 @@ #include "ps.h" #include "reg.h" -#define RTW89_COEX_VE...
c542a56aad1f88b88713293c128952feb1945301
Analyze and fix the following issue in the Linux kernel code: fbdev: vga16fb: fix orig_video_isVGA confusion
Problem Details: At some point the orig_video_isVGA field of screen_info was repurposed for video type. Using it directly for video type check is unsafe as it can still mean yes (1) or no-output (0) in certain configurations. I had one of those. Signed-off-by: Zsolt Kajtar <soci@c64.rulez.org> Signed-off-by: Helge Del...
```diff diff --git a/drivers/video/fbdev/vga16fb.c b/drivers/video/fbdev/vga16fb.c index fce0f5db7ba3..eedab14c7d51 100644 --- a/drivers/video/fbdev/vga16fb.c +++ b/drivers/video/fbdev/vga16fb.c @@ -185,9 +185,10 @@ static inline void setindex(int index) /* Check if the video mode is supported by the driver */ static...
ccb7276a6d26d6f8416e315b43b45e15ee7f29e2
Analyze and fix the following issue in the Linux kernel code: batman-adv: fix panic during interface removal
Problem Details: Reference counting is used to ensure that batadv_hardif_neigh_node and batadv_hard_iface are not freed before/during batadv_v_elp_throughput_metric_update work is finished. But there isn't a guarantee that the hard if will remain associated with a soft interface up until the work is finished. This fi...
```diff diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c index 1d704574e6bf..fbf499bcc671 100644 --- a/net/batman-adv/bat_v_elp.c +++ b/net/batman-adv/bat_v_elp.c @@ -66,12 +66,19 @@ static void batadv_v_elp_start_timer(struct batadv_hard_iface *hard_iface) static u32 batadv_v_elp_get_throughput(st...
fd3aa3d5e5dbbf4254cd4ac6c550a4da671e07cc
Analyze and fix the following issue in the Linux kernel code: selftests/efivarfs: fix tests for failed write removal
Problem Details: The current self tests expect the zero size remnants that failed variable creation leaves. Update the tests to verify these are now absent. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
```diff diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh index 96677282789b..4a84a810dc2c 100755 --- a/tools/testing/selftests/efivarfs/efivarfs.sh +++ b/tools/testing/selftests/efivarfs/efivarfs.sh @@ -76,11 +76,11 @@ test_create_empty() : > $file - if [ ! ...
908af31f4896f2c0645031f8b74a89d3a8beb5b9
Analyze and fix the following issue in the Linux kernel code: efivarfs: fix error on write to new variable leaving remnants
Problem Details: Make variable cleanup go through the fops release mechanism and use zero inode size as the indicator to delete the file. Since all EFI variables must have an initial u32 attribute, zero size occurs either because the update deleted the variable or because an unsuccessful write after create caused the ...
```diff diff --git a/fs/efivarfs/file.c b/fs/efivarfs/file.c index 23c51d62f902..cb1b6d0c3454 100644 --- a/fs/efivarfs/file.c +++ b/fs/efivarfs/file.c @@ -36,28 +36,41 @@ static ssize_t efivarfs_file_write(struct file *file, if (IS_ERR(data)) return PTR_ERR(data); + inode_lock(inode); + if (var->removed) { + /*...
fddca52766e276cb2fdc0be940ad75e0f01e214e
Analyze and fix the following issue in the Linux kernel code: efivarfs: move variable lifetime management into the inodes
Problem Details: Make the inodes the default management vehicle for struct efivar_entry, so they are now all freed automatically if the file is removed and on unmount in kill_litter_super(). Remove the now superfluous iterator to free the entries after kill_litter_super(). Also fixes a bug where some entry freeing wa...
```diff diff --git a/fs/efivarfs/inode.c b/fs/efivarfs/inode.c index ec23da8405ff..8f5994dea204 100644 --- a/fs/efivarfs/inode.c +++ b/fs/efivarfs/inode.c @@ -82,26 +82,23 @@ static int efivarfs_create(struct mnt_idmap *idmap, struct inode *dir, struct efivar_entry *var; int namelen, i = 0, err = 0; bool is_remov...
8b4bc207f981bd87728d2e1c0cf6f4304f9d0159
Analyze and fix the following issue in the Linux kernel code: efivarfs: prevent setting of zero size on the inodes in the cache
Problem Details: Current efivarfs uses simple_setattr which allows the setting of any size in the inode cache. This is wrong because a zero size file is used to indicate an "uncommitted" variable, so by simple means of truncating the file (as root) any variable may be turned to look like it's uncommitted. Fix by addi...
```diff diff --git a/fs/efivarfs/inode.c b/fs/efivarfs/inode.c index ec23da8405ff..a4a6587ecd2e 100644 --- a/fs/efivarfs/inode.c +++ b/fs/efivarfs/inode.c @@ -187,7 +187,24 @@ efivarfs_fileattr_set(struct mnt_idmap *idmap, return 0; } +/* copy of simple_setattr except that it doesn't do i_size updates */ +static i...
7a4b61406395291ffb7220a10e8951a9a8684819
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_flow_offload: update tcp state flags under lock
Problem Details: The conntrack entry is already public, there is a small chance that another CPU is handling a packet in reply direction and racing with the tcp state update. Move this under ct spinlock. This is done once, when ct is about to be offloaded, so this should not result in a noticeable performance hit. F...
```diff diff --git a/net/netfilter/nft_flow_offload.c b/net/netfilter/nft_flow_offload.c index 3b474d235663..221d50223018 100644 --- a/net/netfilter/nft_flow_offload.c +++ b/net/netfilter/nft_flow_offload.c @@ -289,6 +289,15 @@ static bool nft_flow_offload_skip(struct sk_buff *skb, int family) return false; } +sta...
fc0133428e7ad65aa6b7c8e65ccfe86e469e4512
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_tables: Tolerate chains with no remaining hooks
Problem Details: Do not drop a netdev-family chain if the last interface it is registered for vanishes. Users dumping and storing the ruleset upon shutdown to restore it upon next boot may otherwise lose the chain and all contained rules. They will still lose the list of devices, a later patch will fix that. For now, t...
```diff diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index bd93d085b6fb..60d5dcdb289c 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h @@ -1238,8 +1238,6 @@ static inline bool nft_is_base_chain(const struct nft_chain *chain) return chain->fla...
d01ed3240b22ffd76b7e1ebcabce900fc00cc8d0
Analyze and fix the following issue in the Linux kernel code: netfilter: br_netfilter: remove unused conditional and dead code
Problem Details: The SKB_DROP_REASON_IP_INADDRERRORS drop reason is never returned from any function, as such it cannot be returned from the ip_route_input call tree. The 'reason != SKB_DROP_REASON_IP_INADDRERRORS' conditional is thus always true. Looking back at history, commit 50038bf38e65 ("net: ip: make ip_route_i...
```diff diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c index 451e45b9a6a5..94cbe967d1c1 100644 --- a/net/bridge/br_netfilter_hooks.c +++ b/net/bridge/br_netfilter_hooks.c @@ -393,38 +393,10 @@ static int br_nf_pre_routing_finish(struct net *net, struct sock *sk, struct sk_ reason = ip...
8d738c1869f611955d91d8d0fd0012d9ef207201
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_tables: fix set size with rbtree backend
Problem Details: The existing rbtree implementation uses singleton elements to represent ranges, however, userspace provides a set size according to the number of ranges in the set. Adjust provided userspace set size to the number of singleton elements in the kernel by multiplying the range by two. Check if the no-ma...
```diff diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index 0027beca5cd5..f6958118986a 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h @@ -442,6 +442,9 @@ struct nft_set_ext; * @remove: remove element from set * @walk: iterate over all set ...
561e3a0c40dc7e3ab7b0b3647a2b89eca16215d9
Analyze and fix the following issue in the Linux kernel code: io_uring/fdinfo: fix io_uring_show_fdinfo() misuse of ->d_iname
Problem Details: Output of io_uring_show_fdinfo() has several problems: * racy use of ->d_iname * junk if the name is long - in that case it's not stored in ->d_iname at all * lack of quoting (names can contain newlines, etc. - or be equal to "<none>", for that matter). * lines for empty slots are pointless noise - we...
```diff diff --git a/io_uring/fdinfo.c b/io_uring/fdinfo.c index b214e5a407b5..f60d0a9d505e 100644 --- a/io_uring/fdinfo.c +++ b/io_uring/fdinfo.c @@ -211,10 +211,11 @@ __cold void io_uring_show_fdinfo(struct seq_file *m, struct file *file) if (ctx->file_table.data.nodes[i]) f = io_slot_file(ctx->file_table.da...
6568d423cb3000789b2b8493049883fcec09c329
Analyze and fix the following issue in the Linux kernel code: drm/virtio: Don't return error if virtio-gpu PCI dev is not found
Problem Details: While fixing a shared VGA resource ownership issue, commit 5dd8b536bbda ("drm/virtio: Lock the VGA resources during initialization") wrongly assumed that there is always a PCI device associated with virtio-gpu and it would return error if this device is not found during init. This is incorrect, as vir...
```diff diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c index d4309dba557b..2d88e390feb4 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.c +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c @@ -173,23 +173,24 @@ static int __init virtio_gpu_driver_init(void) pdev = pci_get_device(PCI_...
db8b2c0e2abc90d1025fd7f6d4461b21b1d3248e
Analyze and fix the following issue in the Linux kernel code: drm/virtio: Fix UAF in virtgpu_dma_buf_free_obj()
Problem Details: Fix the following issues identified by Smatch static checker: - The call to dma_buf_put(attach->dmabuf) after dma_buf_detach() leads to a UAF bug as dma_buf_detach() frees the attach object. Fix this by extracting the dmabuf object from attach and using that in the call to dma_buf_put(). - The r...
```diff diff --git a/drivers/gpu/drm/virtio/virtgpu_prime.c b/drivers/gpu/drm/virtio/virtgpu_prime.c index b3664c12843d..f92133a01195 100644 --- a/drivers/gpu/drm/virtio/virtgpu_prime.c +++ b/drivers/gpu/drm/virtio/virtgpu_prime.c @@ -189,10 +189,11 @@ static void virtgpu_dma_buf_free_obj(struct drm_gem_object *obj) ...
6a6c153537f093c3bc79ea9633f3954d3450d0ba
Analyze and fix the following issue in the Linux kernel code: staging: gpib: Fix NULL pointer dereference in detach
Problem Details: When the detach function is called after a failed attach the usb_dev initialization can cause a NULL pointer dereference. This happens when the usb device is not found in the attach procedure. Remove the usb_dev variable and initialization and change the dev in the dev_info message from the usb_dev to...
```diff diff --git a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c index 34d85a1bdb37..2aaccebc3c7b 100644 --- a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c +++ b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c @@ -1442,12 +1442,10 @@ static in...
9d4f8e54cef2c42e23ef258833dbd06a1eaff89b
Analyze and fix the following issue in the Linux kernel code: rhashtable: Fix rhashtable_try_insert test
Problem Details: The test on whether rhashtable_insert_one did an insertion relies on the value returned by rhashtable_lookup_one. Unfortunately that value is overwritten after rhashtable_insert_one returns. Fix this by moving the test before data gets overwritten. Simplify the test as only data == NULL matters. Fi...
```diff diff --git a/lib/rhashtable.c b/lib/rhashtable.c index bf956b85455a..0e9a1d4cf89b 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c @@ -611,21 +611,23 @@ static void *rhashtable_try_insert(struct rhashtable *ht, const void *key, new_tbl = rht_dereference_rcu(tbl->future_tbl, ht); data = ERR_PTR(-EAGA...
dd7d37ccf6b11f3d95e797ebe4e9e886d0332600
Analyze and fix the following issue in the Linux kernel code: padata: avoid UAF for reorder_work
Problem Details: Although the previous patch can avoid ps and ps UAF for _do_serial, it can not avoid potential UAF issue for reorder_work. This issue can happen just as below: crypto_request crypto_request crypto_del_alg padata_do_serial ... padata_reorder // processes all remaining // requests then br...
```diff diff --git a/kernel/padata.c b/kernel/padata.c index de2c02a81469..418987056340 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -352,8 +352,14 @@ static void padata_reorder(struct parallel_data *pd) smp_mb(); reorder = per_cpu_ptr(pd->reorder_list, pd->cpu); - if (!list_empty(&reorder->list) && pada...
e01780ea4661172734118d2a5f41bc9720765668
Analyze and fix the following issue in the Linux kernel code: padata: fix UAF in padata_reorder
Problem Details: A bug was found when run ltp test: BUG: KASAN: slab-use-after-free in padata_find_next+0x29/0x1a0 Read of size 4 at addr ffff88bbfe003524 by task kworker/u113:2/3039206 CPU: 0 PID: 3039206 Comm: kworker/u113:2 Kdump: loaded Not tainted 6.6.0+ Workqueue: pdecrypt_parallel padata_parallel_worker Call T...
```diff diff --git a/kernel/padata.c b/kernel/padata.c index 7d79df1e3b33..de2c02a81469 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -1135,6 +1135,12 @@ void padata_free_shell(struct padata_shell *ps) if (!ps) return; + /* + * Wait for all _do_serial calls to finish to avoid touching + * freed pd's an...
bc50835e83f60f56e9bec2b392fb5544f250fb6f
Analyze and fix the following issue in the Linux kernel code: net: sched: Disallow replacing of child qdisc from one parent to another
Problem Details: Lion Ackermann was able to create a UAF which can be abused for privilege escalation with the following script Step 1. create root qdisc tc qdisc add dev lo root handle 1:0 drr step2. a class for packet aggregation do demonstrate uaf tc class add dev lo classid 1:1 drr step3. a class for nesting tc ...
```diff diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 300430b8c4d2..fac9c946a4c7 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1664,6 +1664,10 @@ replay: q = qdisc_lookup(dev, tcm->tcm_handle); if (!q) goto create_n_graft; + if (q->parent != tcm->tcm_parent) { + NL...
12e070eb6964b341b41677fd260af5a305316a1f
Analyze and fix the following issue in the Linux kernel code: net: avoid race between device unregistration and ethnl ops
Problem Details: The following trace can be seen if a device is being unregistered while its number of channels are being modified. DEBUG_LOCKS_WARN_ON(lock->magic != lock) WARNING: CPU: 3 PID: 3754 at kernel/locking/mutex.c:564 __mutex_lock+0xc8a/0x1120 CPU: 3 UID: 0 PID: 3754 Comm: ethtool Not tainted 6.13.0-r...
```diff diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c index e3f0ef6b851b..4d18dc29b304 100644 --- a/net/ethtool/netlink.c +++ b/net/ethtool/netlink.c @@ -90,7 +90,7 @@ int ethnl_ops_begin(struct net_device *dev) pm_runtime_get_sync(dev->dev.parent); if (!netif_device_present(dev) || - dev->reg_s...
bff406bc042408c021e41a439698a346119c2f11
Analyze and fix the following issue in the Linux kernel code: net: destroy dev->lock later in free_netdev()
Problem Details: syzbot complained that free_netdev() was calling netif_napi_del() after dev->lock mutex has been destroyed. This fires a warning for CONFIG_DEBUG_MUTEXES=y builds. Move mutex_destroy(&dev->lock) near the end of free_netdev(). [1] DEBUG_LOCKS_WARN_ON(lock->magic != lock) WARNING: CPU: 0 PID: 5971 at...
```diff diff --git a/net/core/dev.c b/net/core/dev.c index fe5f5855593d..fab4899b83f7 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -11593,8 +11593,6 @@ void free_netdev(struct net_device *dev) return; } - mutex_destroy(&dev->lock); - kfree(dev->ethtool); netif_free_tx_queues(dev); netif_free_rx_queu...
17656eb5cfe5b7287dc7f1b21ad02acc25ecdb15
Analyze and fix the following issue in the Linux kernel code: eth: bnxt: fix string truncation warning in FW version
Problem Details: W=1 builds with gcc 14.2.1 report: drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:4193:32: error: ‘%s’ directive output may be truncated writing up to 31 bytes into a region of size 27 [-Werror=format-truncation=] 4193 | "/pkg %s", buf); It's upset that we let buf be full...
```diff diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index 540c140d52dc..65a20931c579 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -4184,7 +4184,7 @@ err: static void bnxt_...
f84039939512e6d88b0f2f353695530f123be789
Analyze and fix the following issue in the Linux kernel code: octeon_ep_vf: update tx/rx stats locally for persistence
Problem Details: Update tx/rx stats locally, so that ndo_get_stats64() can use that and not rely on per queue resources to obtain statistics. The latter used to cause race conditions when the device stopped. Signed-off-by: Shinas Rasheed <srasheed@marvell.com> Link: https://patch.msgid.link/20250117094653.2588578-5-sr...
```diff diff --git a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_ethtool.c b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_ethtool.c index 7b21439a315f..d60441928ba9 100644 --- a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_ethtool.c +++ b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_ethtool.c @...
cc0e510cc89fe0a6479203bc20cd964962dc6a43
Analyze and fix the following issue in the Linux kernel code: octeon_ep_vf: remove firmware stats fetch in ndo_get_stats64
Problem Details: The firmware stats fetch call that happens in ndo_get_stats64() is currently not required, and causes a warning to issue. The corresponding warn log for the PF is given below: [ 123.316837] ------------[ cut here ]------------ [ 123.316840] Voluntary context switch within RCU read-side critical sec...
```diff diff --git a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c index 7e6771c9cdbb..4c699514fd57 100644 --- a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c +++ b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c @@ -799,14 +7...
10fad79846e49f67ad1a0a05910837125c6ca9ad
Analyze and fix the following issue in the Linux kernel code: octeon_ep: update tx/rx stats locally for persistence
Problem Details: Update tx/rx stats locally, so that ndo_get_stats64() can use that and not rely on per queue resources to obtain statistics. The latter used to cause race conditions when the device stopped. Signed-off-by: Shinas Rasheed <srasheed@marvell.com> Link: https://patch.msgid.link/20250117094653.2588578-3-sr...
```diff diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_ethtool.c b/drivers/net/ethernet/marvell/octeon_ep/octep_ethtool.c index 4f4d58189118..a88c006ea65b 100644 --- a/drivers/net/ethernet/marvell/octeon_ep/octep_ethtool.c +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_ethtool.c @@ -150,17 +150,14 @@ oct...
1f64255bb76c11d0c41a7d81d7cec68e49d5362d
Analyze and fix the following issue in the Linux kernel code: octeon_ep: remove firmware stats fetch in ndo_get_stats64
Problem Details: The firmware stats fetch call that happens in ndo_get_stats64() is currently not required, and causes a warning to issue. The warn log is given below: [ 123.316837] ------------[ cut here ]------------ [ 123.316840] Voluntary context switch within RCU read-side critical section! [ 123.316917] pc :...
```diff diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c index 549436efc204..730aa5632cce 100644 --- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c @@ -995,12 +995,6 @@ static void octe...
173baa1b2dc44e3551d9414f4919a48fe5da4880
Analyze and fix the following issue in the Linux kernel code: drm/xe: Suppress printing of mode when running in non-sriov mode
Problem Details: The xe_sriov_probe_early() function prints the sriov pf/vf mode on driver probe. When running in non-sriov mode, the below debug message is seen. "Running in none mode". This print does not convey any information. This commit suppresses this debug message and shows only when running in PF/VF mode. S...
```diff diff --git a/drivers/gpu/drm/xe/xe_sriov.c b/drivers/gpu/drm/xe/xe_sriov.c index 04e2f539ccd9..a0eab44c0e76 100644 --- a/drivers/gpu/drm/xe/xe_sriov.c +++ b/drivers/gpu/drm/xe/xe_sriov.c @@ -81,7 +81,7 @@ void xe_sriov_probe_early(struct xe_device *xe) xe->sriov.__mode = mode; xe_assert(xe, xe->sriov.__mode...
c49ca671818a325f2221f0bda8af96e339272a5e
Analyze and fix the following issue in the Linux kernel code: drm/xe/sa: Minor header cleanups
Problem Details: Drop unused struct xe_bo forward declaration and, while around, fix unnecessary line split in xe_sa_bo_free() declaration. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patchwo...
```diff diff --git a/drivers/gpu/drm/xe/xe_sa.h b/drivers/gpu/drm/xe/xe_sa.h index de0330eb36d4..1170ee5a81a8 100644 --- a/drivers/gpu/drm/xe/xe_sa.h +++ b/drivers/gpu/drm/xe/xe_sa.h @@ -10,7 +10,6 @@ #include "xe_sa_types.h" struct dma_fence; -struct xe_bo; struct xe_tile; struct xe_sa_manager *__xe_sa_bo_mana...
db049866943a38bf46a34fa120d526663339d7a5
Analyze and fix the following issue in the Linux kernel code: mailbox: th1520: Fix memory corruption due to incorrect array size
Problem Details: The functions th1520_mbox_suspend_noirq and th1520_mbox_resume_noirq are intended to save and restore the interrupt mask registers in the MBOX ICU0. However, the array used to store these registers was incorrectly sized, leading to memory corruption when accessing all four registers. This commit corre...
```diff diff --git a/drivers/mailbox/mailbox-th1520.c b/drivers/mailbox/mailbox-th1520.c index e16e7c85ee3c..a6b2aa9ae952 100644 --- a/drivers/mailbox/mailbox-th1520.c +++ b/drivers/mailbox/mailbox-th1520.c @@ -41,7 +41,7 @@ #ifdef CONFIG_PM_SLEEP /* store MBOX context across system-wide suspend/resume transitions */...
170a264d2611a0bfa96b7818730473db5e7546fc
Analyze and fix the following issue in the Linux kernel code: mailbox: zynqmp: Remove invalid __percpu annotation in zynqmp_ipi_probe()
Problem Details: struct zynqmp_ipi_pdata __percpu *pdata is not a per-cpu variable, so it should not be annotated with __percpu annotation. Remove invalid __percpu annotation to fix several zynqmp-ipi-mailbox.c:920:15: warning: incorrect type in assignment (different address spaces) zynqmp-ipi-mailbox.c:920:15: ex...
```diff diff --git a/drivers/mailbox/zynqmp-ipi-mailbox.c b/drivers/mailbox/zynqmp-ipi-mailbox.c index aa5249da59b2..0c143beaafda 100644 --- a/drivers/mailbox/zynqmp-ipi-mailbox.c +++ b/drivers/mailbox/zynqmp-ipi-mailbox.c @@ -905,7 +905,7 @@ static int zynqmp_ipi_probe(struct platform_device *pdev) { struct device ...
0b7f8328f988178b55ee11d772a6e1238c04d29d
Analyze and fix the following issue in the Linux kernel code: mailbox: tegra-hsp: Clear mailbox before using message
Problem Details: The Tegra RCE (Camera) driver expects the mailbox to be empty before processing the IVC messages. On RT kernel, the threads processing the IVC messages (which are invoked after `mbox_chan_received_data()` is called) may be on a different CPU or running with a higher priority than the HSP interrupt hand...
```diff diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c index 8d5e2d7dc03b..c1981f091bd1 100644 --- a/drivers/mailbox/tegra-hsp.c +++ b/drivers/mailbox/tegra-hsp.c @@ -388,7 +388,6 @@ static void tegra_hsp_sm_recv32(struct tegra_hsp_channel *channel) value = tegra_hsp_channel_readl(channel, HSP...
f055feb49c1c4333abb80ce1e9d93841cf74ea84
Analyze and fix the following issue in the Linux kernel code: mailbox: mpfs: fix copy and paste bug in probe
Problem Details: This code accidentally checks ->ctrl_base instead of ->mbox_base so the error handling can never be triggered. Fixes: a4123ffab9ec ("mailbox: mpfs: support new, syscon based, devicetree configuration") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Conor Dooley <conor.dooley@micr...
```diff diff --git a/drivers/mailbox/mailbox-mpfs.c b/drivers/mailbox/mailbox-mpfs.c index 4df546e3b7ea..d5d9effece97 100644 --- a/drivers/mailbox/mailbox-mpfs.c +++ b/drivers/mailbox/mailbox-mpfs.c @@ -251,7 +251,7 @@ static inline int mpfs_mbox_syscon_probe(struct mpfs_mbox *mbox, struct platform return PTR_ERR(mb...