id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
0bb067ca64e35536f1f5d9ef6aaafc40f4833623
Analyze and fix the following issue in the Linux kernel code: btrfs: fix the qgroup data free range for inline data extents
Problem Details: Inside function __cow_file_range_inline() since the inlined data no longer take any data space, we need to free up the reserved space. However the code is still using the old page size == sector size assumption, and will not handle subpage case well. Thankfully it is not going to cause any problems b...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 97f0d91cda07..c541183e3d22 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -672,7 +672,7 @@ out: * And at reserve time, it's always aligned to page size, so * just free one page here. */ - btrfs_qgroup_free_data(inode, NULL, 0, PAGE_SIZE, N...
a66b39f699cbd9125c0f248d18fc1381265ee42c
Analyze and fix the following issue in the Linux kernel code: btrfs: sysfs: accept size suffixes for read policy values
Problem Details: We now parse human-friendly size values (e.g. '1G', '2M') when setting read policies. Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
```diff diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 14f53f757555..974e8a75e3ab 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -1342,17 +1342,18 @@ int btrfs_read_policy_to_enum(const char *str, s64 *value_ret) /* Separate value from input in policy:value format. */ value_str = strchr(param, ':')...
620768704326c9a71ea9c8324ffda8748d8d4f10
Analyze and fix the following issue in the Linux kernel code: btrfs: fix reclaimed bytes accounting after automatic block group reclaim
Problem Details: We are considering the used bytes counter of a block group as the amount to update the space info's reclaim bytes counter after relocating the block group, but this value alone is often not enough. This is because we may have a reserved extent (or more) and in that case its size is reflected in the res...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index cbfcdd65e15e..f01b72231c7e 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -1824,6 +1824,7 @@ void btrfs_reclaim_bgs_work(struct work_struct *work) while (!list_empty(&fs_info->reclaim_bgs)) { u64 zone_unusable; u64 u...
ba5d06440cae63edc4f49465baf78f1f43e55c77
Analyze and fix the following issue in the Linux kernel code: btrfs: get used bytes while holding lock at btrfs_reclaim_bgs_work()
Problem Details: At btrfs_reclaim_bgs_work(), we are grabbing twice the used bytes counter of the block group while not holding the block group's spinlock. This can result in races, reported by KCSAN and similar tools, since a concurrent task can be updating that counter while at btrfs_update_block_group(). So avoid t...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index cbea2bf25714..cbfcdd65e15e 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -1823,7 +1823,7 @@ void btrfs_reclaim_bgs_work(struct work_struct *work) list_sort(NULL, &fs_info->reclaim_bgs, reclaim_bgs_cmp); while (!list_emp...
1283b8c125a83bf7a7dbe90c33d3472b6d7bf612
Analyze and fix the following issue in the Linux kernel code: btrfs: get zone unusable bytes while holding lock at btrfs_reclaim_bgs_work()
Problem Details: At btrfs_reclaim_bgs_work(), we are grabbing a block group's zone unusable bytes while not under the protection of the block group's spinlock, so this can trigger race reports from KCSAN (or similar tools) since that field is typically updated while holding the lock, such as at __btrfs_add_free_space_z...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 18f58674a16c..cbea2bf25714 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -1887,6 +1887,17 @@ void btrfs_reclaim_bgs_work(struct work_struct *work) up_write(&space_info->groups_sem); goto next; } + + /* + * Cac...
6149c82bdaff63203e58a4910d9245468d281f39
Analyze and fix the following issue in the Linux kernel code: btrfs: update include and forward declarations in headers
Problem Details: Pass over all header files and add missing forward declarations, includes or fix include types. Signed-off-by: David Sterba <dsterba@suse.com>
```diff diff --git a/fs/btrfs/accessors.h b/fs/btrfs/accessors.h index 7a7e0ef69973..15ea6348800b 100644 --- a/fs/btrfs/accessors.h +++ b/fs/btrfs/accessors.h @@ -12,6 +12,7 @@ #include <linux/string.h> #include <linux/mm.h> #include <uapi/linux/btrfs_tree.h> +#include "extent_io.h" struct extent_buffer; diff -...
968f19c5b1b7d5595423b0ac0020cc18dfed8cb5
Analyze and fix the following issue in the Linux kernel code: btrfs: always fallback to buffered write if the inode requires checksum
Problem Details: [BUG] It is a long known bug that VM image on btrfs can lead to data csum mismatch, if the qemu is using direct-io for the image (this is commonly known as cache mode 'none'). [CAUSE] Inside the VM, if the fs is EXT4 or XFS, or even NTFS from Windows, the fs is allowed to dirty/modify the folio even i...
```diff diff --git a/fs/btrfs/direct-io.c b/fs/btrfs/direct-io.c index 8567af46e16f..eacbb74bf6bc 100644 --- a/fs/btrfs/direct-io.c +++ b/fs/btrfs/direct-io.c @@ -855,6 +855,22 @@ relock: btrfs_inode_unlock(BTRFS_I(inode), ilock_flags); goto buffered; } + /* + * We can't control the folios being passed in, app...
cc63bcfd14a664a7ea78fd3c9d0014116b7e4619
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: Fix SDMA engine reset logic
Problem Details: The scheduler should restart only if the reset operation succeeds This ensures that new tasks are only submitted to the queues after a successful reset. Fixes: 4c02f7301657 ("drm/amdgpu: Introduce conditional user queue suspension for SDMA resets") Suggested-by: Alex Deucher <alexander.deucher@amd.co...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c index 3a4cef896018..1334c209201f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c @@ -609,7 +609,7 @@ exit: * if they were stopped by this function. This allows...
bed6bc66e84c47079a4e70f22cf1d8b60a998b8b
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: 3.2.325
Problem Details: This version brings along following fixes: - Use DPM table clk setting for dml2 soc dscclk - Update static soc table - Fix incorrect fw_state address in dmub_srv - Use HW lock mgr for PSR1 when only one eDP - Revert "Support for reg inbox0 for host->DMUB CMDs" - Change notification of link BW allocatio...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h index 7932d8f99d22..7c2ee0526926 100644 --- a/drivers/gpu/drm/amd/display/dc/dc.h +++ b/drivers/gpu/drm/amd/display/dc/dc.h @@ -53,7 +53,7 @@ struct aux_payload; struct set_config_cmd_payload; struct dmub_notification; -#...
f57b38ac85a01bf03020cc0a9761d63e5c0ce197
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Fix incorrect fw_state address in dmub_srv
Problem Details: [WHY] The fw_state in dmub_srv was assigned with wrong address. The address was pointed to the firmware region. [HOW] Fix the firmware state by using DMUB_DEBUG_FW_STATE_OFFSET in dmub_cmd.h. Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Signed-off-by: Lo-an Chen <lo-an.chen@amd.com>...
```diff diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c index 70038f83170c..ae8133816b43 100644 --- a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c @@ -708,7 +708,7 @@ enum dmub_status dmub_srv_hw_init...
ed569e1279a3045d6b974226c814e071fa0193a6
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Use HW lock mgr for PSR1 when only one eDP
Problem Details: [WHY] DMUB locking is important to make sure that registers aren't accessed while in PSR. Previously it was enabled but caused a deadlock in situations with multiple eDP panels. [HOW] Detect if multiple eDP panels are in use to decide whether to use lock. Refactor the function so that the first check...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c index a262598aa676..d37ecfdde4f1 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c @@ -73,5 +73,16 @@ bool shoul...
79538e6365c99d7b1c3e560d1ea8d11ef8313465
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Fix message for support_edp0_on_dp1
Problem Details: [WHY] The info message was wrong when support_edp0_on_dp1 is enabled [HOW] Use correct info message for support_edp0_on_dp1 Fixes: f6d17270d18a ("drm/amd/display: add a quirk to enable eDP0 on DP1") Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Yilin Chen <Yilin.Chen@amd.com...
```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 4f1cf8afe25f..bae83a129b5f 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1752,7 +1752,7 @@ static void retrieve_dm...
7b59cc671ae719fe5d608718c472c5735c04f75a
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Prevent VStartup Overflow
Problem Details: [WHY & HOW] Fixed Overflow issue by clamping VStartup to max value of register. Reviewed-by: Alvin Lee <alvin.lee2@amd.com> Signed-off-by: Ryan Seto <ryanseto@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c b/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c index 84a2de9a76d4..7ae9c0ba0c9e 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c +++ b/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c @@ -32,6 +32,7 @@ ...
082ec59662046fd473a679e7bf6ce63968a54120
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Check pipe->stream before passing it to a function
Problem Details: [WHAT & HOW] dp_is_128b_132b_signal dereferences pipe->stream so it is necessary to check it in advance. Also fix erroneous spaces and move a variable declaration to top. Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Daniel Wheeler <d...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c index af722519a1fa..142de8938d7c 100644 --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c @...
84ff5895399c01be49620c0fa2ac04d2715a2e00
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: Add debug masks for HDCP LC FW testing
Problem Details: HDCP Locality Check is being moved to FW, add debug flags to control its behavior in existing hardware for validation purposes. Signed-off-by: Dominik Kaszewski <dominik.kaszewski@amd.com> Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
```diff diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h index 485b713cfad0..4c95b885d1d0 100644 --- a/drivers/gpu/drm/amd/include/amd_shared.h +++ b/drivers/gpu/drm/amd/include/amd_shared.h @@ -358,6 +358,18 @@ enum DC_DEBUG_MASK { * @DC_DISABLE_CUSTOM_BRIGHTNESS_CURV...
d6f9bbce18762116698c40cc7de836a9d0c9f832
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: Fix computation for remain size of CPER ring
Problem Details: The mistake of computation for remain size of CPER ring will cause unbreakable while cycle when CPER ring overflow. Signed-off-by: Xiang Liu <xiang.liu@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/amdgpu_cper.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c index 3f291b30b79f..360e07a5c7c1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c @@ -455,10 +455,10 @@ calc: return umin(rec_len, chunk); } -void amdgpu_cpe...
aff12700b8dd7422bfe2277696e192af4df9de8f
Analyze and fix the following issue in the Linux kernel code: ntb: reduce stack usage in idt_scan_mws
Problem Details: idt_scan_mws() puts a large fixed-size array on the stack and copies it into a smaller dynamically allocated array at the end. On 32-bit targets, the fixed size can easily exceed the warning limit for possible stack overflow: drivers/ntb/hw/idt/ntb_hw_idt.c:1041:27: error: stack frame size (1032) exce...
```diff diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c index 544d8a4d2af5..f27df8d7f3b9 100644 --- a/drivers/ntb/hw/idt/ntb_hw_idt.c +++ b/drivers/ntb/hw/idt/ntb_hw_idt.c @@ -1041,7 +1041,7 @@ static inline char *idt_get_mw_name(enum idt_mw_type mw_type) static struct idt_mw_cfg *idt_sc...
da0c56520e880441d0503d0cf0d6853dcfb5f1a4
Analyze and fix the following issue in the Linux kernel code: iommu/arm-smmu-v3: Set MEV bit in nested STE for DoS mitigations
Problem Details: There is a DoS concern on the shared hardware event queue among devices passed through to VMs, that too many translation failures that belong to VMs could overflow the shared hardware event queue if those VMs or their VMMs don't handle/recover the devices properly. The MEV bit in the STE allows to con...
```diff diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c index 65adfed56969..e4fd8d522af8 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c @@ -43,6 +43,8 @@ static void arm_smm...
680811c67906191b237bbafe7dabbbad64649b39
Analyze and fix the following issue in the Linux kernel code: idpf: check error for register_netdev() on init
Problem Details: Current init logic ignores the error code from register_netdev(), which will cause WARN_ON() on attempt to unregister it, if there was one, and there is no info for the user that the creation of the netdev failed. WARNING: CPU: 89 PID: 6902 at net/core/dev.c:11512 unregister_netdevice_many_notify+0x21...
```diff diff --git a/drivers/net/ethernet/intel/idpf/idpf_lib.c b/drivers/net/ethernet/intel/idpf/idpf_lib.c index a3d6b8f198a8..a055a47449f1 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_lib.c +++ b/drivers/net/ethernet/intel/idpf/idpf_lib.c @@ -927,15 +927,19 @@ static int idpf_stop(struct net_device *netdev) st...
1388dd564183a5a18ec4a966748037736b5653c5
Analyze and fix the following issue in the Linux kernel code: ice: fix using untrusted value of pkt_len in ice_vc_fdir_parse_raw()
Problem Details: Fix using the untrusted value of proto->raw.pkt_len in function ice_vc_fdir_parse_raw() by verifying if it does not exceed the VIRTCHNL_MAX_SIZE_RAW_PACKET value. Fixes: 99f419df8a5c ("ice: enable FDIR filters from raw binary patterns for VFs") Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.co...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c index 14e3f0f89c78..9be4bd717512 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c @@ -832,21 +832,27 @@ ice_vc_fdir_parse_r...
c5be6562de5a19c44605b1c1edba8e339f2022c8
Analyze and fix the following issue in the Linux kernel code: ice: fix input validation for virtchnl BW
Problem Details: Add missing validation of tc and queue id values sent by a VF in ice_vc_cfg_q_bw(). Additionally fixed logged value in the warning message, where max_tx_rate was incorrectly referenced instead of min_tx_rate. Also correct error handling in this function by properly exiting when invalid configuration is...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c index df13f5110168..1af51469f070 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c @@ -1862,15 +1862,33 @@ static int ice_vc_cfg_q_bw(struct ice...
e2f7d3f7331b92cb820da23e8c45133305da1e63
Analyze and fix the following issue in the Linux kernel code: ice: validate queue quanta parameters to prevent OOB access
Problem Details: Add queue wraparound prevention in quanta configuration. Ensure end_qid does not overflow by validating start_qid and num_queues. Fixes: 015307754a19 ("ice: Support VF queue rate limit and quanta size configuration") Reviewed-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com> Reviewed-by: Simon Horma...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c index 346aee373ccd..df13f5110168 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c @@ -1900,13 +1900,21 @@ err: */ static int ice_vc_cfg_q_qu...
f91d0efcc3dd7b341bb370499b99dc02d4fb792f
Analyze and fix the following issue in the Linux kernel code: ice: stop truncating queue ids when checking
Problem Details: Queue IDs can be up to 4096, fix invalid check to stop truncating IDs to 8 bits. Fixes: bf93bf791cec8 ("ice: introduce ice_virtchnl.c and ice_virtchnl.h") Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Reviewed-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com> Reviewed-by: Simon Ho...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c index ff4ad788d96a..346aee373ccd 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c @@ -562,7 +562,7 @@ bool ice_vc_isvalid_vsi_id(struct ice_vf ...
db5e8ea155fc1d89c87cb81f0e4a681a77b9b03f
Analyze and fix the following issue in the Linux kernel code: virtchnl: make proto and filter action count unsigned
Problem Details: The count field in virtchnl_proto_hdrs and virtchnl_filter_action_set should never be negative while still being valid. Changing it from int to u32 ensures proper handling of values in virtchnl messages in driverrs and prevents unintended behavior. In its current signed form, a negative count does not ...
```diff diff --git a/include/linux/avf/virtchnl.h b/include/linux/avf/virtchnl.h index 13a11f3c09b8..aca06f300f83 100644 --- a/include/linux/avf/virtchnl.h +++ b/include/linux/avf/virtchnl.h @@ -1283,7 +1283,7 @@ struct virtchnl_proto_hdrs { * 2 - from the second inner layer * .... **/ - int count; /* the prot...
7fd71f317288d5150d353ce9d65b1e2abf99a8e2
Analyze and fix the following issue in the Linux kernel code: ice: fix reservation of resources for RDMA when disabled
Problem Details: If the CONFIG_INFINIBAND_IRDMA symbol is not enabled as a module or a built-in, then don't let the driver reserve resources for RDMA. The result of this change is a large savings in resources for older kernels, and a cleaner driver configuration for the IRDMA=n case for old and new kernels. Implement ...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index 7a2a2e8da8fa..1e801300310e 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -2271,7 +2271,8 @@ ice_parse_common_caps(struct ice_hw *hw, struct...
53ce7166cbffd2b8f3bd821fd3918be665afd4c6
Analyze and fix the following issue in the Linux kernel code: ice: ensure periodic output start time is in the future
Problem Details: On E800 series hardware, if the start time for a periodic output signal is programmed into GLTSYN_TGT_H and GLTSYN_TGT_L registers, the hardware logic locks up and the periodic output signal never starts. Any future attempt to reprogram the clock function is futile as the hardware will not reset until ...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index e26320ce52ca..a99e0fbd0b8b 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -1783,6 +1783,7 @@ static int ice_ptp_write_perout(struct ice_hw *hw, unsigned...
fa8eda19015ca9ae625f46d4ecb13df651bb54cc
Analyze and fix the following issue in the Linux kernel code: ice: health.c: fix compilation on gcc 7.5
Problem Details: GCC 7 is not as good as GCC 8+ in telling what is a compile-time const, and thus could be used for static storage. Fortunately keeping strings as const arrays is enough to make old gcc happy. Excerpt from the report: My GCC is: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0. CC [M] drivers/net/ethernet/s...
```diff diff --git a/drivers/net/ethernet/intel/ice/devlink/health.c b/drivers/net/ethernet/intel/ice/devlink/health.c index ea40f7941259..19c3d37aa768 100644 --- a/drivers/net/ethernet/intel/ice/devlink/health.c +++ b/drivers/net/ethernet/intel/ice/devlink/health.c @@ -25,10 +25,10 @@ struct ice_health_status { * Th...
6bc9f42739889eaaaa47b90f48e4ef8323efa3ea
Analyze and fix the following issue in the Linux kernel code: mtd: mtdpart: Do not supply NULL to printf()
Problem Details: GCC compiler is not happy about NULL being supplied as printf() parameter: drivers/mtd/mtdpart.c:693:34: error: ‘%s’ directive argument is null [-Werror=format-overflow=] Move the code after the parser test for NULL, and drop the ternary completely. The user can deduct this since when it's not NULL t...
```diff diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 6811a714349d..994e8c51e674 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -690,10 +690,9 @@ int parse_mtd_partitions(struct mtd_info *master, const char *const *types, parser = mtd_part_parser_get(*types); if (!parser &&...
ca8cbbb2be8f906d9602a6e4324f8adf279e9cc2
Analyze and fix the following issue in the Linux kernel code: mtd: nand: Fix a kdoc comment
Problem Details: The max_bad_eraseblocks_per_lun member of nand_device obviously describes a number of *maximum* number of bad eraseblocks per LUN. Fix this obvious typo. Fixes: 377e517b5fa5 ("mtd: nand: Add max_bad_eraseblocks_per_lun info to memorg") Cc: <stable+noautosel@kernel.org> # fix kdoc comment Reviewed-by:...
```diff diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 0e2f228e8b4a..07486168d104 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -21,7 +21,7 @@ struct nand_device; * @oobsize: OOB area size * @pages_per_eraseblock: number of pages per eraseblock * @eraseblocks_per_...
0430bf9bc1ac068c8b8c540eb93e5751872efc51
Analyze and fix the following issue in the Linux kernel code: i3c: master: svc: Fix missing STOP for master request
Problem Details: The controller driver nacked the master request but didn't emit a STOP to end the transaction. The driver shall refuse the unsupported requests and return the controller state to IDLE by emitting a STOP. Signed-off-by: Stanley Chu <yschu@nuvoton.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: http...
```diff diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 57b9dec6b5a8..e0cd3ce28b7f 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -592,6 +592,7 @@ static void svc_i3c_master_ibi_work(struct work_struct *work) queue_work(mast...
c06acf7143bddaa3c0f7bedd8b99e48f6acb85c3
Analyze and fix the following issue in the Linux kernel code: i3c: master: svc: Use readsb helper for reading MDB
Problem Details: The target can send the MDB byte followed by additional data bytes. The readl on MRDATAB reads one actual byte, but the readsl advances the destination pointer by 4 bytes. This causes the subsequent payload to be copied to wrong position in the destination buffer. Cc: stable@kernel.org Fixes: dd3c5284...
```diff diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index a72ba5a7edd4..57b9dec6b5a8 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -425,7 +425,7 @@ static int svc_i3c_master_handle_ibi(struct svc_i3c_master *master, slot...
9cecad134d84d14dc72a0eea7a107691c3e5a837
Analyze and fix the following issue in the Linux kernel code: i3c: master: svc: Fix missing the IBI rules
Problem Details: The code does not add IBI rules for devices with controller capability. However, the secondary controller has the controller capability and works at target mode when the device is probed. Therefore, add IBI rules for such devices. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver")...
```diff diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 1d1f351b9a85..a72ba5a7edd4 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -1106,7 +1106,7 @@ static int svc_i3c_update_ibirules(struct svc_i3c_master *master) /* Create...
d93a855c31b72637e19659bca613766eaa89d496
Analyze and fix the following issue in the Linux kernel code: s390/ptrace: Avoid KASAN false positives in regs_get_kernel_stack_nth()
Problem Details: With recent ftrace changes, argument tracing has been added to the function tracer. As a result, ftrace opportunistically reads the first FTRACE_REGS_MAX_ARGS (i.e., 6) registers. On s390, only five arguments are passed in registers, and the 6-th is read from the stack. If a function has fewer than 6 a...
```diff diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index 6f2ae0be2298..34b8d9e745df 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c @@ -33,6 +33,7 @@ #include <asm/facility.h> #include <asm/machine.h> #include <asm/ptrace.h> +#include <asm/rwonce.h> #include <asm/fpu.h...
20de8f8d3178c695ed2f90bd81ff0b6df8cd32e8
Analyze and fix the following issue in the Linux kernel code: s390: Move s390 sysctls into their own file under arch/s390
Problem Details: Move s390 sysctls (spin_retry and userprocess_debug) into their own files under arch/s390. Create two new sysctl tables (2390_{fault,spin}_sysctl_table) which will be initialized with arch_initcall placing them after their original place in proc_root_init. This is part of a greater effort to move ctl ...
```diff diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c index 9d5669d449f2..0c895c869ebd 100644 --- a/arch/s390/lib/spinlock.c +++ b/arch/s390/lib/spinlock.c @@ -10,6 +10,7 @@ #include <linux/export.h> #include <linux/spinlock.h> #include <linux/jiffies.h> +#include <linux/sysctl.h> #include <linux...
fd5625fc86922f36bedee5846fefd647b7e72751
Analyze and fix the following issue in the Linux kernel code: ntb: use 64-bit arithmetic for the MSI doorbell mask
Problem Details: msi_db_mask is of type 'u64', still the standard 'int' arithmetic is performed to compute its value. While most of the ntb_hw drivers actually don't utilize the higher 32 bits of the doorbell mask now, this may be the case for Switchtec - see switchtec_ntb_init_db(). Found by Linux Verification Cente...
```diff diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c index a22ea4a4b202..4f775c3e218f 100644 --- a/drivers/ntb/ntb_transport.c +++ b/drivers/ntb/ntb_transport.c @@ -1353,7 +1353,7 @@ static int ntb_transport_probe(struct ntb_client *self, struct ntb_dev *ndev) qp_count = ilog2(qp_bitmap); ...
514b68711164b557342bc6169d898576fa905c0f
Analyze and fix the following issue in the Linux kernel code: VFS/autofs: try_lookup_one_len() does not need any locks
Problem Details: try_lookup_one_len() is identical to lookup_one_unlocked() except that it doesn't include the call to lookup_slow(). The latter doesn't need the inode to be locked, so the former cannot either. So fix the documentation, remove the WARN_ON and fix the only caller to not take the lock. Signed-off-by: ...
```diff diff --git a/fs/autofs/dev-ioctl.c b/fs/autofs/dev-ioctl.c index 6d57efbb8110..c5a6aae12d2c 100644 --- a/fs/autofs/dev-ioctl.c +++ b/fs/autofs/dev-ioctl.c @@ -442,7 +442,6 @@ static int autofs_dev_ioctl_timeout(struct file *fp, sbi->exp_timeout = timeout * HZ; } else { struct dentry *base = fp->f_path.d...
4279e72cab31dd3eb8c89591eb9d2affa90ab6aa
Analyze and fix the following issue in the Linux kernel code: ntb_perf: Delete duplicate dmaengine_unmap_put() call in perf_copy_chunk()
Problem Details: The function call “dmaengine_unmap_put(unmap)” was used in an if branch. The same call was immediately triggered by a subsequent goto statement. Thus avoid such a call repetition. This issue was detected by using the Coccinelle software. Fixes: 5648e56d03fa ("NTB: ntb_perf: Add full multi-port NTB AP...
```diff diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c index 72bc1d017a46..dfd175f79e8f 100644 --- a/drivers/ntb/test/ntb_perf.c +++ b/drivers/ntb/test/ntb_perf.c @@ -839,10 +839,8 @@ static int perf_copy_chunk(struct perf_thread *pthr, dma_set_unmap(tx, unmap); ret = dma_submit_error(dmae...
813b1a1a21fea47405dc44694c3031c3efcf0f03
Analyze and fix the following issue in the Linux kernel code: pinctrl: PINCTRL_AMDISP should depend on DRM_AMD_ISP
Problem Details: The AMD Image Signal Processor GPIO pin control functionality is only present on AMD platforms with ISP support, and its platform device is instantiated by the AMD ISP driver. Hence add a dependency on DRM_AMD_ISP, to prevent asking the user about this driver when configuring a kernel that does not su...
```diff diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index 5819f18b2ddc..464cc9aca157 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -51,6 +51,7 @@ config PINCTRL_AMD config PINCTRL_AMDISP tristate "AMDISP GPIO pin control" + depends on DRM_AMD_ISP || COMPILE_TEST depends...
8144e9c8f30fb23bb736a5d24d5c9d46965563c4
Analyze and fix the following issue in the Linux kernel code: ntb: intel: Fix using link status DB's
Problem Details: Make sure we are not using DB's which were remapped for link status. Fixes: f6e51c354b60 ("ntb: intel: split out the gen3 code") Signed-off-by: Nikita Shubin <n.shubin@yadro.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
```diff diff --git a/drivers/ntb/hw/intel/ntb_hw_gen3.c b/drivers/ntb/hw/intel/ntb_hw_gen3.c index ffcfc3e02c35..a5aa96a31f4a 100644 --- a/drivers/ntb/hw/intel/ntb_hw_gen3.c +++ b/drivers/ntb/hw/intel/ntb_hw_gen3.c @@ -215,6 +215,9 @@ static int gen3_init_ntb(struct intel_ntb_dev *ndev) } ndev->db_valid_mask = BI...
de203da734fae00e75be50220ba5391e7beecdf9
Analyze and fix the following issue in the Linux kernel code: ntb_hw_switchtec: Fix shift-out-of-bounds in switchtec_ntb_mw_set_trans
Problem Details: There is a kernel API ntb_mw_clear_trans() would pass 0 to both addr and size. This would make xlate_pos negative. [ 23.734156] switchtec switchtec0: MW 0: part 0 addr 0x0000000000000000 size 0x0000000000000000 [ 23.734158] ==========================================================================...
```diff diff --git a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c index ad1786be2554..f851397b65d6 100644 --- a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c +++ b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c @@ -288,7 +288,7 @@ static int switchtec_ntb_mw_set_trans(struct ntb_dev *ntb, int pidx, ...
e8eb8e1bdae94b9e003f5909519fd311d0936890
Analyze and fix the following issue in the Linux kernel code: riscv: fgraph: Select HAVE_FUNCTION_GRAPH_TRACER depends on HAVE_DYNAMIC_FTRACE_WITH_ARGS
Problem Details: Currently, fgraph on riscv relies on the infrastructure of DYNAMIC_FTRACE_WITH_ARGS. However, DYNAMIC_FTRACE_WITH_ARGS may be turned off on riscv, which will cause the enabled fgraph to be abnormal. Therefore, let's select HAVE_FUNCTION_GRAPH_TRACER depends on HAVE_DYNAMIC_FTRACE_WITH_ARGS. Fixes: a3e...
```diff diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index bae5fd79d690..e2c80e88b5cd 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -150,7 +150,7 @@ config RISCV select HAVE_DYNAMIC_FTRACE_WITH_ARGS if HAVE_DYNAMIC_FTRACE select HAVE_FTRACE_GRAPH_FUNC select HAVE_FTRACE_MCOUNT_RECORD if !XIP...
86947bdc28894520ed5aab0cf21b99ff0b659e07
Analyze and fix the following issue in the Linux kernel code: loop: move vfs_fsync() out of loop_update_dio()
Problem Details: If vfs_flush() is called with queue frozen, the queue freeze lock may be connected with FS internal lock, and lockdep warning can be triggered because the queue freeze lock is connected with too many global or sub-system locks. Fix the warning by moving vfs_fsync() out of loop_update_dio(): - vfs_fsy...
```diff diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 8ca092303794..674527d770dc 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -189,18 +189,12 @@ static bool lo_can_use_dio(struct loop_device *lo) */ static inline void loop_update_dio(struct loop_device *lo) { - bool dio_in_use = ...
ffa1e7ada456087c2402b37cd6b2863ced29aff0
Analyze and fix the following issue in the Linux kernel code: block: Make request_queue lockdep splats show up earlier
Problem Details: In recent kernels, there are lockdep splats around the struct request_queue::io_lockdep_map, similar to [1], but they typically don't show up until reclaim with writeback happens. Having multiple kernel versions released with a known risc of kernel deadlock during reclaim writeback should IMHO be addr...
```diff diff --git a/block/blk-core.c b/block/blk-core.c index 362d0a55b07a..4623de79effa 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -456,6 +456,12 @@ struct request_queue *blk_alloc_queue(struct queue_limits *lim, int node_id) lockdep_init_map(&q->q_lockdep_map, "&q->q_usage_counter(queue)", &q->q_...
b0d42581195603f38184d7c130d0e2f43f40fb33
Analyze and fix the following issue in the Linux kernel code: block: fix a comment in the queue_attrs[] array
Problem Details: queue_ra_entry uses limits_lock just like the attributes above it. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Nilay Shroff <nilay@linux.ibm.com> Link: https://lore.kernel.org/r/20250312150127.703534-1-hch@lst.de Signed-off-by: Jens Axboe...
```diff diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index d584461a1d84..a2882751f0d2 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -671,11 +671,6 @@ static struct attribute *queue_attrs[] = { &queue_dax_entry.attr, &queue_virt_boundary_mask_entry.attr, &queue_dma_alignment_entry.attr, - - /* - ...
cd0b9da682cfe3b595b1d8195e6bfe8acc76e2c3
Analyze and fix the following issue in the Linux kernel code: wifi: nl80211: re-enable multi-link reconfiguration
Problem Details: With the recent fixes, we can re-enable multi-link reconfiguration. Also add a CMD() entry to allow userspace discovery for it. Link: https://patch.msgid.link/20250318135009.a95c43837a0f.Ic6ed3d184e5be8ba47c6affa7271daaf824fd823@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
```diff diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 1a9fc403d50d..f039a7d0d6f7 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -2773,6 +2773,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, CMD(update_ft_ies, UPDATE_FT_IES); if (rdev->wiphy.s...
1ec1207722c8bf584a09754afa2966698d6dd7af
Analyze and fix the following issue in the Linux kernel code: xfs: call xfs_buf_alloc_backing_mem from _xfs_buf_alloc
Problem Details: We never allocate a buffer without backing memory. Simplify the call chain by calling xfs_buf_alloc_backing_mem from _xfs_buf_alloc. To avoid a forward declaration, move _xfs_buf_alloc down a bit in the file. Also drop the pointless _-prefix from _xfs_buf_alloc. Signed-off-by: Christoph Hellwig <hc...
```diff diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 106ee81fa56f..f42f6e47f783 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -118,71 +118,6 @@ xfs_buf_free_maps( } } -static int -_xfs_buf_alloc( - struct xfs_buftarg *target, - struct xfs_buf_map *map, - int nmaps, - xfs_buf_flags_t flags, -...
33981b1c4e499021421686dcfa7b3d23a430d00e
Analyze and fix the following issue in the Linux kernel code: riscv: Fix missing __free_pages() in check_vector_unaligned_access()
Problem Details: The locally allocated pages are never freed up, so add the corresponding __free_pages(). Fixes: e7c9d66e313b ("RISC-V: Report vector unaligned access speed hwprobe") Link: https://lore.kernel.org/r/20250228090613.345309-1-alexghiti@rivosinc.com Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
```diff diff --git a/arch/riscv/kernel/unaligned_access_speed.c b/arch/riscv/kernel/unaligned_access_speed.c index 91f189cf1611..074ac4abd023 100644 --- a/arch/riscv/kernel/unaligned_access_speed.c +++ b/arch/riscv/kernel/unaligned_access_speed.c @@ -349,7 +349,7 @@ static void check_vector_unaligned_access(struct work...
475afa39b123699e910c61ad9a51cedce4a0d310
Analyze and fix the following issue in the Linux kernel code: riscv: Fix the __riscv_copy_vec_words_unaligned implementation
Problem Details: Correct the VEC_S macro definition to fix the implementation of vector words copy in the case of unalignment in RISC-V. Fixes: e7c9d66e313b ("RISC-V: Report vector unaligned access speed hwprobe") Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Signed-off-by: Tingbo Liao <tingbo.liao@starfivetec...
```diff diff --git a/arch/riscv/kernel/vec-copy-unaligned.S b/arch/riscv/kernel/vec-copy-unaligned.S index d16f19f1b3b6..7ce4de6f6e69 100644 --- a/arch/riscv/kernel/vec-copy-unaligned.S +++ b/arch/riscv/kernel/vec-copy-unaligned.S @@ -11,7 +11,7 @@ #define WORD_SEW CONCATENATE(e, WORD_EEW) #define VEC_L CONCATENATE...
38e94cefbf45c1edc5b751ab90a3088f7c6fac1a
Analyze and fix the following issue in the Linux kernel code: ALSA: usb-audio: separate DJM-A9 cap lvl options
Problem Details: Mixer quicks for the Pioneer DJM-A9 mixer was added in 5289d00 with additional capture level values added to the common DJM array of values. This breaks the existing DJM mixers however as alsa-utils relies on enumeration of the actual mixer options based on the value array which results in error when ...
```diff diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index ed6127b0389f..d4745b98a93e 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -3688,8 +3688,7 @@ static const char *snd_djm_get_label(u8 device_idx, u16 wvalue, u16 windex) // common DJM capture level option values s...
5f1a58ed91a040d4625d854f9bb3dd4995919202
Analyze and fix the following issue in the Linux kernel code: riscv: ftrace: Add parentheses in macro definitions of make_call_t0 and make_call_ra
Problem Details: This patch adds parentheses to parameters caller and callee of macros make_call_t0 and make_call_ra. Every existing invocation of these two macros uses a single variable for each argument, so the absence of the parentheses seems okay. However, future invocations might use more complex expressions as ar...
```diff diff --git a/arch/riscv/include/asm/ftrace.h b/arch/riscv/include/asm/ftrace.h index ec6db1162021..9704a73e515a 100644 --- a/arch/riscv/include/asm/ftrace.h +++ b/arch/riscv/include/asm/ftrace.h @@ -92,7 +92,7 @@ struct dyn_arch_ftrace { #define make_call_t0(caller, callee, call) \ do { \ unsigne...
c746ff4a67f4842e90fe232d2c9fc983f4034848
Analyze and fix the following issue in the Linux kernel code: pinctrl: spacemit: PINCTRL_SPACEMIT_K1 should not default to y unconditionally
Problem Details: Merely enabling compile-testing should not enable additional functionality. Fixes: 7ff4faba63571c51 ("pinctrl: spacemit: enable config option") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Yixun Lan <dlan@gentoo.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com...
```diff diff --git a/drivers/pinctrl/spacemit/Kconfig b/drivers/pinctrl/spacemit/Kconfig index a2f98b3f8a75..d6f6017fd097 100644 --- a/drivers/pinctrl/spacemit/Kconfig +++ b/drivers/pinctrl/spacemit/Kconfig @@ -7,7 +7,7 @@ config PINCTRL_SPACEMIT_K1 bool "SpacemiT K1 SoC Pinctrl driver" depends on ARCH_SPACEMIT || ...
bba547810c66434475d8800b3411c59ef71eafe9
Analyze and fix the following issue in the Linux kernel code: riscv: tracing: Fix __write_overflow_field in ftrace_partial_regs()
Problem Details: The size of &regs->a0 is unknown, causing the error: ../include/linux/fortify-string.h:571:25: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning] Fix this by wrapping the requi...
```diff diff --git a/arch/riscv/include/asm/ftrace.h b/arch/riscv/include/asm/ftrace.h index c4721ce44ca4..ec6db1162021 100644 --- a/arch/riscv/include/asm/ftrace.h +++ b/arch/riscv/include/asm/ftrace.h @@ -207,7 +207,7 @@ ftrace_partial_regs(const struct ftrace_regs *fregs, struct pt_regs *regs) { struct __arch_ftr...
418af0eafb48bbd972040703e5ff5ba94526b5b5
Analyze and fix the following issue in the Linux kernel code: riscv: Fix a comment typo in set_mm_asid()
Problem Details: s/verion/version Signed-off-by: Chin Yik Ming <yikming2222@gmail.com> Reviewed-by: Charlie Jenkins <charlie@rivosinc.com> Link: https://lore.kernel.org/r/20241114212725.4172401-1-yikming2222@gmail.com Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
```diff diff --git a/arch/riscv/mm/context.c b/arch/riscv/mm/context.c index 4abe3de23225..55c20ad1f744 100644 --- a/arch/riscv/mm/context.c +++ b/arch/riscv/mm/context.c @@ -158,7 +158,7 @@ static void set_mm_asid(struct mm_struct *mm, unsigned int cpu) * * - We get a zero back from the cmpxchg and end up waitin...
e74c0a7875cfec27c25f582f001cc4625a0f8c07
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: dvm: Avoid -Wflex-array-member-not-at-end warnings
Problem Details: -Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. So, in order to avoid ending up with a flexible-array member in the middle of multiple other structs, we use the `__struct_group()` helper to create a new tagged `struct iwl_tx_cmd_hdr`. This stru...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/commands.h b/drivers/net/wireless/intel/iwlwifi/dvm/commands.h index 3f49c0bccb28..96ea6c8dfc89 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/commands.h +++ b/drivers/net/wireless/intel/iwlwifi/dvm/commands.h @@ -1180,85 +1180,87 @@ struct iwl_dram_scrat...
db9b4b8311c19410ea7b064902b16c371f0fff83
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: do not use iwlmld for non-wifi7 devices
Problem Details: Roll-back to use iwlmvm for those devices. iwlmld will support wifi7 capable devices only. The firmware for the non-wifi7 capable will soon be frozen and we don't want iwlmld to have to support devices that will require the old APIs. Fixes: d1e879ec600f9 ("wifi: iwlwifi: add iwlmld sub-driver") Review...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c index 15d2211e565c..d36837501e08 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c @@ -174,6 +174,11 @@ static inline char iwl_drv_get_step(int step...
e6f98260d76c9204cf799b281211f4a62f932678
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: remove a buggy else statement in op_mode selection
Problem Details: This led to weird behavior. The next debug print was not printed. Fixes: d1e879ec600f9 ("wifi: iwlwifi: add iwlmld sub-driver") Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Link: https://patch.msgid.link/20250318103019.bf54d0474909.Icfb129d4cf13b42b13e2ac4aa1bd171ef46bf561@changeid S...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c index dcf07ac042f7..15d2211e565c 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Cla...
a4a58f510bd8c28f6191eed5698a5291b420c2d6
Analyze and fix the following issue in the Linux kernel code: riscv: Remove unused TASK_TI_FLAGS
Problem Details: Since commit f0bddf50586d ("riscv: entry: Convert to generic entry"), TASK_TI_FLAGS is not used any more, so remove it. Fixes: f0bddf50586d ("riscv: entry: Convert to generic entry") Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Reviewed-by: Charlie Jenkins <charlie@rivosinc.com> Link: https://lo...
```diff diff --git a/arch/riscv/kernel/asm-offsets.c b/arch/riscv/kernel/asm-offsets.c index e89455a6a0e5..16490755304e 100644 --- a/arch/riscv/kernel/asm-offsets.c +++ b/arch/riscv/kernel/asm-offsets.c @@ -36,7 +36,6 @@ void asm_offsets(void) OFFSET(TASK_THREAD_S11, task_struct, thread.s[11]); OFFSET(TASK_TI_CPU...
eb10039709402cc1fab1533a1ecc1a54c2152e68
Analyze and fix the following issue in the Linux kernel code: RISC-V: hwprobe: Expose Zicbom extension and its block size
Problem Details: Expose Zicbom through hwprobe and also provide a key to extract its respective block size. [ alex: Fix merge conflicts and hwprobe numbering ] Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Samuel Holland <samuel.holland@sifive.com> Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com...
```diff diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 67ef406cdb67..2792f12e90ba 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -260,6 +260,9 @@ The following keys are defined: defined in the RISC-V ISA manual star...
45ff65e30deb919604e68faed156ad96ce7474d9
Analyze and fix the following issue in the Linux kernel code: ASoC: ti: j721e-evm: Fix clock configuration for ti,j7200-cpb-audio compatible
Problem Details: For 'ti,j7200-cpb-audio' compatible, there is support for only one PLL for 48k. For 11025, 22050, 44100 and 88200 sampling rates, due to absence of J721E_CLK_PARENT_44100, we get EINVAL while running any audio application. Add support for these rates by using the 48k parent clock and adjusting the cloc...
```diff diff --git a/sound/soc/ti/j721e-evm.c b/sound/soc/ti/j721e-evm.c index d9d1e021f5b2..0f96cc45578d 100644 --- a/sound/soc/ti/j721e-evm.c +++ b/sound/soc/ti/j721e-evm.c @@ -182,6 +182,8 @@ static int j721e_configure_refclk(struct j721e_priv *priv, clk_id = J721E_CLK_PARENT_48000; else if (!(rate % 11025) && ...
51f0b8911ec4355cea07b180f6569cc52f65aaa8
Analyze and fix the following issue in the Linux kernel code: firmware: thead: add CONFIG_MAILBOX dependency
Problem Details: Without this, the driver fails to build: ld: drivers/firmware/thead,th1520-aon.o: in function `th1520_aon_call_rpc': thead,th1520-aon.c:(.text+0x28): undefined reference to `mbox_send_message' ld: drivers/firmware/thead,th1520-aon.o: in function `th1520_aon_deinit': thead,th1520-aon.c:(.text+0x17e): u...
```diff diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index 52c145097770..ebdd972e6f19 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -215,6 +215,7 @@ config SYSFB_SIMPLEFB config TH1520_AON_PROTOCOL tristate "Always-On firmware protocol" depends on ARCH_THEAD || COMPILE...
ae85dabcef32a4cb841ec30792edbebb965345b2
Analyze and fix the following issue in the Linux kernel code: firmware: thead,th1520-aon: Fix use after free in th1520_aon_init()
Problem Details: Record the error code before freeing "aon_chan" to avoid a use after free. Fixes: e4b3cbd840e5 ("firmware: thead: Add AON firmware protocol driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/f19be994-d355-48a6-ab45-d0f7e5955daf@stanley.mountain Signed-off-...
```diff diff --git a/drivers/firmware/thead,th1520-aon.c b/drivers/firmware/thead,th1520-aon.c index 4416e9bbf854..38f812ac9920 100644 --- a/drivers/firmware/thead,th1520-aon.c +++ b/drivers/firmware/thead,th1520-aon.c @@ -203,6 +203,7 @@ struct th1520_aon_chan *th1520_aon_init(struct device *dev) { struct th1520_ao...
beba9487138151c17dec17105364b35935f21562
Analyze and fix the following issue in the Linux kernel code: xfs: fix a missing unlock in xfs_growfs_data
Problem Details: The newly added check for the internal RT device needs to unlock m_growlock just like all ther other error cases. Fixes: bdc03eb5f98f ("xfs: allow internal RT devices for zoned mode") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Carlo...
```diff diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index ee2cefbd5df8..d7658b7dcdbd 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c @@ -301,7 +301,7 @@ xfs_growfs_data( struct xfs_mount *mp, struct xfs_growfs_data *in) { - int error = 0; + int error; if (!capable(CAP_SYS_ADMIN)) retur...
9a81fc3480bf5dbe2bf80e278c440770f6ba2692
Analyze and fix the following issue in the Linux kernel code: ipv6: Set errno after ip_fib_metrics_init() in ip6_route_info_create().
Problem Details: While creating a new IPv6, we could get a weird -ENOMEM when RTA_NH_ID is set and either of the conditions below is true: 1) CONFIG_IPV6_SUBTREES is enabled and rtm_src_len is specified 2) nexthop_get() fails e.g.) # strace ip -6 route add fe80::dead:beef:dead:beef nhid 1 from :: recvmsg(3, ...
```diff diff --git a/net/ipv6/route.c b/net/ipv6/route.c index bc6bcf5d7133..15ce21afc8c6 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -3803,10 +3803,12 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg, if (nh) { if (rt->fib6_src.plen) { NL_SET_ERR_MSG(extack, "Nexthops can ...
9740890ee20e01f99ff1dde84c63dcf089fabb98
Analyze and fix the following issue in the Linux kernel code: ipv6: Fix memleak of nhc_pcpu_rth_output in fib_check_nh_v6_gw().
Problem Details: fib_check_nh_v6_gw() expects that fib6_nh_init() cleans up everything when it fails. Commit 7dd73168e273 ("ipv6: Always allocate pcpu memory in a fib6_nh") moved fib_nh_common_init() before alloc_percpu_gfp() within fib6_nh_init() but forgot to add cleanup for fib6_nh->nh_common.nhc_pcpu_rth_output in...
```diff diff --git a/net/ipv6/route.c b/net/ipv6/route.c index ef2d23a1e3d5..bc6bcf5d7133 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -3644,7 +3644,8 @@ out: in6_dev_put(idev); if (err) { - lwtstate_put(fib6_nh->fib_nh_lws); + fib_nh_common_release(&fib6_nh->nh_common); + fib6_nh->nh_common.nhc_pc...
daa624d3c2ddffdcbad140a9625a4064371db44f
Analyze and fix the following issue in the Linux kernel code: net: ipv6: fix TCP GSO segmentation with NAT
Problem Details: When updating the source/destination address, the TCP/UDP checksum needs to be updated as well. Fixes: bee88cd5bd83 ("net: add support for segmenting TCP fraglist GSO packets") Signed-off-by: Felix Fietkau <nbd@nbd.name> Link: https://patch.msgid.link/20250311212530.91519-1-nbd@nbd.name Signed-off-by:...
```diff diff --git a/net/ipv6/tcpv6_offload.c b/net/ipv6/tcpv6_offload.c index a45bf17cb2a1..ae2da28f9dfb 100644 --- a/net/ipv6/tcpv6_offload.c +++ b/net/ipv6/tcpv6_offload.c @@ -94,14 +94,23 @@ INDIRECT_CALLABLE_SCOPE int tcp6_gro_complete(struct sk_buff *skb, int thoff) } static void __tcpv6_gso_segment_csum(stru...
79195147644653ebffadece31a42181e4c48c07d
Analyze and fix the following issue in the Linux kernel code: RDMA/mlx5: Fix calculation of total invalidated pages
Problem Details: When invalidating an address range in mlx5, there is an optimization to do UMR operations in chunks. Previously, the invalidation counter was incorrectly updated for the same indexes within a chunk. Now, the invalidation counter is updated only when a chunk is complete and mlx5r_umr_update_xlt() is cal...
```diff diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c index f1e23583e6c0..de9683344f5e 100644 --- a/drivers/infiniband/hw/mlx5/odp.c +++ b/drivers/infiniband/hw/mlx5/odp.c @@ -308,9 +308,6 @@ static bool mlx5_ib_invalidate_range(struct mmu_interval_notifier *mni, blk_start_idx = ...
5ed3b0cb3f827072e93b4c5b6e2b8106fd7cccbd
Analyze and fix the following issue in the Linux kernel code: RDMA/mlx5: Fix mlx5_poll_one() cur_qp update flow
Problem Details: When cur_qp isn't NULL, in order to avoid fetching the QP from the radix tree again we check if the next cqe QP is identical to the one we already have. The bug however is that we are checking if the QP is identical by checking the QP number inside the CQE against the QP number inside the mlx5_ib_qp, ...
```diff diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c index 4c54dc578069..1aa5311b03e9 100644 --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c @@ -490,7 +490,7 @@ repoll: } qpn = ntohl(cqe64->sop_drop_qpn) & 0xffffff; - if (!*cur_qp || (qpn != (*cur_qp)-...
2fc8a346625eb1abfe202062c7e6a13d76cde5ea
Analyze and fix the following issue in the Linux kernel code: net: mana: Support holes in device list reply msg
Problem Details: According to GDMA protocol, holes (zeros) are allowed at the beginning or middle of the gdma_list_devices_resp message. The existing code cannot properly handle this, and may miss some devices in the list. To fix, scan the entire list until the num_of_devs are found, or until the end of the list. Cc:...
```diff diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c index 11457b6296cc..638ef64d639f 100644 --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c @@ -134,9 +134,10 @@ static int mana_gd_detect_device...
f0c2427412b43cdf1b7b0944749ea17ddb97d5a5
Analyze and fix the following issue in the Linux kernel code: RDMA/mlx5: Fix page_size variable overflow
Problem Details: Change all variables storing mlx5_umem_mkc_find_best_pgsz() result to unsigned long to support values larger than 31 and avoid overflow. For example: If we try to register 4GB of memory that is contiguous in physical memory, the driver will optimize the page_size and try to use an mkey with 4GB entity...
```diff diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index 58486f79c5e5..2080458cabd1 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -56,7 +56,7 @@ static void create_mkey_callback(int status, struct mlx5_async_work *context); static struct mlx5...
24d693cf6c89d216a68634d44fa93e4400775d94
Analyze and fix the following issue in the Linux kernel code: RDMA/mlx5: Fix cache entry update on dereg error
Problem Details: Fix double decrement of 'in_use' counter on push_mkey_locked() failure while deregistering an MR. If we fail to return an mkey to the cache in cache_ent_find_and_store() it'll update the 'in_use' counter. Its caller, revoke_mr(), also updates it, thus having double decrement. Wrong value of 'in_use' c...
```diff diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index 1ffa4b3d0f76..c88016630f9d 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -1967,7 +1967,6 @@ static int cache_ent_find_and_store(struct mlx5_ib_dev *dev, if (mr->mmkey.cache_ent) { ...
a0130ef84b00c68ba0b79ee974a0f01459741421
Analyze and fix the following issue in the Linux kernel code: RDMA/mlx5: Fix MR cache initialization error flow
Problem Details: Destroy all previously created cache entries and work queue when rolling back the MR cache initialization upon an error. Fixes: 73d09b2fe833 ("RDMA/mlx5: Introduce mlx5r_cache_rb_key") Signed-off-by: Michael Guralnik <michaelgur@nvidia.com> Reviewed-by: Yishai Hadas <yishaih@nvidia.com> Link: https://...
```diff diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index bb02b6adbf2c..1ffa4b3d0f76 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -919,6 +919,25 @@ mkeys_err: return ERR_PTR(ret); } +static void mlx5r_destroy_cache_entries(struct mlx5_ib_d...
5f079290e5913a0060e059500b7d440990ac1066
Analyze and fix the following issue in the Linux kernel code: net: ethernet: ti: am65-cpsw: Fix NAPI registration sequence
Problem Details: Registering the interrupts for TX or RX DMA Channels prior to registering their respective NAPI callbacks can result in a NULL pointer dereference. This is seen in practice as a random occurrence since it depends on the randomness associated with the generation of traffic by Linux and the reception of ...
```diff diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index 2806238629f8..bef734c6e5c2 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -2306,14 +2306,18 @@ static void am65_cpsw_nuss_remove_tx_chns(struct am65_cps...
887c5c12e80c8424bd471122d2e8b6b462e12874
Analyze and fix the following issue in the Linux kernel code: um: work around sched_yield not yielding in time-travel mode
Problem Details: sched_yield by a userspace may not actually cause scheduling in time-travel mode as no time has passed. In the case seen it appears to be a badly implemented userspace spinlock in ASAN. Unfortunately, with time-travel it causes an extreme slowdown or even deadlock depending on the kernel configuration ...
```diff diff --git a/arch/um/include/linux/time-internal.h b/arch/um/include/linux/time-internal.h index b22226634ff6..138908b999d7 100644 --- a/arch/um/include/linux/time-internal.h +++ b/arch/um/include/linux/time-internal.h @@ -83,6 +83,8 @@ extern void time_travel_not_configured(void); #define time_travel_del_even...
089db01ea7eb4f366be45b9390a04f1c601c0071
Analyze and fix the following issue in the Linux kernel code: um/locking: Remove semicolon from "lock" prefix
Problem Details: Minimum version of binutils required to compile the kernel is 2.25. This version correctly handles the "lock" prefix, so it is possible to remove the semicolon, which was used to support ancient versions of GNU as. Due to the semicolon, the compiler considers "lock; insn" as two separate instructions....
```diff diff --git a/arch/x86/um/asm/barrier.h b/arch/x86/um/asm/barrier.h index 4da336965698..b51aefd6ec2b 100644 --- a/arch/x86/um/asm/barrier.h +++ b/arch/x86/um/asm/barrier.h @@ -12,9 +12,9 @@ */ #ifdef CONFIG_X86_32 -#define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2) -#define rmb()...
0bc754d1e31f40f4a343b692096d9e092ccc0370
Analyze and fix the following issue in the Linux kernel code: um: hostfs: avoid issues on inode number reuse by host
Problem Details: Some file systems (e.g. ext4) may reuse inode numbers once the inode is not in use anymore. Usually hostfs will keep an FD open for each inode, but this is not always the case. In the case of sockets, this cannot even be done properly. As such, the following sequence of events was possible: * applica...
```diff diff --git a/fs/hostfs/hostfs.h b/fs/hostfs/hostfs.h index 8b39c15c408c..15b2f094d36e 100644 --- a/fs/hostfs/hostfs.h +++ b/fs/hostfs/hostfs.h @@ -60,7 +60,7 @@ struct hostfs_stat { unsigned int uid; unsigned int gid; unsigned long long size; - struct hostfs_timespec atime, mtime, ctime; + struct hostfs_t...
84a6fc378471fbeaf48f8604566a5a33a3d63c18
Analyze and fix the following issue in the Linux kernel code: um: remove copy_from_kernel_nofault_allowed
Problem Details: There is no need to override the default version of this function anymore as UML now has proper _nofault memory access functions. Doing this also fixes the fact that the implementation was incorrect as using mincore() will incorrectly flag pages as inaccessible if they were swapped out by the host. F...
```diff diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h index 5babad8c5f75..bc02767f0639 100644 --- a/arch/um/include/shared/os.h +++ b/arch/um/include/shared/os.h @@ -213,7 +213,6 @@ extern int os_protect_memory(void *addr, unsigned long len, extern int os_unmap_memory(void *addr, int len); ex...
5550187c4c21740942c32a9ae56f9f472a104cb4
Analyze and fix the following issue in the Linux kernel code: um: Pass the correct Rust target and options with gcc
Problem Details: In order to work around some issues with disabling SSE on older versions of gcc (compilation would fail upon seeing a function declaration containing a float, even if it was never called or defined), the corresponding CFLAGS and RUSTFLAGS were only set when using clang. However, this led to two proble...
```diff diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um index a46b1397ad01..c86cbd9cbba3 100644 --- a/arch/x86/Makefile.um +++ b/arch/x86/Makefile.um @@ -7,12 +7,13 @@ core-y += arch/x86/crypto/ # GCC versions < 11. See: # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99652 # -ifeq ($(CONFIG_CC_IS_CLANG),y) ...
9868c4ce9481043d6c11f7421fe2b9637aa0feee
Analyze and fix the following issue in the Linux kernel code: wifi: mwifiex: Fix RF calibration data download from file
Problem Details: This patch resolves an issue where RF calibration data from a file could not be downloaded to the firmware. The feature to download calibration data from a file was broken by the commit: d39fbc88956e. The issue arose because the function `mwifiex_cmd_cfg_data()` was modified in a way that prevented pr...
```diff diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h index 4a96281792cc..91458f3bd14a 100644 --- a/drivers/net/wireless/marvell/mwifiex/fw.h +++ b/drivers/net/wireless/marvell/mwifiex/fw.h @@ -454,6 +454,11 @@ enum mwifiex_channel_flags { #define HostCmd_RET_BIT ...
69ae7e1f73abae20f26e3536ca4a980b90eafeb7
Analyze and fix the following issue in the Linux kernel code: wifi: mwifiex: Fix premature release of RF calibration data.
Problem Details: This patch resolves an issue where RF calibration data was being released before the download process. Without this fix, the external calibration data file would not be downloaded at all. Fixes: d39fbc88956e ("mwifiex: remove cfg_data construction") Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com> Link:...
```diff diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index 45eecb5f643b..b07cb302a00c 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -691,10 +691,6 @@ err_dnld_fw: init_failed = true; done: - if...
fc88dee89d7b63eeb17699393eb659aadf9d9b7c
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: init wiphy_work before allocating rfkill fails
Problem Details: syzbort reported a uninitialize wiphy_work_lock in cfg80211_dev_free. [1] After rfkill allocation fails, the wiphy release process will be performed, which will cause cfg80211_dev_free to access the uninitialized wiphy_work related data. Move the initialization of wiphy_work to before rfkill initiali...
```diff diff --git a/net/wireless/core.c b/net/wireless/core.c index 983c4d3c9552..9e6b31903121 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -546,6 +546,9 @@ use_default_name: INIT_WORK(&rdev->mgmt_registrations_update_wk, cfg80211_mgmt_registrations_update_wk); spin_lock_init(&rdev->mgmt_regi...
16ee3ea8faef8ff042acc15867a6c458c573de61
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: check basic rates validity in sta_link_apply_parameters
Problem Details: When userspace sets supported rates for a new station via NL80211_CMD_NEW_STATION, it might send a list that's empty or contains only invalid values. Currently, we process these values in sta_link_apply_parameters() without checking the result of ieee80211_parse_bitrates(), which can lead to an empty r...
```diff diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 211ad64cfcdf..9f683f838431 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1907,12 +1907,12 @@ static int sta_link_apply_parameters(struct ieee80211_local *local, } if (params->supported_rates && - params->supported_rates_len) { -...
892726f0099efdbec0be8275b58af0dc70e02ff2
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: fix indentation in ieee80211_set_monitor_channel()
Problem Details: There's some confusing indentation, I thought even that braces were missing. Fix indentation here. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
```diff diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 76453c0f82a5..211ad64cfcdf 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -919,7 +919,7 @@ static int ieee80211_set_monitor_channel(struct wiphy *wiphy, sdata = IEEE80211_DEV_TO_SUB_IF(dev); if (!ieee80211_hw_check(&local->hw, NO_VIRTUA...
4fcfcbe457349267fe048524078e8970807c1a5b
Analyze and fix the following issue in the Linux kernel code: wifi: mwifiex: Fix HT40 bandwidth issue.
Problem Details: This patch addresses an issue where, despite the AP supporting 40MHz bandwidth, the connection was limited to 20MHz. Without this fix, even if the access point supports 40MHz, the bandwidth after connection remains at 20MHz. This issue is not a regression. Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com...
```diff diff --git a/drivers/net/wireless/marvell/mwifiex/11n.c b/drivers/net/wireless/marvell/mwifiex/11n.c index 66f0f5377ac1..738bafc3749b 100644 --- a/drivers/net/wireless/marvell/mwifiex/11n.c +++ b/drivers/net/wireless/marvell/mwifiex/11n.c @@ -403,12 +403,14 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *...
5789f7913ee37e0f54c073287ab4b5942feb4d12
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mld: iwl_mld_remove_link can't fail
Problem Details: iwl_mld_remove_link removes the link from both the FW and from the driver. If removing it from the FW failed, we assume that the FW is dead anyway and remove it from the driver as well. On the other hand, we still return an error value, indicating the caller (i.e. mac80211) that the link couldn't be re...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mld/link.c b/drivers/net/wireless/intel/iwlwifi/mld/link.c index 6db8b5305349..82a4979a3af3 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/link.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/link.c @@ -455,7 +455,7 @@ void iwl_mld_deactivate_link(struct iwl_m...
bb307028a0c8a39b1b2bc4960794ea00f774637e
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mld: fix copy/paste error
Problem Details: iwl_mld_emlsr_tmp_non_bss_done_wk used the wrong work name (prevent_done_wk) to extract the mld_vif pointer, so the pointer was a wrong one, leading to a page fault. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250313002008.aabb2232f9dd.I7cb24458a7...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mlo.c b/drivers/net/wireless/intel/iwlwifi/mld/mlo.c index 4bd3b2b63769..a870e169e265 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/mlo.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/mlo.c @@ -99,7 +99,7 @@ void iwl_mld_emlsr_tmp_non_bss_done_wk(struct w...
cf6efe8902350d2bdd968784a2522b672d77bb81
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mld: KUnit: test iwl_mld_channel_load_allows_emlsr
Problem Details: Add tests to check that iwl_mld_channel_load_allows_emlsr decides correctly whether EMLSR is allowed or not. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Link: https://patch.msgid.link/20250313002008.06fdf416c62f.If6e8f0e017287e...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mlo.c b/drivers/net/wireless/intel/iwlwifi/mld/mlo.c index 9342f03c0908..4bd3b2b63769 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/mlo.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/mlo.c @@ -602,12 +602,6 @@ void iwl_mld_emlsr_unblock_tpt_wk(struct wip...
b54b249084648c86fcb351a186210d144c20f544
Analyze and fix the following issue in the Linux kernel code: bnxt_en: Add support for a new ethtool dump flag 3
Problem Details: When doing a live coredump with ethtool -w, the context data cached in the NIC is not dumped by the FW by default. The reason is that retrieving this cached context data with traffic running may cause problems. Add a new dump flag 3 to allow the option to include this cached context data which may be...
```diff diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index e85b5ce94f58..e93ba0e4f087 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -2697,6 +2697,7 @@ struct bnxt { #define BNXT_DUMP_LIVE 0 #define BNXT_...
f2aac4c73c9945cce156fd58a9a2f31f2c8a90c7
Analyze and fix the following issue in the Linux kernel code: ata: libata-core: Add ATA_QUIRK_NO_LPM_ON_ATI for certain Samsung SSDs
Problem Details: Before commit 7627a0edef54 ("ata: ahci: Drop low power policy board type") the ATI AHCI controllers specified board type 'board_ahci' rather than board type 'board_ahci'. This means that LPM was historically not enabled for the ATI AHCI controllers. By looking at commit 7a8526a5cd51 ("libata: Add ATA_...
```diff diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index c085dd81ebe7..d956735e2a76 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2845,6 +2845,10 @@ int ata_dev_configure(struct ata_device *dev) (id[ATA_ID_SATA_CAPABILITY] & 0xe) == 0x2) dev->quirks |= ATA_Q...
4458b8f68dc7ab8309291f1667157d0250938291
Analyze and fix the following issue in the Linux kernel code: riscv: hwprobe: export Zicntr and Zihpm extensions
Problem Details: Export Zicntr and Zihpm ISA extensions through the hwprobe syscall. [ alex: Fix hwprobe numbering ] Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com> Acked-by: Jesse Taube <jesse@rivosinc.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20240913051324...
```diff diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index f273ea15a8e8..35a979dd164a 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -183,6 +183,9 @@ The following keys are defined: defined in the Atomic Compare-and-Swa...
d3817d091fe6480de5bf3faba0fc2ce25f8d023e
Analyze and fix the following issue in the Linux kernel code: riscv: remove useless pc check in stacktrace handling
Problem Details: Checking for pc to be a kernel text address at this location is useless since pc == handle_exception. Remove this check. [ alex: Fix merge conflict ] Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Link: https://lore.kernel.org/r/20240830084934...
```diff diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c index d4355c770c36..3fe9e6edef8f 100644 --- a/arch/riscv/kernel/stacktrace.c +++ b/arch/riscv/kernel/stacktrace.c @@ -74,7 +74,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, &frame->ra); ...
b611cf6b57a8091a2ebbe415f421865407968ef2
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mld: add support for DHC_TOOLS_UMAC_GET_TAS_STATUS command
Problem Details: Add debugfs file in mld to retrieve TAS status per radio, TAS block list, current mcc, OEM name and OEM allowed list. This will add ability to get TAS status to user application via debugfs and required for debugging. Add the required API definitions and some debug host command utils. Signed-off-by: ...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/dhc.h b/drivers/net/wireless/intel/iwlwifi/fw/api/dhc.h index dbe06f3fc662..b6d79c678cd8 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/dhc.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/dhc.h @@ -15,6 +15,19 @@ enum iwl_dhc_table_id { * @DHC_...
8301e2636c106f28f0deca5d73fe72015db6acb2
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mld: Ensure wiphy lock is held during debugfs read operations
Problem Details: The WIPHY_DEBUGFS_READ_WRITE_FILE_OPS_MLD macro is intended to call read/write handlers with the wiphy lock held. However, the current implementation uses the MLD_DEBUGFS_READ_WRAPPER macro, which does not hold the wiphy lock during read operations. This fix updates the WIPHY_DEBUGFS_READ_WRITE_FILE_OP...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mld/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mld/debugfs.c index 1d4b2ad5d388..c67dbbf575d7 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/debugfs.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/debugfs.c @@ -178,8 +178,7 @@ iwl_dbgfs_he_sniffer_params_w...
ea841520c50f5f7c72c8070e3b79e1927b94fabf
Analyze and fix the following issue in the Linux kernel code: wifi: nl80211: store chandef on the correct link when starting CAC
Problem Details: Link ID to store chandef is still being used as 0 even in case of MLO which is incorrect. This leads to issue during CAC completion where link 0 as well gets stopped. Fixes: 0b7798232eee ("wifi: cfg80211/mac80211: use proper link ID for DFS") Signed-off-by: Aditya Kumar Singh <aditya.kumar.singh@oss.q...
```diff diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 299d575cf60e..1a9fc403d50d 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -10182,7 +10182,7 @@ static int nl80211_start_radar_detection(struct sk_buff *skb, switch (wdev->iftype) { case NL80211_IFTYPE_AP: case NL80211_...
b500ee5fde1bd0c85026dfcdadbc175548fb5216
Analyze and fix the following issue in the Linux kernel code: ata: libata: Fix NCQ Non-Data log not supported print
Problem Details: Currently, both ata_dev_config_ncq_send_recv() - which checks for NCQ Send/Recv Log (Log Address 13h) and ata_dev_config_ncq_non_data() - which checks for NCQ Non-Data Log (Log Address 12h), uses the same print when the log is not supported: "NCQ Send/Recv Log not supported" This seems like a copy ...
```diff diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 193fc3942fd3..e17e16706db7 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2274,7 +2274,7 @@ static void ata_dev_config_ncq_non_data(struct ata_device *dev) if (!ata_log_supported(dev, ATA_LOG_NCQ_NON_DATA)) ...
11092db5b57377ac99e6339cfd16ca35ef011f3c
Analyze and fix the following issue in the Linux kernel code: efivarfs: fix NULL dereference on resume
Problem Details: LSMs often inspect the path.mnt of files in the security hooks, and this causes a NULL deref in efivarfs_pm_notify() because the path is constructed with a NULL path.mnt. Fix by obtaining from vfs_kern_mount() instead, and being very careful to ensure that deactivate_super() (potentially triggered by ...
```diff diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c index 42295d04f08d..0486e9b68bc6 100644 --- a/fs/efivarfs/super.c +++ b/fs/efivarfs/super.c @@ -474,12 +474,25 @@ static int efivarfs_check_missing(efi_char16_t *name16, efi_guid_t vendor, return err; } +static void efivarfs_deactivate_super_work(struc...
250f25367b58d8c65a1b060a2dda037eea09a672
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Tear down vGIC on failed vCPU creation
Problem Details: If kvm_arch_vcpu_create() fails to share the vCPU page with the hypervisor, we propagate the error back to the ioctl but leave the vGIC vCPU data initialised. Note only does this leak the corresponding memory when the vCPU is destroyed but it can also lead to use-after-free if the redistributor device ...
```diff diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 36d8dd80b431..fe1e1a1adc50 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -466,7 +466,11 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) if (err) return err; - return kvm_share_hyp(vcpu, vcpu + 1); + err = kvm_share_hyp(vc...
5ac22c35aa8519f1fb5522fb3aff915f28a9365e
Analyze and fix the following issue in the Linux kernel code: perf dso: Use lock annotations to fix asan deadlock
Problem Details: dso__list_del with address sanitizer and/or reference count checking will call dso__put that can call dso__data_close reentrantly trying to lock the dso__data_open_lock and deadlocking. Switch from pthread mutexes to perf's mutex so that lock checking is performed in debug builds. Add lock annotations ...
```diff diff --git a/tools/perf/tests/dso-data.c b/tools/perf/tests/dso-data.c index 5286ae8bd2d7..06be7c5d8495 100644 --- a/tools/perf/tests/dso-data.c +++ b/tools/perf/tests/dso-data.c @@ -106,9 +106,9 @@ struct test_data_offset offsets[] = { /* move it from util/dso.c for compatibility */ static int dso__data_fd(s...
a211c6550efcc87aa2459ca347bda10721c7a46a
Analyze and fix the following issue in the Linux kernel code: mm: page_alloc: defrag_mode kswapd/kcompactd watermarks
Problem Details: The previous patch added pageblock_order reclaim to kswapd/kcompactd, which helps, but produces only one block at a time. Allocation stalls and THP failure rates are still higher than they could be. To adequately reflect ALLOC_NOFRAGMENT demand for pageblocks, change the watermarking for kswapd & kco...
```diff diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index dbb0ad69e17f..37c29f3fbca8 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -138,6 +138,7 @@ enum numa_stat_item { enum zone_stat_item { /* First 128 byte cacheline (assuming 64 bit words) */ NR_FREE_PAGES, + NR_FREE_PAGE...
f841ad9ca5007167c02de143980c9dc703f90b3d
Analyze and fix the following issue in the Linux kernel code: selftests/mm/cow: fix the incorrect error handling
Problem Details: Error handling doesn't check the correct return value. This patch will fix it. Link: https://lkml.kernel.org/r/20250312043840.71799-1-cyan.yang@sifive.com Fixes: f4b5fd6946e2 ("selftests/vm: anon_cow: THP tests") Signed-off-by: Cyan Yang <cyan.yang@sifive.com> Reviewed-by: Dev Jain <dev.jain@arm.com>...
```diff diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c index 9446673645eb..f0cb14ea8608 100644 --- a/tools/testing/selftests/mm/cow.c +++ b/tools/testing/selftests/mm/cow.c @@ -876,7 +876,7 @@ static void do_run_with_thp(test_fn fn, enum thp_run thp_run, size_t thpsize) mremap_size ...
456620c5cb238744f3e08a04af935fce25ca2df1
Analyze and fix the following issue in the Linux kernel code: mm/debug: add line breaks
Problem Details: Missing a newline character at the end of the format string. Link: https://lkml.kernel.org/r/20250312093717.364031-1-liuye@kylinos.cn Signed-off-by: Liu Ye <liuye@kylinos.cn> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
```diff diff --git a/mm/debug.c b/mm/debug.c index 83ef3bd0ccd3..db83e381a8ae 100644 --- a/mm/debug.c +++ b/mm/debug.c @@ -173,7 +173,7 @@ dump: void dump_page(const struct page *page, const char *reason) { if (PagePoisoned(page)) - pr_warn("page:%p is uninitialized and poisoned", page); + pr_warn("page:%p is uni...