id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
a8ff29f0ca1d63a215ef445102662850a912d127
Analyze and fix the following issue in the Linux kernel code: livepatch/klp-build: Require Clang assembler >= 20
Problem Details: Some special sections specify their ELF section entsize, for example: .pushsection section, "M", @progbits, 8 The entsize (8 in this example) is needed by objtool klp-diff for extracting individual entries. Clang assembler versions older than 20 silently ignore the above construct and set entsize ...
```diff diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build index a73515a82272..809e198a561d 100755 --- a/scripts/livepatch/klp-build +++ b/scripts/livepatch/klp-build @@ -249,6 +249,10 @@ validate_config() { [[ -v CONFIG_GCC_PLUGIN_RANDSTRUCT ]] && \ die "kernel option 'CONFIG_GCC_PLUGIN_RANDST...
e694179a2c02700087185bc300ba81dd17b7ad40
Analyze and fix the following issue in the Linux kernel code: drm/xe/multi_queue: Protect priority against concurrent access
Problem Details: Use a spinlock to protect multi-queue priority being concurrently updated by multiple set_priority ioctls and to protect against concurrent read and write to this field. v2: Update documentation, remove WRITE/READ_LOCK() (Thomas) Use scoped_guard, reduced lock scope (Matt Brost) v3: Fix author (ch...
```diff diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c index 7e7e663189e4..66d0e10ee2c4 100644 --- a/drivers/gpu/drm/xe/xe_exec_queue.c +++ b/drivers/gpu/drm/xe/xe_exec_queue.c @@ -230,6 +230,7 @@ static struct xe_exec_queue *__xe_exec_queue_alloc(struct xe_device *xe, INIT_LIST_...
7b6f9d9b1ea05c9c22570126547c780e8c6c3f62
Analyze and fix the following issue in the Linux kernel code: cxl: Fix premature commit_end increment on decoder commit failure
Problem Details: In cxl_decoder_commit(), commit_end is incremented before verifying whether the commit succeeded, and the CXL_DECODER_F_ENABLE bit in cxld->flags is only set after a successful commit. As a result, if the commit fails, commit_end has been incremented and cxld->reset() has no effect since the flag is no...
```diff diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c index 6e516c69b2d2..1097de03a2bb 100644 --- a/drivers/cxl/core/hdm.c +++ b/drivers/cxl/core/hdm.c @@ -844,14 +844,13 @@ static int cxl_decoder_commit(struct cxl_decoder *cxld) scoped_guard(rwsem_read, &cxl_rwsem.dpa) setup_hw_decoder(cxld, hdm); ...
e9734653c523c744f03333ece6ae7a315187f05c
Analyze and fix the following issue in the Linux kernel code: fs,fsverity: reject size changes on fsverity files in setattr_prepare
Problem Details: Add the check to reject truncates of fsverity files directly to setattr_prepare instead of requiring the file system to handle it. Besides removing boilerplate code, this also fixes the complete lack of such check in btrfs. Fixes: 146054090b08 ("btrfs: initial fsverity support") Signed-off-by: Christo...
```diff diff --git a/fs/attr.c b/fs/attr.c index b9ec6b47bab2..e7d7c6d19fe9 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -169,7 +169,17 @@ int setattr_prepare(struct mnt_idmap *idmap, struct dentry *dentry, * ATTR_FORCE. */ if (ia_valid & ATTR_SIZE) { - int error = inode_newsize_ok(inode, attr->ia_size); + int e...
3eb46fbb601f9a0b4df8eba79252a0a85e983044
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/gfx11: adjust KGQ reset sequence
Problem Details: Kernel gfx queues do not need to be reinitialized or remapped after a reset. This fixes queue reset failures on APUs. v2: preserve init and remap for MMIO case. Fixes: b3e9bfd86658 ("drm/amdgpu/gfx11: add ring reset callbacks") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4789 Reviewed-by...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c index 3b160a67e57a..e642236ea2c5 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c @@ -6823,11 +6823,12 @@ static int gfx_v11_0_reset_kgq(struct amdgpu_ring *ring, ...
9077d32a4b570fa20500aa26e149981c366c965d
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/gfx12: fix wptr reset in KGQ init
Problem Details: wptr is a 64 bit value and we need to update the full value, not just 32 bits. Align with what we already do for KCQs. Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Jesse Zhang <jesse.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit ...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c index b786967022d2..fbc100778f97 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c @@ -3079,7 +3079,7 @@ static int gfx_v12_0_kgq_init_queue(struct amdgpu_ring *ring, bool ...
b1f810471c6a6bd349f7f9f2f2fed96082056d46
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/gfx11: fix wptr reset in KGQ init
Problem Details: wptr is a 64 bit value and we need to update the full value, not just 32 bits. Align with what we already do for KCQs. Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Jesse Zhang <jesse.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit ...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c index 8a2ee2de390f..3b160a67e57a 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c @@ -4201,7 +4201,7 @@ static int gfx_v11_0_kgq_init_queue(struct amdgpu_ring *ring, bool ...
cc4f433b14e05eaa4a98fd677b836e9229422387
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/gfx10: fix wptr reset in KGQ init
Problem Details: wptr is a 64 bit value and we need to update the full value, not just 32 bits. Align with what we already do for KCQs. Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Jesse Zhang <jesse.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit ...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index d75b9940f248..fc65fb36e115 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -6879,7 +6879,7 @@ static int gfx_v10_0_kgq_init_queue(struct amdgpu_ring *ring, bool ...
b340ff216fdabfe71ba0cdd47e9835a141d08e10
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/gfx11: adjust KGQ reset sequence
Problem Details: Kernel gfx queues do not need to be reinitialized or remapped after a reset. This fixes queue reset failures on APUs. v2: preserve init and remap for MMIO case. Fixes: b3e9bfd86658 ("drm/amdgpu/gfx11: add ring reset callbacks") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4789 Reviewed-by...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c index 7bc593889c71..427975b5a1d9 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c @@ -6828,11 +6828,12 @@ static int gfx_v11_0_reset_kgq(struct amdgpu_ring *ring, ...
a2918f958d3f677ea93c0ac257cb6ba69b7abb7c
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/gfx12: fix wptr reset in KGQ init
Problem Details: wptr is a 64 bit value and we need to update the full value, not just 32 bits. Align with what we already do for KCQs. Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Jesse Zhang <jesse.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c index 40660b05f979..3aec7ea773fc 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c @@ -3085,7 +3085,7 @@ static int gfx_v12_0_kgq_init_queue(struct amdgpu_ring *ring, bool ...
1f16866bdb1daed7a80ca79ae2837a9832a74fbc
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/gfx11: fix wptr reset in KGQ init
Problem Details: wptr is a 64 bit value and we need to update the full value, not just 32 bits. Align with what we already do for KCQs. Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Jesse Zhang <jesse.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c index 3a4ca104b161..7bc593889c71 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c @@ -4214,7 +4214,7 @@ static int gfx_v11_0_kgq_init_queue(struct amdgpu_ring *ring, bool ...
e80b1d1aa1073230b6c25a1a72e88f37e425ccda
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/gfx10: fix wptr reset in KGQ init
Problem Details: wptr is a 64 bit value and we need to update the full value, not just 32 bits. Align with what we already do for KCQs. Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Jesse Zhang <jesse.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index 41bbedb8e157..1893ceeeb26c 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -6880,7 +6880,7 @@ static int gfx_v10_0_kgq_init_queue(struct amdgpu_ring *ring, bool ...
c1ed856c09d0d730c2f63bbb757cb6011db148f9
Analyze and fix the following issue in the Linux kernel code: drm/xe/configfs: Fix is_bound() pci_dev lifetime
Problem Details: Move pci_dev_put() after pci_dbg() to avoid using pdev after dropping its reference. Fixes: 2674f1ef29f46 ("drm/xe/configfs: Block runtime attribute changes") Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Ashutosh Dixit <as...
```diff diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c index 9f6251b1008b..82edd0466005 100644 --- a/drivers/gpu/drm/xe/xe_configfs.c +++ b/drivers/gpu/drm/xe/xe_configfs.c @@ -347,11 +347,10 @@ static bool is_bound(struct xe_config_group_device *dev) return false; ret = pci_get...
bf870c97ce2b9b48f02184d317dab4cf5691ca0e
Analyze and fix the following issue in the Linux kernel code: iio: buffer: buffer_impl.h: fix kernel-doc warnings
Problem Details: Resolve all kernel-doc warnings in buffer_impl.h: Warning: include/linux/iio/buffer_impl.h:172 struct member 'direction' not described in 'iio_buffer' Warning: include/linux/iio/buffer_impl.h:184 No description found for return value of 'iio_update_buffers' Also correct one typo (word order switch) a...
```diff diff --git a/include/linux/iio/buffer_impl.h b/include/linux/iio/buffer_impl.h index c0b0e0992a85..9442c165561a 100644 --- a/include/linux/iio/buffer_impl.h +++ b/include/linux/iio/buffer_impl.h @@ -113,10 +113,10 @@ struct iio_buffer { /** @flags: File ops flags including busy flag. */ unsigned long flags;...
b79b24f578cdb2d657db23e5fafe82c7e6a36b72
Analyze and fix the following issue in the Linux kernel code: iio: gyro: itg3200: Fix unchecked return value in read_raw
Problem Details: The return value from itg3200_read_reg_s16() is stored in ret but never checked. The function unconditionally returns IIO_VAL_INT, ignoring potential I2C read failures. This causes garbage data to be returned to userspace when the read fails, with no error reported. Add proper error checking to propag...
```diff diff --git a/drivers/iio/gyro/itg3200_core.c b/drivers/iio/gyro/itg3200_core.c index cd8a2dae56cd..bfe95ec1abda 100644 --- a/drivers/iio/gyro/itg3200_core.c +++ b/drivers/iio/gyro/itg3200_core.c @@ -93,6 +93,8 @@ static int itg3200_read_raw(struct iio_dev *indio_dev, case IIO_CHAN_INFO_RAW: reg = (u8)chan-...
b3c78bc53630d14a5770451ede3a30e7052f3b8b
Analyze and fix the following issue in the Linux kernel code: nfsd: do not allow exporting of special kernel filesystems
Problem Details: pidfs and nsfs recently gained support for encode/decode of file handles via name_to_handle_at(2)/open_by_handle_at(2). These special kernel filesystems have custom ->open() and ->permission() export methods, which nfsd does not respect and it was never meant to be used for exporting those filesystems...
```diff diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 9d55512d0cc9..baaa18b878d7 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -427,7 +427,8 @@ static int check_export(const struct path *path, int *flags, unsigned char *uuid * either a device number (so FS_REQUIRES_DEV needed) * or ...
83b9e5eb043710190f6461729fa2e05320a6594d
Analyze and fix the following issue in the Linux kernel code: rtc: zynqmp: check calibration max value
Problem Details: Enable check to not overflow the calibration max value. Reviewed-by: Harini T <harini.t@amd.com> Tested-by: Harini T <harini.t@amd.com> Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Acked-by: Michal Simek <michal.simek@amd.com> Link: https://patch.msgid.link/20260122-zynqmp-rtc-updates-v4-2-d4e...
```diff diff --git a/drivers/rtc/rtc-zynqmp.c b/drivers/rtc/rtc-zynqmp.c index 856bc1678e7d..caacce3725e2 100644 --- a/drivers/rtc/rtc-zynqmp.c +++ b/drivers/rtc/rtc-zynqmp.c @@ -349,6 +349,11 @@ static int xlnx_rtc_probe(struct platform_device *pdev) xrtcdev->freq--; } + if (xrtcdev->freq > RTC_TICK_MASK) { + ...
2724fb4d429cbb724dcb6fa17953040918ebe3a2
Analyze and fix the following issue in the Linux kernel code: rtc: zynqmp: correct frequency value
Problem Details: Fix calibration value in case a clock reference is provided. The actual calibration value written into register is frequency - 1. Reviewed-by: Harini T <harini.t@amd.com> Tested-by: Harini T <harini.t@amd.com> Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Acked-by: Michal Simek <michal.simek@am...
```diff diff --git a/drivers/rtc/rtc-zynqmp.c b/drivers/rtc/rtc-zynqmp.c index 3baa2b481d9f..856bc1678e7d 100644 --- a/drivers/rtc/rtc-zynqmp.c +++ b/drivers/rtc/rtc-zynqmp.c @@ -345,7 +345,10 @@ static int xlnx_rtc_probe(struct platform_device *pdev) &xrtcdev->freq); if (ret) xrtcdev->freq = RTC_CALIB_...
fa19d42cc7915226db416999866171a456dac657
Analyze and fix the following issue in the Linux kernel code: fsverity: add tracepoints
Problem Details: fs-verity previously had debug printk but it was removed. This patch adds trace points to similar places, as a better alternative. Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org> Reviewed-by: Darrick J. Wong <djwong@kernel.org> [djwong: fix formatting] Signed-off-by: Darrick J. Wong <djwong@ke...
```diff diff --git a/MAINTAINERS b/MAINTAINERS index 5b11839cba9d..9761650d2ead 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10311,6 +10311,7 @@ T: git https://git.kernel.org/pub/scm/fs/fsverity/linux.git F: Documentation/filesystems/fsverity.rst F: fs/verity/ F: include/linux/fsverity.h +F: include/trace/events/f...
bbb758a6943e19c483ab752cf8220140b46cf22c
Analyze and fix the following issue in the Linux kernel code: ASoC: sdca: Fix missing regmap dependencies in Kconfig
Problem Details: The SDCA modules failed to build with modpost errors: ERROR: modpost: "__devm_regmap_init_sdw" [sound/soc/sdca/snd-soc-sdca-class.ko] undefined! ERROR: modpost: "__devm_regmap_init_sdw_mbq" [sound/soc/sdca/snd-soc-sdca-class-function.ko] undefined! The issue occurs because: - sdca_class.c calls d...
```diff diff --git a/sound/soc/sdca/Kconfig b/sound/soc/sdca/Kconfig index fabb69a3450d..87ab2895096c 100644 --- a/sound/soc/sdca/Kconfig +++ b/sound/soc/sdca/Kconfig @@ -46,12 +46,14 @@ config SND_SOC_SDCA_CLASS select SND_SOC_SDCA_FDL select SND_SOC_SDCA_HID select SND_SOC_SDCA_IRQ + select REGMAP_SOUNDWIRE h...
426ca15c7f6cb6562a081341ca88893a50c59fa2
Analyze and fix the following issue in the Linux kernel code: net: fix segmentation of forwarding fraglist GRO
Problem Details: This patch enhances GSO segment handling by properly checking the SKB_GSO_DODGY flag for frag_list GSO packets, addressing low throughput issues observed when a station accesses IPv4 servers via hotspots with an IPv6-only upstream interface. Specifically, it fixes a bug in GSO segmentation when forwar...
```diff diff --git a/net/core/filter.c b/net/core/filter.c index 616e0520a0bb..bcd73d9bd764 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -3353,6 +3353,7 @@ static int bpf_skb_proto_4_to_6(struct sk_buff *skb) shinfo->gso_type &= ~SKB_GSO_TCPV4; shinfo->gso_type |= SKB_GSO_TCPV6; } + shinfo->gs...
aa35dd5cbc060bc3e28ad22b1d76eefa3f024030
Analyze and fix the following issue in the Linux kernel code: iomap: fix invalid folio access after folio_end_read()
Problem Details: If the folio does not have an iomap_folio_state (ifs) attached and the folio gets read in by the filesystem's IO helper, folio_end_read() will be called by the IO helper at any time. For this case, we cannot access the folio after dispatching it to the IO helper, eg subsequent accesses like if...
```diff diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 5f7dcbabbda3..867e8ac761c8 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -409,8 +409,6 @@ static void iomap_read_init(struct folio *folio) struct iomap_folio_state *ifs = folio->private; if (ifs) { - size_t len = fol...
008bec8ffe6e7746588d1e12c5b3865fa478fc91
Analyze and fix the following issue in the Linux kernel code: platform/x86/intel/tpmi/plr: Make the file domain<n>/status writeable
Problem Details: The file sys/kernel/debug/tpmi-<n>/plr/domain<n>/status has store and show callbacks. Make it writeable. Fixes: 811f67c51636d ("platform/x86/intel/tpmi: Add new auxiliary driver for performance limits") Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> Link: https://patch.msgid.link/...
```diff diff --git a/drivers/platform/x86/intel/plr_tpmi.c b/drivers/platform/x86/intel/plr_tpmi.c index 58132da47745..05727169f49c 100644 --- a/drivers/platform/x86/intel/plr_tpmi.c +++ b/drivers/platform/x86/intel/plr_tpmi.c @@ -316,7 +316,7 @@ static int intel_plr_probe(struct auxiliary_device *auxdev, const struct ...
fd5d8b65cfe76db197dce5fde184fd310fb4a26d
Analyze and fix the following issue in the Linux kernel code: fs: dcache: fix typo in enum d_walk_ret comment
Problem Details: Fix minor spelling and indentation errors in the documentation comments. Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com> Link: https://patch.msgid.link/20260128143150.3674284-1-chelsyratnawat2001@gmail.com Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@ker...
```diff diff --git a/fs/dcache.c b/fs/dcache.c index ec275f4fd81c..55c622b28ddd 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1288,8 +1288,8 @@ void shrink_dcache_sb(struct super_block *sb) EXPORT_SYMBOL(shrink_dcache_sb); /** - * enum d_walk_ret - action to talke during tree walk - * @D_WALK_CONTINUE: contrinue w...
6222883af286e2feb3c9ff2bf9fd8fdf4220c55a
Analyze and fix the following issue in the Linux kernel code: platform/x86: hp-bioscfg: Skip empty attribute names
Problem Details: Avoid registering kobjects with empty names when a BIOS attribute name decodes to an empty string. Fixes: a34fc329b1895 ("platform/x86: hp-bioscfg: bioscfg") Reported-by: Alain Cousinie <alain.cousinie@laposte.net> Closes: https://lore.kernel.org/platform-driver-x86/22ed5f78-c8bf-4ab4-8c38-420cc0201e7...
```diff diff --git a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c index dbe096eefa75..51e8977d3eb4 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c +++ b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c @@ -696,6 +696,11 @@ static int hp_init_bios_package_attribute(en...
1eab33aa63c993685dd341e03bd5b267dd7403fa
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: correctly decode TTLM with default link map
Problem Details: TID-To-Link Mapping (TTLM) elements do not contain any link mapping presence indicator if a default mapping is used and parsing needs to be skipped. Note that access points should not explicitly report an advertised TTLM with a default mapping as that is the implied mapping if the element is not inclu...
```diff diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index b72345c779c0..73f57b9e0ebf 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -8,7 +8,7 @@ * Copyright 2007, Michael Wu <flamingice@sourmilk.net> * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright (C) 2015 - 2017 Inte...
0ead3b72469e52ca02946b2e5b35fff38bfa061f
Analyze and fix the following issue in the Linux kernel code: xfs: fix spacing style issues in xfs_alloc.c
Problem Details: Fix checkpatch.pl errors regarding missing spaces around assignment operators in xfs_alloc_compute_diff() and xfs_alloc_fixup_trees(). Adhere to the Linux kernel coding style by ensuring spaces are placed around the assignment operator '='. Signed-off-by: Shin Seong-jun <shinsj4653@gmail.com> Reviewe...
```diff diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c index 5bec3365a99a..d99602bcc16f 100644 --- a/fs/xfs/libxfs/xfs_alloc.c +++ b/fs/xfs/libxfs/xfs_alloc.c @@ -376,8 +376,8 @@ xfs_alloc_compute_diff( xfs_agblock_t freeend; /* end of freespace extent */ xfs_agblock_t newbno1; /* return block n...
c17a1c03493bee4e7882ac79a52b8150cb464e56
Analyze and fix the following issue in the Linux kernel code: xfs: use a seprate member to track space availabe in the GC scatch buffer
Problem Details: When scratch_head wraps back to 0 and scratch_tail is also 0 because no I/O has completed yet, the ring buffer could be mistaken for empty. Fix this by introducing a separate scratch_available member in struct xfs_zone_gc_data. This actually ends up simplifying the code as well. Reported-by: Chris M...
```diff diff --git a/fs/xfs/xfs_zone_gc.c b/fs/xfs/xfs_zone_gc.c index dfa6653210c7..8c08e5519bff 100644 --- a/fs/xfs/xfs_zone_gc.c +++ b/fs/xfs/xfs_zone_gc.c @@ -131,10 +131,13 @@ struct xfs_zone_gc_data { /* * Scratchpad to buffer GC data, organized as a ring buffer over * discontiguous folios. scratch_head ...
8cdb04bd06c167461b357150b3ca46983eb70dc3
Analyze and fix the following issue in the Linux kernel code: riscv: ptrace: return ENODATA for inactive vector extension
Problem Details: Currently, ptrace returns EINVAL when the vector extension is supported but not yet activated for the traced process. This error code is not always appropriate since the ptrace arguments may be valid. Debug tools like gdbserver expect ENODATA when the requested register set is not active, e.g. see [1]...
```diff diff --git a/arch/riscv/kernel/ptrace.c b/arch/riscv/kernel/ptrace.c index 57e257d459e8..97636fdfeb77 100644 --- a/arch/riscv/kernel/ptrace.c +++ b/arch/riscv/kernel/ptrace.c @@ -99,9 +99,12 @@ static int riscv_vr_get(struct task_struct *target, struct __riscv_v_ext_state *vstate = &target->thread.vstate; s...
d30c1683aaecb93d2ab95685dc4300a33d3cea7a
Analyze and fix the following issue in the Linux kernel code: kselftest/riscv: add kselftest for user mode CFI
Problem Details: Add a kselftest for RISC-V control flow integrity implementation for user mode. There is not a lot going on in the kernel to enable landing pad for user mode. CFI selftests are intended to be compiled with a zicfilp and zicfiss enabled compiler. This kselftest simply checks if landing pads and shadow s...
```diff diff --git a/tools/testing/selftests/riscv/Makefile b/tools/testing/selftests/riscv/Makefile index 099b8c1f46f8..5671b4405a12 100644 --- a/tools/testing/selftests/riscv/Makefile +++ b/tools/testing/selftests/riscv/Makefile @@ -5,7 +5,7 @@ ARCH ?= $(shell uname -m 2>/dev/null || echo not) ifneq (,$(filter $(...
c8350aa2ed7828175468696ae95f34a431342175
Analyze and fix the following issue in the Linux kernel code: riscv: add documentation for shadow stack
Problem Details: Add documentation on shadow stack for user mode on riscv and the kernel interfaces exposed for user tasks to enable it. Reviewed-by: Zong Li <zong.li@sifive.com> Signed-off-by: Deepak Gupta <debug@rivosinc.com> Link: https://patch.msgid.link/20251112-v5_user_cfi_series-v23-27-b55691eacf4f@rivosinc.com...
```diff diff --git a/Documentation/arch/riscv/index.rst b/Documentation/arch/riscv/index.rst index be7237b69682..e240eb0ceb70 100644 --- a/Documentation/arch/riscv/index.rst +++ b/Documentation/arch/riscv/index.rst @@ -15,6 +15,7 @@ RISC-V architecture vector cmodx zicfilp + zicfiss features ...
f6eeb67b917238fe2295d27ef0c8fe2cab8de5b5
Analyze and fix the following issue in the Linux kernel code: riscv: add documentation for landing pad / indirect branch tracking
Problem Details: Add documentation on landing pad aka indirect branch tracking on riscv and the kernel interfaces exposed for user tasks to enable it. Reviewed-by: Zong Li <zong.li@sifive.com> Signed-off-by: Deepak Gupta <debug@rivosinc.com> Link: https://patch.msgid.link/20251112-v5_user_cfi_series-v23-26-b55691eacf4...
```diff diff --git a/Documentation/arch/riscv/index.rst b/Documentation/arch/riscv/index.rst index eecf347ce849..be7237b69682 100644 --- a/Documentation/arch/riscv/index.rst +++ b/Documentation/arch/riscv/index.rst @@ -14,6 +14,7 @@ RISC-V architecture uabi vector cmodx + zicfilp features dif...
22c1e263af2ac7dad3d2af258336318ee4c4a0ae
Analyze and fix the following issue in the Linux kernel code: riscv: create a Kconfig fragment for shadow stack and landing pad support
Problem Details: This patch creates a Kconfig fragment for shadow stack support and landing pad instruction support. Shadow stack support and landing pad instruction support can be enabled by selecting 'CONFIG_RISCV_USER_CFI'. Selecting 'CONFIG_RISCV_USER_CFI' wires up the path to enumerate CPU support. If support exi...
```diff diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 6b39f37f769a..7e76b6316425 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -1162,6 +1162,28 @@ config RANDOMIZE_BASE If unsure, say N. +config RISCV_USER_CFI + def_bool y + bool "riscv userspace control flow integrity" + depen...
ccad8c1336b6511e3c7ca5c02f797b1fd2cf67e1
Analyze and fix the following issue in the Linux kernel code: arch/riscv: add dual vdso creation logic and select vdso based on hw
Problem Details: Shadow stack instructions are taken from the Zimop ISA extension, which is mandated on RVA23. Any userspace with shadow stack instructions in it will fault on hardware that doesn't have support for Zimop. Thus, a shadow stack-enabled userspace can't be run on hardware that doesn't support Zimop. It's...
```diff diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 41385bce8cc7..371da75a47f9 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -161,6 +161,8 @@ ifeq ($(CONFIG_MMU),y) prepare: vdso_prepare vdso_prepare: prepare0 $(Q)$(MAKE) $(build)=arch/riscv/kernel/vdso include/generated/vdso-offset...
37f57bd3faeac92e898c3381355f4fd2b6a80901
Analyze and fix the following issue in the Linux kernel code: arch/riscv: compile vdso with landing pad and shadow stack note
Problem Details: User mode tasks compiled with Zicfilp may call indirectly into the vdso (like hwprobe indirect calls). Add support for compiling landing pads into the vdso. Landing pad instructions in the vdso will be no-ops for tasks which have not enabled landing pads. Furthermore, add support for the C sources of t...
```diff diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 4c6de57f65ef..41385bce8cc7 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -81,9 +81,12 @@ riscv-march-$(CONFIG_TOOLCHAIN_HAS_ZACAS) := $(riscv-march-y)_zacas # Check if the toolchain supports Zabha riscv-march-$(CONFIG_TOOLCHAIN_HAS_Z...
41213bf2ae6c936f51a79986b37f95da9ecbb970
Analyze and fix the following issue in the Linux kernel code: riscv: enable kernel access to shadow stack memory via the FWFT SBI call
Problem Details: The kernel has to perform shadow stack operations on the user shadow stack. During signal delivery and sigreturn, the shadow stack token must be created and validated respectively. Thus shadow stack access for the kernel must be enabled. In the future, when kernel shadow stacks are enabled, they must ...
```diff diff --git a/arch/riscv/kernel/asm-offsets.c b/arch/riscv/kernel/asm-offsets.c index 8a2b2656cb2f..af827448a609 100644 --- a/arch/riscv/kernel/asm-offsets.c +++ b/arch/riscv/kernel/asm-offsets.c @@ -533,4 +533,10 @@ void asm_offsets(void) DEFINE(FREGS_A6, offsetof(struct __arch_ftrace_regs, a6)); DEFINE...
c9b859c4d8f56c014b3d5fbd1bcfb916c34955a1
Analyze and fix the following issue in the Linux kernel code: riscv: add kernel command line option to opt out of user CFI
Problem Details: Add a kernel command line option to disable part or all of user CFI. User backward CFI and forward CFI can be controlled independently. The kernel command line parameter "riscv_nousercfi" can take the following values: - "all" : Disable forward and backward cfi both - "bcfi" : Disable backward cfi ...
```diff diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 1058f2a6d6a8..1a355e701a80 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -6606,6 +6606,14 @@ Kernel parameters replacem...
30c3099036a9544ec24e899abc8a81a7cc030f99
Analyze and fix the following issue in the Linux kernel code: riscv/hwprobe: add zicfilp / zicfiss enumeration in hwprobe
Problem Details: Add enumeration of the zicfilp and zicfiss extensions in the hwprobe syscall. Reviewed-by: Zong Li <zong.li@sifive.com> Signed-off-by: Deepak Gupta <debug@rivosinc.com> Tested-by: Andreas Korb <andreas.korb@aisec.fraunhofer.de> # QEMU, custom CVA6 Tested-by: Valentin Haudiquet <valentin.haudiquet@cano...
```diff diff --git a/arch/riscv/include/uapi/asm/hwprobe.h b/arch/riscv/include/uapi/asm/hwprobe.h index ed2621a5a47d..9139edba0aec 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -86,6 +86,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZICBOP (1ULL << 60) #de...
462a94fb8ae8ba0d4d3901c7283b4af052ab8804
Analyze and fix the following issue in the Linux kernel code: riscv: hwprobe: add support for RISCV_HWPROBE_KEY_IMA_EXT_1
Problem Details: We've run out of bits to describe RISC-V ISA extensions in our initial hwprobe key, RISCV_HWPROBE_KEY_IMA_EXT_0. So, let's add RISCV_HWPROBE_KEY_IMA_EXT_1, along with the framework to set the appropriate hwprobe tuple, and add testing for it. Based on a suggestion from Andrew Jones <andrew.jones@oss....
```diff diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 641ec4abb906..c420a8349bc6 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -67,7 +67,7 @@ The following keys are defined: programs (it may still be executed in us...
2af7c9cf021c5dabe880b68e5cc22c618060d954
Analyze and fix the following issue in the Linux kernel code: riscv/ptrace: expose riscv CFI status and state via ptrace and in core files
Problem Details: Expose a new register type NT_RISCV_USER_CFI for risc-v CFI status and state. Intentionally, both landing pad and shadow stack status and state are rolled into the CFI state. Creating two different NT_RISCV_USER_XXX would not be useful and would waste a note type. Enabling, disabling and locking the CF...
```diff diff --git a/arch/riscv/include/uapi/asm/ptrace.h b/arch/riscv/include/uapi/asm/ptrace.h index 261bfe70f60a..18988a5f1a63 100644 --- a/arch/riscv/include/uapi/asm/ptrace.h +++ b/arch/riscv/include/uapi/asm/ptrace.h @@ -131,6 +131,36 @@ struct __sc_riscv_cfi_state { unsigned long ss_ptr; /* shadow stack poin...
9d0e75e25e3be74828ffb7657992ce0f03352cc3
Analyze and fix the following issue in the Linux kernel code: riscv/kernel: update __show_regs() to print shadow stack register
Problem Details: Update __show_regs() to print the captured shadow stack pointer. On tasks where shadow stack is disabled, simply print 0. Signed-off-by: Deepak Gupta <debug@rivosinc.com> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Tested-by: Andreas Korb <andreas.korb@aisec.fraunhofer.de> # QEMU, custom CV...
```diff diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c index 49f527e3acfd..aacb23978f93 100644 --- a/arch/riscv/kernel/process.c +++ b/arch/riscv/kernel/process.c @@ -93,8 +93,8 @@ void __show_regs(struct pt_regs *regs) regs->s8, regs->s9, regs->s10); pr_cont(" s11: " REG_FMT " t3 : " REG_F...
66c9c713de597f9b40a319ebda4d3466ce2cdff0
Analyze and fix the following issue in the Linux kernel code: riscv/signal: save and restore the shadow stack on a signal
Problem Details: Save the shadow stack pointer in the sigcontext structure when delivering a signal. Restore the shadow stack pointer from sigcontext on sigreturn. As part of the save operation, the kernel uses the 'ssamoswap' instruction to save a snapshot of the current shadow stack on the shadow stack itself (this...
```diff diff --git a/arch/riscv/include/asm/usercfi.h b/arch/riscv/include/asm/usercfi.h index 4501d741a609..ec4b8a53eb74 100644 --- a/arch/riscv/include/asm/usercfi.h +++ b/arch/riscv/include/asm/usercfi.h @@ -8,6 +8,7 @@ #ifndef __ASSEMBLER__ #include <linux/types.h> #include <linux/prctl.h> +#include <linux/errno...
9d42fc28fc178e5031eddc6f80df561fc586caf4
Analyze and fix the following issue in the Linux kernel code: riscv/traps: Introduce software check exception and uprobe handling
Problem Details: The Zicfiss and Zicfilp extensions introduce a new exception, the 'software check exception', in the privileged ISA, with cause code = 18. This patch implements support for software check exceptions. Additionally, the patch implements a CFI violation handler which checks the code in the xtval register...
```diff diff --git a/arch/riscv/include/asm/asm-prototypes.h b/arch/riscv/include/asm/asm-prototypes.h index a9988bf21ec8..41ec5cdec367 100644 --- a/arch/riscv/include/asm/asm-prototypes.h +++ b/arch/riscv/include/asm/asm-prototypes.h @@ -51,6 +51,7 @@ DECLARE_DO_ERROR_INFO(do_trap_ecall_u); DECLARE_DO_ERROR_INFO(do_t...
8a9e22d2ca5855263d6e3f83509eabf16d7b8a0a
Analyze and fix the following issue in the Linux kernel code: riscv: Implement indirect branch tracking prctls
Problem Details: This patch adds a RISC-V implementation of the following prctls: PR_SET_INDIR_BR_LP_STATUS, PR_GET_INDIR_BR_LP_STATUS and PR_LOCK_INDIR_BR_LP_STATUS. Reviewed-by: Zong Li <zong.li@sifive.com> Signed-off-by: Deepak Gupta <debug@rivosinc.com> Tested-by: Andreas Korb <andreas.korb@aisec.fraunhofer.de> Te...
```diff diff --git a/arch/riscv/include/asm/usercfi.h b/arch/riscv/include/asm/usercfi.h index d71093f414df..4501d741a609 100644 --- a/arch/riscv/include/asm/usercfi.h +++ b/arch/riscv/include/asm/usercfi.h @@ -16,6 +16,8 @@ struct kernel_clone_args; struct cfi_state { unsigned long ubcfi_en : 1; /* Enable for backw...
5ca243f6e3c30b979a54a96b96df355dda2b4d0f
Analyze and fix the following issue in the Linux kernel code: prctl: add arch-agnostic prctl()s for indirect branch tracking
Problem Details: Three architectures (x86, aarch64, riscv) have support for indirect branch tracking feature in a very similar fashion. On a very high level, indirect branch tracking is a CPU feature where CPU tracks branches which use a memory operand to transfer control. As part of this tracking, during an indirect b...
```diff diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 487b3bf2e1ea..8239cd95a005 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -229,4 +229,8 @@ static inline bool cpu_attack_vector_mitigated(enum cpu_attack_vectors v) #define smt_mitigations SMT_MITIGATIONS_OFF #endif +int arch_get_in...
61a0200211d31e20380c35d619960a40113da872
Analyze and fix the following issue in the Linux kernel code: riscv: Implement arch-agnostic shadow stack prctls
Problem Details: Implement an architecture-agnostic prctl() interface for setting and getting shadow stack status. The prctls implemented are PR_GET_SHADOW_STACK_STATUS, PR_SET_SHADOW_STACK_STATUS and PR_LOCK_SHADOW_STACK_STATUS. As part of PR_SET_SHADOW_STACK_STATUS/PR_GET_SHADOW_STACK_STATUS, only PR_SHADOW_STACK_E...
```diff diff --git a/arch/riscv/include/asm/usercfi.h b/arch/riscv/include/asm/usercfi.h index a16a5dff8b0e..d71093f414df 100644 --- a/arch/riscv/include/asm/usercfi.h +++ b/arch/riscv/include/asm/usercfi.h @@ -7,6 +7,7 @@ #ifndef __ASSEMBLER__ #include <linux/types.h> +#include <linux/prctl.h> struct task_struc...
fd44a4a8551698757d0e7eeaa964735b471f7407
Analyze and fix the following issue in the Linux kernel code: riscv/shstk: If needed allocate a new shadow stack on clone
Problem Details: Userspace specifies CLONE_VM to share address space and spawn new thread. 'clone' allows userspace to specify a new stack for a new thread. However there is no way to specify a new shadow stack base address without changing the API. This patch allocates a new shadow stack whenever CLONE_VM is given. ...
```diff diff --git a/arch/riscv/include/asm/mmu_context.h b/arch/riscv/include/asm/mmu_context.h index 8c4bc49a3a0f..dbf27a78df6c 100644 --- a/arch/riscv/include/asm/mmu_context.h +++ b/arch/riscv/include/asm/mmu_context.h @@ -48,6 +48,13 @@ static inline unsigned long mm_untag_mask(struct mm_struct *mm) } #endif +...
0b6a6b72b329c34a13a13908d5e8df9fb46eaa1f
Analyze and fix the following issue in the Linux kernel code: apparmor: document the buffer hold, add an overflow guard
Problem Details: The buffer hold is a measure of contention, but it is tracked per cpu where the lock is a globabl resource. On some systems (eg. real time) there is no guarantee that the code will be on the same cpu pre, and post spinlock acquisition, nor that the buffer will be put back to the same percpu cache when ...
```diff diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 9175fd677ef3..34fc458887d7 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -2125,6 +2125,23 @@ static int param_set_mode(const char *val, const struct kernel_param *kp) return 0; } +/* arbitrary cap on how long to ho...
640cf2f09575c9dc344b3f7be2498d31e3923ead
Analyze and fix the following issue in the Linux kernel code: apparmor: avoid per-cpu hold underflow in aa_get_buffer
Problem Details: When aa_get_buffer() pulls from the per-cpu list it unconditionally decrements cache->hold. If hold reaches 0 while count is still non-zero, the unsigned decrement wraps to UINT_MAX. This keeps hold non-zero for a very long time, so aa_put_buffer() never returns buffers to the global list, which can st...
```diff diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 8d5d9a966b71..9175fd677ef3 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -2137,7 +2137,8 @@ char *aa_get_buffer(bool in_atomic) if (!list_empty(&cache->head)) { aa_buf = list_first_entry(&cache->head, union aa_buff...
a4c9efa4dbad6dacad6e8b274e30e814c8353097
Analyze and fix the following issue in the Linux kernel code: apparmor: make label_match return a consistent value
Problem Details: compound match is inconsistent in returning a state or an integer error this is problemati if the error is ever used as a state in the state machine Fixes: f1bd904175e81 ("apparmor: add the base fns() for domain labels") Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com> Signed-off-by: John Jo...
```diff diff --git a/security/apparmor/label.c b/security/apparmor/label.c index 02ee128f53d1..1d3fa5c28d97 100644 --- a/security/apparmor/label.c +++ b/security/apparmor/label.c @@ -1278,7 +1278,7 @@ static inline aa_state_t match_component(struct aa_profile *profile, * @request: permissions to request * @perms: p...
9f79b1cee91b3591a9b8fc0b3534ec966b8e463f
Analyze and fix the following issue in the Linux kernel code: apparmor: fix fast path cache check for unix sockets
Problem Details: The fast path cache check is incorrect forcing more slow path revalidations than necessary, because the unix logic check is inverted. Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
```diff diff --git a/security/apparmor/file.c b/security/apparmor/file.c index c751f2774c59..694e157149e8 100644 --- a/security/apparmor/file.c +++ b/security/apparmor/file.c @@ -572,8 +572,7 @@ static bool __file_is_delegated(struct aa_label *obj_label) return unconfined(obj_label); } -static bool __unix_needs_re...
6ca56813f4a589f536adceb42882855d91fb1125
Analyze and fix the following issue in the Linux kernel code: apparmor: fix rlimit for posix cpu timers
Problem Details: Posix cpu timers requires an additional step beyond setting the rlimit. Refactor the code so its clear when what code is setting the limit and conditionally update the posix cpu timers when appropriate. Fixes: baa73d9e478ff ("posix-timers: Make them configurable") Reviewed-by: Georgia Garcia <georgia....
```diff diff --git a/security/apparmor/resource.c b/security/apparmor/resource.c index 8e80db3ae21c..64212b39ba4b 100644 --- a/security/apparmor/resource.c +++ b/security/apparmor/resource.c @@ -196,6 +196,11 @@ void __aa_transition_rlimits(struct aa_label *old_l, struct aa_label *new_l) rules->rlimits.limit...
1301b956190590ef7f64b321fd27c59907d9c271
Analyze and fix the following issue in the Linux kernel code: apparmor: fix label and profile debug macros
Problem Details: The label and profile debug macros were not correctly pasting their var args. Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
```diff diff --git a/security/apparmor/include/lib.h b/security/apparmor/include/lib.h index 7ca8a92c449c..73ec624fd8c4 100644 --- a/security/apparmor/include/lib.h +++ b/security/apparmor/include/lib.h @@ -47,9 +47,11 @@ extern struct aa_dfa *stacksplitdfa; #define AA_DEBUG_LABEL(LAB, X, fmt, args...) \ do { ...
4a134723f9f1ad2f3621566259db673350d19cb1
Analyze and fix the following issue in the Linux kernel code: apparmor: move check for aa_null file to cover all cases
Problem Details: files with a dentry pointing aa_null.dentry where already rejected as part of file_inheritance. Unfortunately the check in common_file_perm() is insufficient to cover all cases causing unnecessary audit messages without the original files context. Eg. [ 442.886474] audit: type=1400 audit(1704822661.61...
```diff diff --git a/security/apparmor/file.c b/security/apparmor/file.c index b69fece45ade..c751f2774c59 100644 --- a/security/apparmor/file.c +++ b/security/apparmor/file.c @@ -155,8 +155,12 @@ static int path_name(const char *op, const struct cred *subj_cred, const char *info = NULL; int error; - error = aa_pa...
e16eee7895502bc3c07043169940b005d44bba8f
Analyze and fix the following issue in the Linux kernel code: apparmor: guard against free routines being called with a NULL
Problem Details: aa_free_data() and free_attachment() don't guard against having a NULL parameter passed to them. Fix this. Reviewed-by: Ryan Lee <ryan.lee@canonical.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
```diff diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index f2cef22ed729..a64cfd24cedc 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c @@ -232,6 +232,9 @@ static void aa_free_data(void *ptr, void *arg) { struct aa_data *data = ptr; + if (!ptr) + return; + kvfree_s...
74b7105e53e80a4072bd3e1a50be7aa15e3f0a01
Analyze and fix the following issue in the Linux kernel code: apparmor: return -ENOMEM in unpack_perms_table upon alloc failure
Problem Details: In policy_unpack.c:unpack_perms_table, the perms struct is allocated via kcalloc, with the position being reset if the allocation fails. However, the error path results in -EPROTO being retured instead of -ENOMEM. Fix this to return the correct error code. Reported-by: Zygmunt Krynicki <zygmunt.krynic...
```diff diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index b6e18ddff331..f86133f36f33 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -923,8 +923,10 @@ static ssize_t unpack_perms_table(struct aa_ext *e, struct aa_perms **perms) if (!aa_...
48d5268e911abcf7674ec33c9b0b3e952be1175e
Analyze and fix the following issue in the Linux kernel code: apparmor: fix boolean argument in apparmor_mmap_file
Problem Details: The previous value of GFP_ATOMIC is an int and not a bool, potentially resulting in UB when being assigned to a bool. In addition, the mmap hook is called outside of locks (i.e. in a non-atomic context), so we can pass a fixed constant value of false instead to common_mmap. Signed-off-by: Ryan Lee <ry...
```diff diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index a87cd60ed206..acca3d6efdbc 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -584,7 +584,7 @@ static int common_mmap(const char *op, struct file *file, unsigned long prot, static int apparmor_mmap_file(struct file *file, u...
3d28e2397af7a89ac3de33c686ed404cda59b5d5
Analyze and fix the following issue in the Linux kernel code: apparmor: add support loading per permission tagging
Problem Details: Add support for the per permission tag index for a given permission set. This will be used by both meta-data tagging, to allow annotating accept states with context and debug information. As well as by rule tainting and triggers to specify the taint or trigger to be applied. Since these are low freque...
```diff diff --git a/security/apparmor/file.c b/security/apparmor/file.c index 919dbbbc87ab..b69fece45ade 100644 --- a/security/apparmor/file.c +++ b/security/apparmor/file.c @@ -103,6 +103,7 @@ int aa_audit_file(const struct cred *subj_cred, ad.subj_cred = subj_cred; ad.request = request; + ad.tags = perms->tag;...
56c430c7f06d838fe3b2077dbbc4cc0bf992312b
Analyze and fix the following issue in the Linux kernel code: dma/pool: distinguish between missing and exhausted atomic pools
Problem Details: Currently, dma_alloc_from_pool() unconditionally warns and dumps a stack trace when an allocation fails, with the message "Failed to get suitable pool". This conflates two distinct failure modes: 1. Configuration error: No atomic pool is available for the requested DMA mask (a fundamental system se...
```diff diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c index c5da29ad010c..2b2fbb709242 100644 --- a/kernel/dma/pool.c +++ b/kernel/dma/pool.c @@ -277,15 +277,20 @@ struct page *dma_alloc_from_pool(struct device *dev, size_t size, { struct gen_pool *pool = NULL; struct page *page; + bool pool_found = false; ...
c70772afd5cc93c28f83b53d33ce9fbcd8d015da
Analyze and fix the following issue in the Linux kernel code: riscv/mm: Implement map_shadow_stack() syscall
Problem Details: As discussed extensively in the changelog for the addition of this syscall on x86 ("x86/shstk: Introduce map_shadow_stack syscall") the existing mmap() and madvise() syscalls do not map entirely well onto the security requirements for shadow stack memory since they lead to windows where memory is alloc...
```diff diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile index a01f6439d62b..0a0a3fb02d63 100644 --- a/arch/riscv/kernel/Makefile +++ b/arch/riscv/kernel/Makefile @@ -126,3 +126,4 @@ obj-$(CONFIG_ACPI) += acpi.o obj-$(CONFIG_ACPI_NUMA) += acpi_numa.o obj-$(CONFIG_GENERIC_CPU_VULNERABILITIES) +=...
1992330d90dd766fcf1730fd7bf2d6af65370ac4
Analyze and fix the following issue in the Linux kernel code: ovl: Fix uninit-value in ovl_fill_real
Problem Details: Syzbot reported a KMSAN uninit-value issue in ovl_fill_real. This iusse's call chain is: __do_sys_getdents64() -> iterate_dir() ... -> ext4_readdir() -> fscrypt_fname_alloc_buffer() // alloc -> fscrypt_fname_disk_to_usr // write without tail '\0'...
```diff diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c index 160960bb0ad0..724ec9d93fc8 100644 --- a/fs/overlayfs/readdir.c +++ b/fs/overlayfs/readdir.c @@ -755,7 +755,7 @@ static bool ovl_fill_real(struct dir_context *ctx, const char *name, struct dir_context *orig_ctx = rdt->orig_ctx; bool res; - ...
b16af1c81277dceb96812305b471296af9adf5d0
Analyze and fix the following issue in the Linux kernel code: slab: remove frozen slab checks from __slab_free()
Problem Details: Currently slabs are only frozen after consistency checks failed. This can happen only in caches with debugging enabled, and those use free_to_partial_list() for freeing. The non-debug operation of __slab_free() can thus stop considering the frozen field, and we can remove the FREE_FROZEN stat. Reviewe...
```diff diff --git a/mm/slub.c b/mm/slub.c index d782ceb8a2ba..bbc9d56484e5 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -338,7 +338,6 @@ enum stat_item { FREE_RCU_SHEAF_FAIL, /* Failed to free to a rcu_free sheaf */ FREE_FASTPATH, /* Free to cpu slab */ FREE_SLOWPATH, /* Freeing not to cpu slab */ - FREE_FROZEN, ...
46dea1744498a5b8864e21d0b769fd072a4e64bc
Analyze and fix the following issue in the Linux kernel code: slab: refill sheaves from all nodes
Problem Details: __refill_objects() currently only attempts to get partial slabs from the local node and then allocates new slab(s). Expand it to trying also other nodes while observing the remote node defrag ratio, similarly to get_any_partial(). This will prevent allocating new slabs on a node while other nodes have...
```diff diff --git a/mm/slub.c b/mm/slub.c index 697d3d6cebd3..202d103093d8 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2512,8 +2512,8 @@ static void free_empty_sheaf(struct kmem_cache *s, struct slab_sheaf *sheaf) } static unsigned int -__refill_objects(struct kmem_cache *s, void **p, gfp_t gfp, unsigned int min, -...
073d5f156292201f1e49263a62dfa182eeee273f
Analyze and fix the following issue in the Linux kernel code: slab: simplify kmalloc_nolock()
Problem Details: The kmalloc_nolock() implementation has several complications and restrictions due to SLUB's cpu slab locking, lockless fastpath and PREEMPT_RT differences. With cpu slab usage removed, we can simplify things: - relax the PREEMPT_RT context checks as they were before commit 99a3e3a1cfc9 ("slab: fix ...
```diff diff --git a/mm/slab.h b/mm/slab.h index f88568e31268..31375198e19c 100644 --- a/mm/slab.h +++ b/mm/slab.h @@ -190,7 +190,6 @@ struct kmem_cache_order_objects { */ struct kmem_cache { struct kmem_cache_cpu __percpu *cpu_slab; - struct lock_class_key lock_key; struct slub_percpu_sheaves __percpu *cpu_shea...
17c38c88294d75506c67cae378c9e940d1ce55e3
Analyze and fix the following issue in the Linux kernel code: slab: remove cpu (partial) slabs usage from allocation paths
Problem Details: We now rely on sheaves as the percpu caching layer and can refill them directly from partial or newly allocated slabs. Start removing the cpu (partial) slabs code, first from allocation paths. This means that any allocation not satisfied from percpu sheaves will end up in ___slab_alloc(), where we rem...
```diff diff --git a/mm/slub.c b/mm/slub.c index 872340cc5f92..75e085b5ad6f 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -241,11 +241,10 @@ DEFINE_STATIC_KEY_FALSE(slub_debug_enabled); static DEFINE_STATIC_KEY_FALSE(strict_numa); #endif -/* Structure holding parameters for get_partial() call chain */ +/* Structure hol...
ed30c4adfc2b56909ca43fb5e4750a646928cbf4
Analyze and fix the following issue in the Linux kernel code: slab: add optimized sheaf refill from partial list
Problem Details: At this point we have sheaves enabled for all caches, but their refill is done via __kmem_cache_alloc_bulk() which relies on cpu (partial) slabs - now a redundant caching layer that we are about to remove. The refill will thus be done from slabs on the node partial list. Introduce new functions that c...
```diff diff --git a/mm/slub.c b/mm/slub.c index cd8d3712b195..872340cc5f92 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -248,6 +248,14 @@ struct partial_context { void *object; }; +/* Structure holding parameters for get_partial_node_bulk() */ +struct partial_bulk_context { + gfp_t flags; + unsigned int min_objects;...
0ea05c4f7527a98f5946f96c829733788934311d
Analyze and fix the following issue in the Linux kernel code: riscv: compat: fix COMPAT_UTS_MACHINE definition
Problem Details: The COMPAT_UTS_MACHINE for riscv was incorrectly defined as "riscv". Change it to "riscv32" to reflect the correct 32-bit compat name. Fixes: 06d0e3723647 ("riscv: compat: Add basic compat data type implementation") Cc: stable@vger.kernel.org Signed-off-by: Han Gao <gaohan@iscas.ac.cn> Reviewed-by: Gu...
```diff diff --git a/arch/riscv/include/asm/compat.h b/arch/riscv/include/asm/compat.h index 6081327e55f5..28e115eed218 100644 --- a/arch/riscv/include/asm/compat.h +++ b/arch/riscv/include/asm/compat.h @@ -2,7 +2,7 @@ #ifndef __ASM_COMPAT_H #define __ASM_COMPAT_H -#define COMPAT_UTS_MACHINE "riscv\0\0" +#define CO...
c5d5ecf21fdd9ce91e6116feb3aa83cee73352cc
Analyze and fix the following issue in the Linux kernel code: selftests: mptcp: join: fix local endp not being tracked
Problem Details: When running this mptcp_join.sh selftest on older kernel versions not supporting local endpoints tracking, this test fails because 3 MP_JOIN ACKs have been received, while only 2 were expected. It is not clear why only 2 MP_JOIN ACKs were expected on old kernel versions, while 3 MP_JOIN SYN and SYN+AC...
```diff diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 3fc29201362a..e70d3420954f 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -2329,17 +2329,16 @@ signal_address_tests() ip ...
2ef9e3a3845d0a20b62b01f5b731debd0364688d
Analyze and fix the following issue in the Linux kernel code: selftests: mptcp: check subflow errors in close events
Problem Details: This validates the previous commit: subflow closed events should contain an error field when a subflow got closed with an error, e.g. reset or timeout. For this test, the chk_evt_nr helper has been extended to check attributes in the matched events. In this test, the 2 subflow closed events should ha...
```diff diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 1765714a1e2f..3fc29201362a 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3847,21 +3847,28 @@ userspace_pm_chk_get_addr() ...
dccf46179ddd6c04c14be8ed584dc54665f53f0e
Analyze and fix the following issue in the Linux kernel code: mptcp: only reset subflow errors when propagated
Problem Details: Some subflow socket errors need to be reported to the MPTCP socket: the initial subflow connect (MP_CAPABLE), and the ones from the fallback sockets. The others are not propagated. The issue is that sock_error() was used to retrieve the error, which was also resetting the sk_err field. Because of that...
```diff diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index e32ae594b4ef..8d3233667418 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -821,11 +821,8 @@ static bool __mptcp_ofo_queue(struct mptcp_sock *msk) static bool __mptcp_subflow_error_report(struct sock *sk, struct sock *ssk) { - in...
8467458dfa61b37e259e3485a5d3e415d08193c1
Analyze and fix the following issue in the Linux kernel code: selftests: mptcp: check no dup close events after error
Problem Details: This validates the previous commit: subflow closed events are re-sent with less info when the initial subflow is disconnected after an error and each time a subflow is closed after that. In this new test, the userspace PM is involved because that's how it was discovered, but it is not specific to it. ...
```diff diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index b2e6e548f796..1765714a1e2f 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3872,11 +3872,32 @@ chk_evt_nr() count=$(grep -...
280d654324e33f8e6e3641f76764694c7b64c5db
Analyze and fix the following issue in the Linux kernel code: mptcp: avoid dup SUB_CLOSED events after disconnect
Problem Details: In case of subflow disconnect(), which can also happen with the first subflow in case of errors like timeout or reset, mptcp_subflow_ctx_reset will reset most fields from the mptcp_subflow_context structure, including close_event_done. Then, when another subflow is closed, yet another SUB_CLOSED event ...
```diff diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index f505b780f713..e32ae594b4ef 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2598,8 +2598,8 @@ void mptcp_close_ssk(struct sock *sk, struct sock *ssk, struct mptcp_sock *msk = mptcp_sk(sk); struct sk_buff *skb; - /* The first su...
011be342dd24b5168a5dcf408b14c3babe503341
Analyze and fix the following issue in the Linux kernel code: net/mlx5e: Skip ESN replay window setup for IPsec crypto offload
Problem Details: Commit a5e400a985df ("net/mlx5e: Honor user choice of IPsec replay window size") introduced logic to setup the ESN replay window size. This logic is only valid for packet offload. However, the check to skip this block only covered outbound offloads. It was not skipped for crypto offload, causing it to...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c index a8fb4bec369c..9c7064187ed0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c @@ -430,7 +430,8 ...
a8f930b7be7be3f18f14446df461e17137400407
Analyze and fix the following issue in the Linux kernel code: net/mlx5: Fix vhca_id access call trace use before alloc
Problem Details: HCA CAP structure is allocated in mlx5_hca_caps_alloc(). mlx5_mdev_init() mlx5_hca_caps_alloc() And HCA CAP is read from the device in mlx5_init_one(). The vhca_id's debugfs file is published even before above two operations are done. Due to this when user reads the vhca id before the initializatio...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c index 36806e813c33..1301c56e20d6 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c @@ -613,3 +613,19 @@ void mlx5_debug_cq_remov...
2610a3d65691a1301ab10c92ff6ebab0bedf9199
Analyze and fix the following issue in the Linux kernel code: net/mlx5: fs, Fix inverted cap check in tx flow table root disconnect
Problem Details: The capability check for reset_root_to_default was inverted, causing the function to return -EOPNOTSUPP when the capability IS supported, rather than when it is NOT supported. Fix the capability check condition. Fixes: 3c9c34c32bc6 ("net/mlx5: fs, Command to control TX flow table root") Signed-off-by...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c index ced747bef641..c348ee62cd3a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c @@ -1198,7 +1198,8 @@ int mlx5_fs_cmd_set_tx_flow...
2aa1545ba8d4801fba5be83a404e28014b80196a
Analyze and fix the following issue in the Linux kernel code: net: phy: micrel: fix clk warning when removing the driver
Problem Details: Since the commit 25c6a5ab151f ("net: phy: micrel: Dynamically control external clock of KSZ PHY"), the clock of Micrel PHY has been enabled by phy_driver::resume() and disabled by phy_driver::suspend(). However, devm_clk_get_optional_enabled() is used in kszphy_probe(), so the clock will automatically ...
```diff diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 05de68b9f719..8208ecbb575c 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -2643,11 +2643,21 @@ static int kszphy_probe(struct phy_device *phydev) kszphy_parse_led_mode(phydev); - clk = devm_clk_get_optional_ena...
a62f7d62d2b115e67c7224e36ace4ef12a9650b4
Analyze and fix the following issue in the Linux kernel code: net/mlx5e: don't assume psp tx skbs are ipv6 csum handling
Problem Details: mlx5e_psp_handle_tx_skb() assumes skbs are ipv6 when doing a partial TCP checksum with tso. Make correctly mlx5e_psp_handle_tx_skb() handle ipv4 packets. Fixes: e5a1861a298e ("net/mlx5e: Implement PSP Tx data path") Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Reviewed-by: Eric Dumazet <edumaz...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.c index c17ea0fcd8ef..ef7f5338540f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.c @@ -1...
5fc90003de59b0f772a1654f5609fa5f87b4300f
Analyze and fix the following issue in the Linux kernel code: selftests: drv-net: toeplitz: accept bigger rss keys
Problem Details: /proc/sys/net/core/netdev_rss_key got bigger (256 bytes instead of 52) Fixes: 37b0ea8fef56 ("net: expand NETDEV_RSS_KEY_LEN to 256 bytes") Signed-off-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20260127174806.886561-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@ke...
```diff diff --git a/tools/testing/selftests/drivers/net/hw/toeplitz.c b/tools/testing/selftests/drivers/net/hw/toeplitz.c index 285bb17df9c2..cd4bf58a44ee 100644 --- a/tools/testing/selftests/drivers/net/hw/toeplitz.c +++ b/tools/testing/selftests/drivers/net/hw/toeplitz.c @@ -59,7 +59,7 @@ #include "../../../net/lib...
70de46740b62b83198802bfe6682c5f865c25dc5
Analyze and fix the following issue in the Linux kernel code: selftests: drv-net: psp: fix test flakes from racy connection close
Problem Details: There is a bug in assoc_sk_only_mismatch() and assoc_sk_only_mismatch_tx() that creates a race condition which triggers test flakes in later test cases e.g. data_send_bad_key(). The problem is that the client uses the "conn clr" rpc to setup a data connection with psp_responder, but never uses a match...
```diff diff --git a/tools/testing/selftests/drivers/net/psp.py b/tools/testing/selftests/drivers/net/psp.py index 528a421ecf76..864d9fce1094 100755 --- a/tools/testing/selftests/drivers/net/psp.py +++ b/tools/testing/selftests/drivers/net/psp.py @@ -266,6 +266,7 @@ def assoc_sk_only_mismatch(cfg): the_excepti...
33c1c6d8a28a2761ac74b0380b2563cf546c2a3a
Analyze and fix the following issue in the Linux kernel code: powerpc/smp: Add check for kcalloc() failure in parse_thread_groups()
Problem Details: As kcalloc() may fail, check its return value to avoid a NULL pointer dereference when passing it to of_property_read_u32_array(). Fixes: 790a1662d3a26 ("powerpc/smp: Parse ibm,thread-groups with multiple properties") Cc: stable@vger.kernel.org Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.e...
```diff diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 292fee8809bc..cad3358fa4c3 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -822,6 +822,8 @@ static int parse_thread_groups(struct device_node *dn, count = of_property_count_u32_elems(dn, "ibm,thread-groups"); ...
6080d525aba8a6cab9fe4b841ca1fab48a2969c6
Analyze and fix the following issue in the Linux kernel code: selftest: packetdrill: add tcp_timestamping_tcp_tx_timestamp_bug.pkt
Problem Details: Test tcp_tx_timestamp() behavior after ("tcp: tcp_tx_timestamp() must look at the rtx queue"). Without the fix, this new test fails like this: tcp_timestamping_tcp_tx_timestamp_bug.pkt:55: runtime error in recvmsg call: Expected result 0 but got -1 with errno 11 (Resource temporarily unavailable) Si...
```diff diff --git a/tools/testing/selftests/net/packetdrill/tcp_timestamping_tcp_tx_timestamp_bug.pkt b/tools/testing/selftests/net/packetdrill/tcp_timestamping_tcp_tx_timestamp_bug.pkt new file mode 100644 index 000000000000..95a1957a2cf9 --- /dev/null +++ b/tools/testing/selftests/net/packetdrill/tcp_timestamping_tc...
838eb9687691d29915797a885b861fd09353386e
Analyze and fix the following issue in the Linux kernel code: tcp: tcp_tx_timestamp() must look at the rtx queue
Problem Details: tcp_tx_timestamp() is only called at the end of tcp_sendmsg_locked() before the final tcp_push(). By the time it is called, it is possible all the copied data has been sent already (transmit queue is empty). If this is the case, use the last skb in the rtx queue. Fixes: 75c119afe14f ("tcp: implement...
```diff diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index d95b5b8c1ffc..e4009158b908 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -501,6 +501,9 @@ static void tcp_tx_timestamp(struct sock *sk, struct sockcm_cookie *sockc) struct sk_buff *skb = tcp_write_queue_tail(sk); u32 tsflags = sockc->tsflags; + if (...
cc0cf10fdaeadf5542d64a55b5b4120d3df90b7d
Analyze and fix the following issue in the Linux kernel code: net: bridge: fix static key check
Problem Details: Fix the check if netfilter's static keys are available. netfilter defines and exports static keys if CONFIG_JUMP_LABEL is enabled. (HAVE_JUMP_LABEL is never defined.) Fixes: 971502d77faa ("bridge: netfilter: unroll NF_HOOK helper in bridge input path") Signed-off-by: Martin Kaiser <martin@kaiser.cx> R...
```diff diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c index e355a15bf5ab..1405f1061a54 100644 --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c @@ -274,7 +274,7 @@ static int nf_hook_bridge_pre(struct sk_buff *skb, struct sk_buff **pskb) int ret; net = dev_net(skb->dev); -#ifdef HAVE_JUMP_LABEL...
6e84fc395e90465f1418f582a9f7d53c87ab010e
Analyze and fix the following issue in the Linux kernel code: ipv4: fib: Annotate access to struct fib_alias.fa_state.
Problem Details: syzbot reported that struct fib_alias.fa_state can be modified locklessly by RCU readers. [0] Let's use READ_ONCE()/WRITE_ONCE() properly. [0]: BUG: KCSAN: data-race in fib_table_lookup / fib_table_lookup write to 0xffff88811b06a7fa of 1 bytes by task 4167 on cpu 0: fib_alias_accessed net/ipv4/fib_...
```diff diff --git a/net/ipv4/fib_lookup.h b/net/ipv4/fib_lookup.h index f9b9e26c32c1..0b72796dd1ad 100644 --- a/net/ipv4/fib_lookup.h +++ b/net/ipv4/fib_lookup.h @@ -28,8 +28,10 @@ struct fib_alias { /* Don't write on fa_state unless needed, to keep it shared on all cpus */ static inline void fib_alias_accessed(stru...
d2492688bb9fed6ab6e313682c387ae71a66ebae
Analyze and fix the following issue in the Linux kernel code: nfc: nci: Fix race between rfkill and nci_unregister_device().
Problem Details: syzbot reported the splat below [0] without a repro. It indicates that struct nci_dev.cmd_wq had been destroyed before nci_close_device() was called via rfkill. nci_dev.cmd_wq is only destroyed in nci_unregister_device(), which (I think) was called from virtual_ncidev_close() when syzbot close()d an ...
```diff diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index 127e6c7d910d..c54df042db6b 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h @@ -219,6 +219,8 @@ static inline void nfc_free_device(struct nfc_dev *dev) int nfc_register_device(struct nfc_dev *dev); +void nfc_unregister_rfkill(st...
60d2c438c1bb705cdbf74ce8f12e6e141a4719b0
Analyze and fix the following issue in the Linux kernel code: bpf: Test nospec after dead stack write in helper
Problem Details: Without the fix from the previous commit, the selftest fails: $ ./tools/testing/selftests/bpf/vmtest.sh -- \ ./test_progs -t verifier_unpriv [...] run_subtest:PASS:obj_open_mem 0 nsec libbpf: BTF loading error: -EPERM libbpf: Error loading .BTF into kernel: -EPERM. BTF is optional, ignoring. l...
```diff diff --git a/tools/testing/selftests/bpf/progs/verifier_unpriv.c b/tools/testing/selftests/bpf/progs/verifier_unpriv.c index 28b4f7035ceb..8ee1243e62a8 100644 --- a/tools/testing/selftests/bpf/progs/verifier_unpriv.c +++ b/tools/testing/selftests/bpf/progs/verifier_unpriv.c @@ -950,4 +950,26 @@ l3_%=: r0 = 0; ...
cd3b6a3d49f8061d0c4c7e4226783051fe592ae7
Analyze and fix the following issue in the Linux kernel code: bpf: Fix verifier_bug_if to account for BPF_CALL
Problem Details: The BPF verifier assumes `insn_aux->nospec_result` is only set for direct memory writes (e.g., `*(u32*)(r1+off) = r2`). However, the assertion fails to account for helper calls (e.g., `bpf_skb_load_bytes_relative`) that perform writes to stack memory. Make the check more precise to resolve this. The p...
```diff diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index c2f2650db9fd..e7ff8394e0da 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -21065,17 +21065,19 @@ static int do_check(struct bpf_verifier_env *env) * may skip a nospec patched-in after the jump. This can * currently nev...
a3187c0c2bbd947ffff97f90d077ac88f9c2a215
Analyze and fix the following issue in the Linux kernel code: drm/xe/nvm: Fix double-free on aux add failure
Problem Details: After a successful auxiliary_device_init(), aux_dev->dev.release (xe_nvm_release_dev()) is responsible for the kfree(nvm). When there is failure with auxiliary_device_add(), driver will call auxiliary_device_uninit(), which call put_device(). So that the .release callback will be triggered to free the ...
```diff diff --git a/drivers/gpu/drm/xe/xe_nvm.c b/drivers/gpu/drm/xe/xe_nvm.c index 77856f460770..6f9dd519371c 100644 --- a/drivers/gpu/drm/xe/xe_nvm.c +++ b/drivers/gpu/drm/xe/xe_nvm.c @@ -164,19 +164,17 @@ int xe_nvm_init(struct xe_device *xe) ret = auxiliary_device_init(aux_dev); if (ret) { drm_err(&xe->drm,...
11035eab1b7d88daa7904440046e64d3810b1ca1
Analyze and fix the following issue in the Linux kernel code: drm/xe/nvm: Manage nvm aux cleanup with devres
Problem Details: Move nvm teardown to a devm-managed action registered from xe_nvm_init(). This ensures the auxiliary NVM device is deleted on probe failure and device detach without requiring explicit calls from remove paths. As part of this, drop xe_nvm_fini() from xe_device_remove() and from the survivability sysfs...
```diff diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c index 7c2f8b783c56..9cf82bde36c4 100644 --- a/drivers/gpu/drm/xe/xe_device.c +++ b/drivers/gpu/drm/xe/xe_device.c @@ -1026,8 +1026,6 @@ void xe_device_remove(struct xe_device *xe) { xe_display_unregister(xe); - xe_nvm_fini(xe); - ...
63b33604365bdca43dee41bab809da2230491036
Analyze and fix the following issue in the Linux kernel code: drm/xe/configfs: Fix is_bound() pci_dev lifetime
Problem Details: Move pci_dev_put() after pci_dbg() to avoid using pdev after dropping its reference. Fixes: 2674f1ef29f46 ("drm/xe/configfs: Block runtime attribute changes") Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Ashutosh Dixit <as...
```diff diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c index 9f6251b1008b..82edd0466005 100644 --- a/drivers/gpu/drm/xe/xe_configfs.c +++ b/drivers/gpu/drm/xe/xe_configfs.c @@ -347,11 +347,10 @@ static bool is_bound(struct xe_config_group_device *dev) return false; ret = pci_get...
4da7c5c3ec34d839bba6e035c3d05c447a2f9d4f
Analyze and fix the following issue in the Linux kernel code: bcache: fix I/O accounting leak in detached_dev_do_request
Problem Details: When a bcache device is detached, discard requests are completed immediately. However, the I/O accounting started in cached_dev_make_request() is not ended, leading to 100% disk utilization reports in iostat. Add the missing bio_end_io_acct() call. Fixes: cafe56359144 ("bcache: A block layer cache") S...
```diff diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index c2f38907a2a3..3fa3b13a410f 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -1107,6 +1107,7 @@ static void detached_dev_do_request(struct bcache_device *d, if (bio_op(orig_bio) == REQ_OP_DISCARD && ...
9df0e49c5b9b8d051529be9994e4f92f2d20be6f
Analyze and fix the following issue in the Linux kernel code: tracing: Remove duplicate ENABLE_EVENT_STR and DISABLE_EVENT_STR macros
Problem Details: The macros ENABLE_EVENT_STR and DISABLE_EVENT_STR were added to trace.h so that more than one file can have access to them, but was never removed from their original location. Remove the duplicates. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: T...
```diff diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index f372a6374164..4972e1a2b5f3 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -4097,11 +4097,6 @@ void trace_put_event_file(struct trace_event_file *file) EXPORT_SYMBOL_GPL(trace_put_event_file); #ifdef C...
45641096c9c3eb8213616df50beaa5f92b201876
Analyze and fix the following issue in the Linux kernel code: tracing: Have hist_debug show what function a field uses
Problem Details: When CONFIG_HIST_TRIGGERS_DEBUG is enabled, each trace event has a "hist_debug" file that explains the histogram internal data. This is very useful for debugging histograms. One bit of data that was missing from this file was what function a histogram field uses to process its data. The hist_field str...
```diff diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 0908a9f7e289..e245446a8cf7 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -105,38 +105,44 @@ enum field_op_id { FIELD_OP_MULT, }; +#define FIELD_FUNCS \ + C(NOP, "nop"), \...
0fd17e5983337231dc655e9ca0095d2ca3f47405
Analyze and fix the following issue in the Linux kernel code: of: reserved_mem: Allow reserved_mem framework detect "cma=" kernel param
Problem Details: When initializing the default cma region, the "cma=" kernel parameter takes priority over a DT defined linux,cma-default region. Hence, give the reserved_mem framework the ability to detect this so that the DT defined cma region can skip initialization accordingly. Signed-off-by: Oreoluwa Babatunde <o...
```diff diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 5619ec917858..a2a13617c6f4 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -157,13 +157,19 @@ static int __init __reserved_mem_reserve_reg(unsigned long node, phys_addr_t base, size; int i, len; ...
20e01bba2ae4898ce65cdcacd1bd6bec5111abd9
Analyze and fix the following issue in the Linux kernel code: firewire: core: fix race condition against transaction list
Problem Details: The list of transaction is enumerated without acquiring card lock when processing AR response event. This causes a race condition bug when processing AT request completion event concurrently. This commit fixes the bug by put timer start for split transaction expiration into the scope of lock. The valu...
```diff diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index 7fea11a5e359..22ae387ae03c 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -173,20 +173,14 @@ static void split_transaction_timeout_callback(struct timer_list *timer) } }...
aef5078471294e7a7a2d6b9da4988a6a3b7aff54
Analyze and fix the following issue in the Linux kernel code: hfsplus: fix generic/062 xfstests failure
Problem Details: The xfstests' test-case generic/062 fails to execute correctly: FSTYP -- hfsplus PLATFORM -- Linux/x86_64 hfsplus-testing-0001 6.15.0-rc4+ #8 SMP PREEMPT_DYNAMIC Thu May 1 16:43:22 PDT 2025 MKFS_OPTIONS -- /dev/loop51 MOUNT_OPTIONS -- /dev/loop51 /mnt/scratch generic/062 - output mismatch (see xfstes...
```diff diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 6153e5cc6eb6..533c43cc3768 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c @@ -396,6 +396,19 @@ static const struct inode_operations hfsplus_file_inode_operations = { .fileattr_set = hfsplus_fileattr_set, }; +const struct inode_operations ...
b1defcdc4457649db236415ee618a7151e28788c
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: Fix cond_exec handling in amdgpu_ib_schedule()
Problem Details: The EXEC_COUNT field must be > 0. In the gfx shadow handling we always emit a cond_exec packet after the gfx_shadow packet, but the EXEC_COUNT never gets patched. This leads to a hang when we try and reset queues on gfx11 APUs. Fixes: c68cbbfd54c6 ("drm/amdgpu: cleanup conditional execution") Closes...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index 72ec455fa932..44f230d67da2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c @@ -235,7 +235,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs...
e7fbff9e7622a00c2b53cb14df481916f0019742
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/soc21: fix xclk for APUs
Problem Details: The reference clock is supposed to be 100Mhz, but it appears to actually be slightly lower (99.81Mhz). Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14451 Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 637fe...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c index ad36c96478a8..25536d89635d 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc21.c +++ b/drivers/gpu/drm/amd/amdgpu/soc21.c @@ -225,7 +225,13 @@ static u32 soc21_get_config_memsize(struct amdgpu_device *adev) static u32 soc21_...
08a7491843224f8b96518fbe70d9e48163046054
Analyze and fix the following issue in the Linux kernel code: bpftool: Fix dependencies for static build
Problem Details: When building selftests/bpf with EXTRA_LDFLAGS=-static the follwoing error happens: LINK /ws/linux/tools/testing/selftests/bpf/tools/build/bpftool/bootstrap/bpftool /usr/bin/x86_64-linux-gnu-ld.bfd: /usr/lib/gcc/x86_64-linux-gnu/15/../../../x86_64-linux-gnu/libcrypto.a(libcrypto-lib-dso_dlfcn.o):...
```diff diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index 5442073a2e42..519ea5cb8ab1 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -130,8 +130,8 @@ include $(FEATURES_DUMP) endif endif -LIBS = $(LIBBPF) -lelf -lz -lcrypto -LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -...
ba205ac3d6e83f56c4f824f23f1b4522cb844ff3
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: Fix cond_exec handling in amdgpu_ib_schedule()
Problem Details: The EXEC_COUNT field must be > 0. In the gfx shadow handling we always emit a cond_exec packet after the gfx_shadow packet, but the EXEC_COUNT never gets patched. This leads to a hang when we try and reset queues on gfx11 APUs. Fixes: c68cbbfd54c6 ("drm/amdgpu: cleanup conditional execution") Closes...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index 72ec455fa932..44f230d67da2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c @@ -235,7 +235,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs...