id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
1be5b82c45850f495adf67887075507d5e8a860b
Analyze and fix the following issue in the Linux kernel code: mptcp: remove unused returned value of check_data_fin
Problem Details: When working on a fix modifying mptcp_check_data_fin(), I noticed the returned value was no longer used. It looks like it was used for 3 days, between commit 7ed90803a213 ("mptcp: send explicit ack on delayed ack_seq incr") and commit ea4ca586b16f ("mptcp: refine MPTCP-level ack scheduling"). This re...
```diff diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index d9fbddb99ad0..735a209d4072 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -545,11 +545,10 @@ static void mptcp_cleanup_rbuf(struct mptcp_sock *msk, int copied) } } -static bool mptcp_check_data_fin(struct sock *sk) +static void...
35626012877b80436e0627feb16520db4f0ba53e
Analyze and fix the following issue in the Linux kernel code: net: spacemit: Make stats_lock softirq-safe
Problem Details: While most of the statistics functions (emac_get_stats64() and such) are called with softirqs enabled, emac_stats_timer() is, as its name suggests, also called from a timer, i.e. called in softirq context. All of these take stats_lock. Therefore, make stats_lock softirq-safe by changing spin_lock() in...
```diff diff --git a/drivers/net/ethernet/spacemit/k1_emac.c b/drivers/net/ethernet/spacemit/k1_emac.c index 928fea02198c..e1c5faff3b71 100644 --- a/drivers/net/ethernet/spacemit/k1_emac.c +++ b/drivers/net/ethernet/spacemit/k1_emac.c @@ -135,7 +135,7 @@ struct emac_priv { bool flow_control_autoneg; u8 flow_control...
26644c90e8fbf99d381d11873c5e8861ef0029d8
Analyze and fix the following issue in the Linux kernel code: net: enetc: fix sleeping function called from rcu_read_lock() context
Problem Details: The rcu_read_lock() has been introduced in __ethtool_get_ts_info() since the commit 4c61d809cf60 ("net: ethtool: Fix suspicious rcu_dereference usage"). Therefore, the device drivers cannot use any sleeping functions when implementing the callback of ethtool_ops::get_ts_info(). Currently, pci_get_slot(...
```diff diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c index 6215e9c68fc5..445bfd032e0f 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c @@ -895,7 +895,8 @@ static int en...
50d51cef555ee42fe47dd51b71366a77895e5f0b
Analyze and fix the following issue in the Linux kernel code: selftests: forwarding: Reorder (ar)ping arguments to obey POSIX getopt
Problem Details: Quoted from musl wiki: GNU getopt permutes argv to pull options to the front, ahead of non-option arguments. musl and the POSIX standard getopt stop processing options at the first non-option argument with no permutation. Thus these scripts stop working on musl since non-option arguments for ...
```diff diff --git a/tools/testing/selftests/net/forwarding/custom_multipath_hash.sh b/tools/testing/selftests/net/forwarding/custom_multipath_hash.sh index 7d531f7091e6..5dbfab0e23e3 100755 --- a/tools/testing/selftests/net/forwarding/custom_multipath_hash.sh +++ b/tools/testing/selftests/net/forwarding/custom_multipa...
cd875625b475dc4e28ac302ccb3422cc9f678f89
Analyze and fix the following issue in the Linux kernel code: ptp: document behavior of PTP_STRICT_FLAGS
Problem Details: Commit 6138e687c7b6 ("ptp: Introduce strict checking of external time stamp options.") added the PTP_STRICT_FLAGS to the set of flags supported for the external timestamp request ioctl. It is only supported by PTP_EXTTS_REQUEST2, as it was introduced the introduction of the new ioctls. Further, the ke...
```diff diff --git a/include/uapi/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h index 18eefa6d93d6..2c3346e91dbe 100644 --- a/include/uapi/linux/ptp_clock.h +++ b/include/uapi/linux/ptp_clock.h @@ -37,6 +37,9 @@ /* * flag fields valid for the new PTP_EXTTS_REQUEST2 ioctl. + * + * Note: PTP_STRICT_FLAGS is alw...
3200fdd4021de1d182fa3b6db5ad936d519f3848
Analyze and fix the following issue in the Linux kernel code: broadcom: fix support for PTP_EXTTS_REQUEST2 ioctl
Problem Details: Commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to ptp_clock_info") modified the PTP core kernel logic to validate the supported flags for the PTP_EXTTS_REQUEST ioctls, rather than relying on each individual driver correctly checking its flags. The bcm_ptp_enable() function implements...
```diff diff --git a/drivers/net/phy/bcm-phy-ptp.c b/drivers/net/phy/bcm-phy-ptp.c index 1cf695ac73cc..d3501f8487d9 100644 --- a/drivers/net/phy/bcm-phy-ptp.c +++ b/drivers/net/phy/bcm-phy-ptp.c @@ -738,6 +738,7 @@ static const struct ptp_clock_info bcm_ptp_clock_info = { .n_per_out = 1, .n_ext_ts = 1, .supported...
6e6c88d85623dc0c5c3faf185c12bd723efde5ee
Analyze and fix the following issue in the Linux kernel code: broadcom: fix support for PTP_PEROUT_DUTY_CYCLE
Problem Details: The bcm_ptp_perout_locked() function has support for handling PTP_PEROUT_DUTY_CYCLE, but its not listed in the supported_perout_flags. Attempts to use the duty cycle support will be rejected since commit d9f3e9ecc456 ("net: ptp: introduce .supported_perout_flags to ptp_clock_info"), as this flag accide...
```diff diff --git a/drivers/net/phy/bcm-phy-ptp.c b/drivers/net/phy/bcm-phy-ptp.c index eba8b5fb1365..1cf695ac73cc 100644 --- a/drivers/net/phy/bcm-phy-ptp.c +++ b/drivers/net/phy/bcm-phy-ptp.c @@ -597,10 +597,6 @@ static int bcm_ptp_perout_locked(struct bcm_ptp_private *priv, period = BCM_MAX_PERIOD_8NS; /* write...
55ed11b181c43d81ce03b50209e4e7c4a14ba099
Analyze and fix the following issue in the Linux kernel code: sched_ext: idle: Handle migration-disabled tasks in BPF code
Problem Details: When scx_bpf_select_cpu_dfl()/and() kfuncs are invoked outside of ops.select_cpu() we can't rely on @p->migration_disabled to determine if migration is disabled for the task @p. In fact, migration is always disabled for the current task while running BPF code: __bpf_prog_enter() disables migration and...
```diff diff --git a/kernel/sched/ext_idle.c b/kernel/sched/ext_idle.c index 7174e1c1a392..537c6992bb63 100644 --- a/kernel/sched/ext_idle.c +++ b/kernel/sched/ext_idle.c @@ -856,6 +856,32 @@ static bool check_builtin_idle_enabled(void) return false; } +/* + * Determine whether @p is a migration-disabled task in t...
77c8ede611c6a70a95f7b15648551d0121b40d6c
Analyze and fix the following issue in the Linux kernel code: drm/xe: Don't copy pinned kernel bos twice on suspend
Problem Details: We were copying the bo content the bos on the list "xe->pinned.late.kernel_bo_present" twice on suspend. Presumingly the intent is to copy the pinned external bos on the first pass. This is harmless since we (currently) should have no pinned external bos needing copy since a) exernal system bos don't...
```diff diff --git a/drivers/gpu/drm/xe/xe_bo_evict.c b/drivers/gpu/drm/xe/xe_bo_evict.c index 7484ce55a303..d5dbc51e8612 100644 --- a/drivers/gpu/drm/xe/xe_bo_evict.c +++ b/drivers/gpu/drm/xe/xe_bo_evict.c @@ -158,8 +158,8 @@ int xe_bo_evict_all(struct xe_device *xe) if (ret) return ret; - ret = xe_bo_apply_to_...
b67e7422d229dead0dddaad7e7c05558f24d552f
Analyze and fix the following issue in the Linux kernel code: drm/xe: Fix build with CONFIG_MODULES=n
Problem Details: When building with CONFIG_MODULES=n, the __exit functions are dropped. However our init functions may call them for error handling, so they are not good candidates for the exit sections. Fix this error reported by 0day: ld.lld: error: relocation refers to a symbol in a discarded section: xe_configfs...
```diff diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c index e9b46a2d0019..58c1f397c68c 100644 --- a/drivers/gpu/drm/xe/xe_configfs.c +++ b/drivers/gpu/drm/xe/xe_configfs.c @@ -404,7 +404,7 @@ int __init xe_configfs_init(void) return 0; } -void __exit xe_configfs_exit(void) +void ...
500dad428e5b0de4c1bdfa893822a6e06ddad0b5
Analyze and fix the following issue in the Linux kernel code: drm/xe/vf: Don't expose sysfs attributes not applicable for VFs
Problem Details: VFs can't read BMG_PCIE_CAP(0x138340) register nor access PCODE (already guarded by the info.skip_pcode flag) so we shouldn't expose attributes that require any of them to avoid errors like: [] xe 0000:03:00.1: [drm] Tile0: GT0: VF is trying to read an \ inaccessible register 0x1...
```diff diff --git a/drivers/gpu/drm/xe/xe_device_sysfs.c b/drivers/gpu/drm/xe/xe_device_sysfs.c index 3e3b2d9033a7..927ee7991696 100644 --- a/drivers/gpu/drm/xe/xe_device_sysfs.c +++ b/drivers/gpu/drm/xe/xe_device_sysfs.c @@ -308,7 +308,7 @@ int xe_device_sysfs_init(struct xe_device *xe) return ret; } - if (xe...
0950c64ae38661bd97127e9aa0522f1624f82006
Analyze and fix the following issue in the Linux kernel code: workqueue: fix texinfodocs warning for WQ_* flags reference
Problem Details: Sphinx emitted a warning during make texinfodocs: WARNING: Inline literal start-string without end-string. This was caused by the trailing '*' in "%WQ_*" being parsed as reStructuredText markup in the kernel-doc comment. Escape the '*' in the comment so that Sphinx treats it as a literal character...
```diff diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 71a9900c03c7..dabc351cc127 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -502,7 +502,7 @@ void workqueue_softirq_dead(unsigned int cpu); * min_active which is set to min(@max_active, %WQ_DFL_MIN_ACTIVE). This ...
ab073abf6d974d3fe998fc6731ca80e2b57ffd69
Analyze and fix the following issue in the Linux kernel code: block: fix EOD return for device with nr_sectors == 0
Problem Details: A recent commit skipped dumping the usual "attempt to access beyond end of device" message if the device size is 0 sectors, as that's a common pattern for devices that have been hot removed. But while it stopped that message, it also prevented returning -EIO for that condition. Reinstate the -EIO retur...
```diff diff --git a/block/blk-core.c b/block/blk-core.c index 4201504158a1..a27185cd8ede 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -557,9 +557,11 @@ static inline int bio_check_eod(struct bio *bio) sector_t maxsector = bdev_nr_sectors(bio->bi_bdev); unsigned int nr_sectors = bio_sectors(bio); - if ...
86bcd23df9cec9c2df520ae0982033e301d3c184
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Fix hypercalls docs section number order
Problem Details: Commit 4180bf1b655a79 ("KVM: X86: Implement "send IPI" hypercall") documents KVM_HC_SEND_IPI hypercall, yet its section number duplicates KVM_HC_CLOCK_PAIRING one (which both are 6th). Fix the numbering order so that the former should be 7th. Fixes: 4180bf1b655a ("KVM: X86: Implement "send IPI" hyperc...
```diff diff --git a/Documentation/virt/kvm/x86/hypercalls.rst b/Documentation/virt/kvm/x86/hypercalls.rst index 10db7924720f..521ecf9a8a36 100644 --- a/Documentation/virt/kvm/x86/hypercalls.rst +++ b/Documentation/virt/kvm/x86/hypercalls.rst @@ -137,7 +137,7 @@ compute the CLOCK_REALTIME for its clock, at the same ins...
e9713655b29a47d23cbf07aacf50b0ce8ee0a850
Analyze and fix the following issue in the Linux kernel code: soc: fsl: qe: Drop legacy-of-mm-gpiochip.h header from GPIO driver
Problem Details: Remove legacy-of-mm-gpiochip.h header file. The above mentioned file provides an OF API that's deprecated. There is no agnostic alternatives to it and we have to open code the logic which was hidden behind of_mm_gpiochip_add_data(). Note, most of the GPIO drivers are using their own labeling schemas an...
```diff diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index fea3766eac0f..5b689bd3ddf4 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig @@ -232,7 +232,6 @@ config QE_GPIO bool "QE GPIO support" depends on QUICC_ENGINE select GPIOLIB - select OF_GPIO_M...
3bd44edd6c55828fd4e11cb0efce5b7160bfa2de
Analyze and fix the following issue in the Linux kernel code: gpio: regmap: fix memory leak of gpio_regmap structure
Problem Details: The gpio_regmap structure is leaked on the error path. Fix this by jumping to the appropriate kfree instead of returning directly. Fixes: db305161880a ("gpio: regmap: Allow ngpio to be read from the property") Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Suggested-by: Michael Walle <mwalle@ker...
```diff diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c index e8a32dfebdcb..3f8b72311f8e 100644 --- a/drivers/gpio/gpio-regmap.c +++ b/drivers/gpio/gpio-regmap.c @@ -274,7 +274,7 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config if (!chip->ngpio) { ret = gpioc...
302a1f674c00dd5581ab8e493ef44767c5101aab
Analyze and fix the following issue in the Linux kernel code: Bluetooth: MGMT: Fix possible UAFs
Problem Details: This attemps to fix possible UAFs caused by struct mgmt_pending being freed while still being processed like in the following trace, in order to fix mgmt_pending_valid is introduce and use to check if the mgmt_pending hasn't been removed from the pending list, on the complete callbacks it is used to ch...
```diff diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 50634ef5c8b7..225140fcb3d6 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -1323,8 +1323,7 @@ static void mgmt_set_powered_complete(struct hci_dev *hdev, void *data, int err) struct mgmt_mode *cp; /* Make sure cmd still outstan...
c6ccc4dde17676dfe617b9a37bd9ba19a8fc87ee
Analyze and fix the following issue in the Linux kernel code: gpiolib: Extend software-node support to support secondary software-nodes
Problem Details: When a software-node gets added to a device which already has another fwnode as primary node it will become the secondary fwnode for that device. Currently if a software-node with GPIO properties ends up as the secondary fwnode then gpiod_find_by_fwnode() will fail to find the GPIOs. Add a new gpiod_...
```diff diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 0d2b470a252e..74d54513730a 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -4604,6 +4604,23 @@ static struct gpio_desc *gpiod_find_by_fwnode(struct fwnode_handle *fwnode, return desc; } +static struct gpio_desc *gpiod_fw...
e8f85d7884e0890ea43aa36396bcaf8a2659c2ac
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Don't treat ENTER and LEAVE as branches, because they aren't
Problem Details: Remove the IsBranch flag from ENTER and LEAVE in KVM's emulator, as ENTER and LEAVE are stack operations, not branches. Add forced emulation of said instructions to the PMU counters test to prove that KVM diverges from hardware, and to guard against regressions. Opportunistically add a missing "1 MOV...
```diff diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 542d3664afa3..23929151a5b8 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -4330,8 +4330,8 @@ static const struct opcode opcode_table[256] = { I(DstReg | SrcMemFAddr | ModRM | No64 | Src2DS, em_lseg), G(ByteOp, group11), ...
3bd5e45c2ce30e239d596becd5db720f7eb83c99
Analyze and fix the following issue in the Linux kernel code: fs: udf: fix OOB read in lengthAllocDescs handling
Problem Details: When parsing Allocation Extent Descriptor, lengthAllocDescs comes from on-disk data and must be validated against the block size. Crafted or corrupted images may set lengthAllocDescs so that the total descriptor length (sizeof(allocExtDesc) + lengthAllocDescs) exceeds the buffer, leading udf_update_tag...
```diff diff --git a/fs/udf/inode.c b/fs/udf/inode.c index f24aa98e6869..a79d73f28aa7 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -2272,6 +2272,9 @@ int udf_current_aext(struct inode *inode, struct extent_position *epos, if (check_add_overflow(sizeof(struct allocExtDesc), le32_to_cpu(header->lengthAlloc...
1ae4e2dbf4cbf7c1ab2bdc89af1dc1a6af4106b3
Analyze and fix the following issue in the Linux kernel code: remoteproc: qcom: pas: Drop redundant assignment to ret
Problem Details: We don't have a way to detect if the lite firmware is actually running yet, so we should ignore the return status of qcom_scm_pas_shutdown() for now. The assignment to "ret" is not used anywhere, so just drop it. Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> Reviewed-by: Dmitry Baryshkov...
```diff diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index 2799e7191876..e6fc1a6e3d9e 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -227,7 +227,7 @@ static int qcom_pas_load(struct rproc *rproc, const struct firmware *fw) pas->firmw...
142964960c7c35de5c5f7bdd61c32699de693630
Analyze and fix the following issue in the Linux kernel code: remoteproc: qcom: pas: Shutdown lite ADSP DTB on X1E
Problem Details: The ADSP firmware on X1E has separate firmware binaries for the main firmware and the DTB. The same applies for the "lite" firmware loaded by the boot firmware. When preparing to load the new ADSP firmware we shutdown the lite_pas_id for the main firmware, but we don't shutdown the corresponding lite ...
```diff diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index 6fe5ae0a9eb1..2799e7191876 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -42,6 +42,7 @@ struct qcom_pas_data { int pas_id; int dtb_pas_id; int lite_pas_id; + int lite_dt...
54898664e1eb6b5b3e6cdd9343c6eb15da776153
Analyze and fix the following issue in the Linux kernel code: remoteproc: qcom: q6v5: Avoid handling handover twice
Problem Details: A remoteproc could theoretically signal handover twice. This is unexpected and would break the reference counting for the handover resources (power domains, clocks, regulators, etc), so add a check to prevent that from happening. Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed...
```diff diff --git a/drivers/remoteproc/qcom_q6v5.c b/drivers/remoteproc/qcom_q6v5.c index 769c6d6d6a73..58d5b85e58cd 100644 --- a/drivers/remoteproc/qcom_q6v5.c +++ b/drivers/remoteproc/qcom_q6v5.c @@ -164,6 +164,11 @@ static irqreturn_t q6v5_handover_interrupt(int irq, void *data) { struct qcom_q6v5 *q6v5 = data; ...
110be46f5afe27b66caa2d12473a84cd397b1925
Analyze and fix the following issue in the Linux kernel code: remoteproc: qcom: q6v5: Avoid disabling handover IRQ twice
Problem Details: enable_irq() and disable_irq() are reference counted, so we must make sure that each enable_irq() is always paired with a single disable_irq(). If we call disable_irq() twice followed by just a single enable_irq(), the IRQ will remain disabled forever. For the error handling path in qcom_q6v5_wait_for...
```diff diff --git a/drivers/remoteproc/qcom_q6v5.c b/drivers/remoteproc/qcom_q6v5.c index 4ee5e67a9f03..769c6d6d6a73 100644 --- a/drivers/remoteproc/qcom_q6v5.c +++ b/drivers/remoteproc/qcom_q6v5.c @@ -156,9 +156,6 @@ int qcom_q6v5_wait_for_start(struct qcom_q6v5 *q6v5, int timeout) int ret; ret = wait_for_compl...
5890f504ef543190beae2a4e244bbfa7c3e0b57c
Analyze and fix the following issue in the Linux kernel code: ns: add ns_debug()
Problem Details: Add ns_debug() that asserts that the correct operations are used for the namespace type. Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
```diff diff --git a/kernel/nscommon.c b/kernel/nscommon.c index 7aa2be6a0c32..3cef89ddef41 100644 --- a/kernel/nscommon.c +++ b/kernel/nscommon.c @@ -2,6 +2,55 @@ #include <linux/ns_common.h> #include <linux/proc_ns.h> +#include <linux/vfsdebug.h> + +#ifdef CONFIG_DEBUG_VFS +static void ns_debug(struct ns_common *...
4f115596133fa168bac06bb34c6efd8f4d84c22e
Analyze and fix the following issue in the Linux kernel code: x86/Kconfig: Reenable PTDUMP on i386
Problem Details: The commit f9aad622006bd64c ("mm: rename GENERIC_PTDUMP and PTDUMP_CORE") has broken PTDUMP and the Kconfig options that use it on ARCH=i386, including CONFIG_DEBUG_WX. CONFIG_GENERIC_PTDUMP was renamed into CONFIG_ARCH_HAS_PTDUMP, but it was mistakenly moved from "config X86" to "config X86_64". ...
```diff diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 52c8910ba2ef..05880301212e 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -26,7 +26,6 @@ config X86_64 depends on 64BIT # Options that are inherently 64-bit kernel only: select ARCH_HAS_GIGANTIC_PAGE - select ARCH_HAS_PTDUMP select ARCH_SUP...
9e69bafece43dcefec864f00b3ec7e088aa7fcbc
Analyze and fix the following issue in the Linux kernel code: drm/xe: Don't copy pinned kernel bos twice on suspend
Problem Details: We were copying the bo content the bos on the list "xe->pinned.late.kernel_bo_present" twice on suspend. Presumingly the intent is to copy the pinned external bos on the first pass. This is harmless since we (currently) should have no pinned external bos needing copy since a) exernal system bos don't...
```diff diff --git a/drivers/gpu/drm/xe/xe_bo_evict.c b/drivers/gpu/drm/xe/xe_bo_evict.c index 7484ce55a303..d5dbc51e8612 100644 --- a/drivers/gpu/drm/xe/xe_bo_evict.c +++ b/drivers/gpu/drm/xe/xe_bo_evict.c @@ -158,8 +158,8 @@ int xe_bo_evict_all(struct xe_device *xe) if (ret) return ret; - ret = xe_bo_apply_to_...
272dd0e5e58d9c216771aa4a9dc1e36a662792da
Analyze and fix the following issue in the Linux kernel code: Documentation: hisi-pmu: Fix of minor format error
Problem Details: The inline path of sysfs should be placed in literal blocks to make documentation look better. Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com> Acked-by: Yicong Yang <yangyicong@hisilicon.com> Signed-off-by: Yushan Wang <wangyushan12@huawei.com> Signed-off-by: Will Deacon <will@kernel.org>
```diff diff --git a/Documentation/admin-guide/perf/hisi-pmu.rst b/Documentation/admin-guide/perf/hisi-pmu.rst index 6f0ea4f641cc..8df048c26498 100644 --- a/Documentation/admin-guide/perf/hisi-pmu.rst +++ b/Documentation/admin-guide/perf/hisi-pmu.rst @@ -18,9 +18,10 @@ HiSilicon SoC uncore PMU driver Each device PMU h...
475d94dfe7c635b4311b6c9d87f49534eab6589c
Analyze and fix the following issue in the Linux kernel code: drivers/perf: hisi: Add support for L3C PMU v3
Problem Details: This patch adds support for L3C PMU v3. The v3 L3C PMU supports an extended events space which can be controlled in up to 2 extra address spaces with separate overflow interrupts. The layout of the control/event registers are kept the same. The extended events with original ones together cover the moni...
```diff diff --git a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c index 7928b9bb3e7e..bbd81a43047d 100644 --- a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c @@ -39,6 +39,7 @@ /* L3C has 8-counters */ #define L3C_NR_COU...
5973a62efa34c80c9a4e5eac1fca6f6209b902af
Analyze and fix the following issue in the Linux kernel code: arm64: map [_text, _stext) virtual address range non-executable+read-only
Problem Details: Since the referenced fixes commit, the kernel's .text section is only mapped starting from _stext; the region [_text, _stext) is omitted. As a result, other vmalloc/vmap allocations may use the virtual addresses nominally in the range [_text, _stext). This address reuse confuses multiple things: 1. cr...
```diff diff --git a/arch/arm64/kernel/pi/map_kernel.c b/arch/arm64/kernel/pi/map_kernel.c index e6d35eff1486..e8ddbde31a83 100644 --- a/arch/arm64/kernel/pi/map_kernel.c +++ b/arch/arm64/kernel/pi/map_kernel.c @@ -78,6 +78,12 @@ static void __init map_kernel(u64 kaslr_offset, u64 va_offset, int root_level) twopass |...
6ef2175fce30ccab80d519f2afcc93d8b138c16c
Analyze and fix the following issue in the Linux kernel code: xfs: use bt_nr_sectors in xfs_dax_translate_range
Problem Details: Only ranges inside the file system can be translated, and the file system can be smaller than the containing device. Fixes: f4ed93037966 ("xfs: don't shut down the filesystem for media failures beyond end of log") Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kerne...
```diff diff --git a/fs/xfs/xfs_notify_failure.c b/fs/xfs/xfs_notify_failure.c index fbeddcac4792..b17672889942 100644 --- a/fs/xfs/xfs_notify_failure.c +++ b/fs/xfs/xfs_notify_failure.c @@ -165,7 +165,7 @@ xfs_dax_translate_range( uint64_t *bblen) { u64 dev_start = btp->bt_dax_part_off; - u64 dev_len = bdev_...
42852fe57c6d2a0abb10429841cb1226b7186b7a
Analyze and fix the following issue in the Linux kernel code: xfs: track the number of blocks in each buftarg
Problem Details: Add a bt_nr_sectors to track the number of sector in each buftarg, and replace the check that hard codes sb_dblock in xfs_buf_map_verify with this new value so that it is correct for non-ddev buftargs. The RT buftarg only has a superblock in the first block, so it is unlikely to trigger this, or are w...
```diff diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 8360e77b3215..773d959965dc 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -387,8 +387,6 @@ xfs_buf_map_verify( struct xfs_buftarg *btp, struct xfs_buf_map *map) { - xfs_daddr_t eofs; - /* Check for IOs smaller than the sector size / not sec...
fa93b45fd397e25265ff618de26dd5c74ee403d3
Analyze and fix the following issue in the Linux kernel code: arm64: Enable vmalloc-huge with ptdump
Problem Details: Our goal is to move towards enabling vmalloc-huge by default on arm64 so as to reduce TLB pressure. Therefore, we need a way to analyze the portion of block mappings in vmalloc space we can get on a production system; this can be done through ptdump, but currently we disable vmalloc-huge if CONFIG_PTDU...
```diff diff --git a/arch/arm64/include/asm/ptdump.h b/arch/arm64/include/asm/ptdump.h index fded5358641f..baff24004459 100644 --- a/arch/arm64/include/asm/ptdump.h +++ b/arch/arm64/include/asm/ptdump.h @@ -7,6 +7,8 @@ #include <linux/ptdump.h> +DECLARE_STATIC_KEY_FALSE(arm64_ptdump_lock_key); + #ifdef CONFIG_PTD...
4708fba19adee9ba14ef28af6face4ab043d9cd6
Analyze and fix the following issue in the Linux kernel code: powerpc/vpa_dtl: Add interface to expose vpa dtl counters via perf
Problem Details: The pseries Shared Processor Logical Partition(SPLPAR) machines can retrieve a log of dispatch and preempt events from the hypervisor using data from Disptach Trace Log(DTL) buffer. With this information, user can retrieve when and why each dispatch & preempt has occurred. Added an interface to expose ...
```diff diff --git a/arch/powerpc/perf/Makefile b/arch/powerpc/perf/Makefile index 7f53fcb7495a..78dd7e25219e 100644 --- a/arch/powerpc/perf/Makefile +++ b/arch/powerpc/perf/Makefile @@ -14,7 +14,7 @@ obj-$(CONFIG_PPC_POWERNV) += imc-pmu.o obj-$(CONFIG_FSL_EMB_PERF_EVENT) += core-fsl-emb.o obj-$(CONFIG_FSL_EMB_PERF_E...
3239c44df756bbc28182eb05aeeea84875c315fe
Analyze and fix the following issue in the Linux kernel code: btrfs: rework error handling of run_delalloc_nocow()
Problem Details: Currently the error handling of run_delalloc_nocow() modifies @cur_offset to handle different parts of the delalloc range. However the error handling can always be split into 3 parts: 1) The range with ordered extents allocated (OE cleanup) We have to cleanup the ordered extents and unlock the fol...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 0c9c51b3952c..4583d6331bfd 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2047,6 +2047,12 @@ static noinline int run_delalloc_nocow(struct btrfs_inode *inode, bool check_prev = true; u64 ino = btrfs_ino(inode); struct can_nocow_file_extent_a...
e8513c012de75fd65e2df5499572bc6ef3f6e409
Analyze and fix the following issue in the Linux kernel code: btrfs: implement ref_tracker for delayed_nodes
Problem Details: Add ref_tracker infrastructure for struct btrfs_delayed_node. It is a response to the largest btrfs related crash in our fleet. We're seeing soft lockups in btrfs_kill_all_delayed_nodes() that seem to be a result of delayed_nodes not being released properly. A ref_tracker object is allocated on refe...
```diff diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig index 86d791210c39..4438637c8900 100644 --- a/fs/btrfs/Kconfig +++ b/fs/btrfs/Kconfig @@ -62,6 +62,7 @@ config BTRFS_FS_RUN_SANITY_TESTS config BTRFS_DEBUG bool "Btrfs debugging support" depends on BTRFS_FS + select REF_TRACKER if STACKTRACE_SUPPORT help ...
cba7c35fec267188a9708deae857e9116c57497b
Analyze and fix the following issue in the Linux kernel code: btrfs: move ref-verify under CONFIG_BTRFS_DEBUG
Problem Details: Remove CONFIG_BTRFS_FS_REF_VERIFY Kconfig and add it as part of CONFIG_BTRFS_DEBUG. This should not be impactful to the performance of debug. The struct btrfs_ref takes an additional u64, btrfs_fs_info takes an additional spinlock_t and rb_root. All of the ref_verify logic is still protected by a mount...
```diff diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig index ea95c90c8474..86d791210c39 100644 --- a/fs/btrfs/Kconfig +++ b/fs/btrfs/Kconfig @@ -117,14 +117,3 @@ config BTRFS_EXPERIMENTAL - large folio support If unsure, say N. - -config BTRFS_FS_REF_VERIFY - bool "Btrfs with the ref verify tool compiled in...
6d9cce2d1bb6b70916de351490d1ff197058b88f
Analyze and fix the following issue in the Linux kernel code: btrfs: remove duplicate inclusion of linux/types.h
Problem Details: In messages.h there's linux/types.h included more than once. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=22939 Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David ...
```diff diff --git a/fs/btrfs/messages.h b/fs/btrfs/messages.h index 022ebc89af85..4416c165644f 100644 --- a/fs/btrfs/messages.h +++ b/fs/btrfs/messages.h @@ -3,7 +3,6 @@ #ifndef BTRFS_MESSAGES_H #define BTRFS_MESSAGES_H -#include <linux/types.h> #include <linux/types.h> #include <linux/printk.h> #include <linux...
188f63235bcdd207646773a8739387d85347ed76
Analyze and fix the following issue in the Linux kernel code: spi: fix return code when spi device has too many chipselects
Problem Details: Don't return a positive value when there are too many chipselects. Fixes: 4d8ff6b0991d ("spi: Add multi-cs memories support in SPI core") Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Link: https://patch.msgid.link/20250915183725.219473-2-jonas.gorski@gmail.com Signed-off-by: Mark Brown <brooni...
```diff diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index f95c4304df8e..b07d6cdf587c 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2445,7 +2445,7 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi, if (rc > ctlr->num_chipselect) { dev_err(&ctlr->dev, "%pOF has num...
398a8a4e51dbd03e4103ea596ea4ea037fe67175
Analyze and fix the following issue in the Linux kernel code: spi: omap2-mcspi: drive SPI_CLK on transfer_setup()
Problem Details: If the cached contents of the CHCONF register doesn't have the FORCE bit set, the setup() function failed to set the relevant idle state of the SPI_CLK pin. In such case, the SPI_CLK's idle state is reached later with set_cs(), but it's too late for the first SPI transfer which fails since the CS is as...
```diff diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 6dc58a30804a..69c2e9d9be3c 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -988,6 +988,7 @@ static int omap2_mcspi_setup_transfer(struct spi_device *spi, else l &= ~OMAP2_MCSPI_CHCONF_PHA; +...
9cf5b8b69bfccf3d98d31f640244437a452daa80
Analyze and fix the following issue in the Linux kernel code: ASoC: tas2781: Correct the wrong description and register address on tas2781
Problem Details: Correct the wrong description for TAS257X. Combined TAS5825 with TAS2563, as they use the same register address and number. Correct the register address and number for TAS5827. Fixes: 7095d688de38 ("ASoC: tas2781: Add tas2118, tas2x20, tas5825 support") Signed-off-by: Baojun Xu <baojun.xu@ti.com> Acke...
```diff diff --git a/Documentation/devicetree/bindings/sound/ti,tas2781.yaml b/Documentation/devicetree/bindings/sound/ti,tas2781.yaml index 011211112be4..bd00afa47d62 100644 --- a/Documentation/devicetree/bindings/sound/ti,tas2781.yaml +++ b/Documentation/devicetree/bindings/sound/ti,tas2781.yaml @@ -11,11 +11,13 @@ m...
9d52b0b41be5b932a0a929c10038f1bb04af4ca5
Analyze and fix the following issue in the Linux kernel code: xen: take system_transition_mutex on suspend
Problem Details: Xen's do_suspend() calls dpm_suspend_start() without taking required system_transition_mutex. Since 12ffc3b1513eb moved the pm_restrict_gfp_mask() call, not taking that mutex results in a WARN. Take the mutex in do_suspend(), and use mutex_trylock() to follow how enter_state() does this. Suggested-by...
```diff diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index 1f5a7a42fc32..e20c40a62e64 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c @@ -11,6 +11,7 @@ #include <linux/reboot.h> #include <linux/sysrq.h> #include <linux/stop_machine.h> +#include <linux/suspend.h> #include <linux/freezer.h> ...
1a194e6c8e1ee745e914b0b7f50fa86c89ed13fe
Analyze and fix the following issue in the Linux kernel code: fbcon: fix integer overflow in fbcon_do_set_font
Problem Details: Fix integer overflow vulnerabilities in fbcon_do_set_font() where font size calculations could overflow when handling user-controlled font parameters. The vulnerabilities occur when: 1. CALC_FONTSZ(h, pitch, charcount) performs h * pith * charcount multiplication with user-controlled values that ca...
```diff diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 55f5731e94c3..a507d05f8fea 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -2531,9 +2531,16 @@ static int fbcon_set_font(struct vc_data *vc, const struct console_font *font, if (fbcon...
4f152338e384a3a47dd61909e1457539fa93f5a4
Analyze and fix the following issue in the Linux kernel code: PCI: tegra194: Fix duplicate PLL disable in pex_ep_event_pex_rst_assert()
Problem Details: During PERST# assertion tegra_pcie_bpmp_set_pll_state() is currently called twice. pex_ep_event_pex_rst_assert() should do the opposite of pex_ep_event_pex_rst_deassert(), so it is obvious that the duplicate tegra_pcie_bpmp_set_pll_state() is a mistake, and that the duplicate tegra_pcie_bpmp_set_pll_s...
```diff diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index 4f26086f25da..0c0734aa14b6 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -1722,9 +1722,9 @@ static void pex_ep_event_pex_rst_assert(struct tegr...
d5cf5b37064b1699d946e8b7ab4ac7d7d101814c
Analyze and fix the following issue in the Linux kernel code: tee: fix register_shm_helper()
Problem Details: In register_shm_helper(), fix incorrect error handling for a call to iov_iter_extract_pages(). A case is missing for when iov_iter_extract_pages() only got some pages and return a number larger than 0, but not the requested amount. This fixes a possible NULL pointer dereference following a bad input f...
```diff diff --git a/drivers/tee/tee_shm.c b/drivers/tee/tee_shm.c index daf6e5cfd59a..76c54e1dc98c 100644 --- a/drivers/tee/tee_shm.c +++ b/drivers/tee/tee_shm.c @@ -319,6 +319,14 @@ register_shm_helper(struct tee_context *ctx, struct iov_iter *iter, u32 flags, if (unlikely(len <= 0)) { ret = len ? ERR_PTR(len) :...
570f94511766f9236d3462dfb8a3c719c2b54c23
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: avoid circular locking dependency in ser_state_run()
Problem Details: Lockdep gives a splat [1] when ser_hdl_work item is executed. It is scheduled at mac80211 workqueue via ieee80211_queue_work() and takes a wiphy lock inside. However, this workqueue can be flushed when e.g. closing the interface and wiphy lock is already taken in that case. Choosing wiphy_work_queue...
```diff diff --git a/drivers/net/wireless/realtek/rtw89/ser.c b/drivers/net/wireless/realtek/rtw89/ser.c index fe7beff8c424..f99e179f7ff9 100644 --- a/drivers/net/wireless/realtek/rtw89/ser.c +++ b/drivers/net/wireless/realtek/rtw89/ser.c @@ -205,7 +205,6 @@ static void rtw89_ser_hdl_work(struct work_struct *work) s...
a9f0064f4716b0fd97085015ea1dd398bdfdc946
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: fix leak in rtw89_core_send_nullfunc()
Problem Details: If there is no rtwsta_link found in rtw89_core_send_nullfunc(), allocated skb is leaked. Free it on the error handling path. Found by Linux Verification Center (linuxtesting.org). Fixes: a8ba4acab7db ("wifi: rtw89: send nullfunc based on the given link") Signed-off-by: Fedor Pchelkin <pchelkin@ispra...
```diff diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c index 1f44c7fc1c5e..917b2adede61 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -3961,6 +3961,7 @@ int rtw89_core_send_nullfunc(struct rtw89_dev *rtwdev, ...
c24248ed78f33ea299ea61d105355ba47157d49f
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: avoid possible TX wait initialization race
Problem Details: The value of skb_data->wait indicates whether skb is passed on to the core mac80211 stack or released by the driver itself. Make sure that by the time skb is added to txwd queue and becomes visible to the completing side, it has already allocated and initialized TX wait related data (in case it's need...
```diff diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c index ec467ae0e9e6..1f44c7fc1c5e 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -1153,25 +1153,14 @@ void rtw89_core_tx_kick_off(struct rtw89_dev *rtwdev,...
3e31a6bc07312b448fad3b45de578471f86f0e77
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: fix use-after-free in rtw89_core_tx_kick_off_and_wait()
Problem Details: There is a bug observed when rtw89_core_tx_kick_off_and_wait() tries to access already freed skb_data: BUG: KFENCE: use-after-free write in rtw89_core_tx_kick_off_and_wait drivers/net/wireless/realtek/rtw89/core.c:1110 CPU: 6 UID: 0 PID: 41377 Comm: kworker/u64:24 Not tainted 6.17.0-rc1+ #1 PREEMP...
```diff diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c index fe059c4a6b55..ec467ae0e9e6 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -1135,6 +1135,14 @@ rtw89_core_tx_update_desc_info(struct rtw89_dev *rtwde...
302c04110f0ce70d25add2496b521132548cd408
Analyze and fix the following issue in the Linux kernel code: sparc: fix error handling in scan_one_device()
Problem Details: Once of_device_register() failed, we should call put_device() to decrement reference count for cleanup. Or it could cause memory leak. So fix this by calling put_device(), then the name can be freed in kobject_cleanup(). Calling path: of_device_register() -> of_device_add() -> device_add(). As comment...
```diff diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c index 06012e68bdca..284a4cafa432 100644 --- a/arch/sparc/kernel/of_device_32.c +++ b/arch/sparc/kernel/of_device_32.c @@ -387,6 +387,7 @@ static struct platform_device * __init scan_one_device(struct device_node *dp, if (of_dev...
c8e8e9ab14a6ea926641d161768e1e3ef286a853
Analyze and fix the following issue in the Linux kernel code: drm/i915/ddi: Guard reg_val against a INVALID_TRANSCODER
Problem Details: Currently we check if the encoder is INVALID or -1 and throw a WARN_ON but we still end up writing the temp value which will overflow and corrupt the whole programmed value. --v2 -Assign a bogus transcoder to master in case we get a INVALID TRANSCODER [Jani] Fixes: 6671c367a9bea ("drm/i915/tgl: Selec...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index 08083ac83a74..c09aa759f4d4 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -597,8 +597,9 @@ intel_ddi_transcoder_func_reg_val_get(struct intel_encoder *e...
1cf9f2a6a544288516a7b9e883a48eba6246bcf2
Analyze and fix the following issue in the Linux kernel code: smb: client: handle unlink(2) of files open by different clients
Problem Details: In order to identify whether a certain file is open by a different client, start the unlink process by sending a compound request of CREATE(DELETE_ON_CLOSE) + CLOSE with only FILE_SHARE_DELETE bit set in smb2_create_req::ShareAccess. If the file is currently open, then the server will fail the request...
```diff diff --git a/fs/smb/client/smb2inode.c b/fs/smb/client/smb2inode.c index 7cadc8ca4f55..e32a3f338793 100644 --- a/fs/smb/client/smb2inode.c +++ b/fs/smb/client/smb2inode.c @@ -1175,23 +1175,92 @@ int smb2_unlink(const unsigned int xid, struct cifs_tcon *tcon, const char *name, struct cifs_sb_info *cifs_sb...
f7f89250175e0a82e99ed66da7012e869c36497d
Analyze and fix the following issue in the Linux kernel code: smb: server: use disable_work_sync in transport_rdma.c
Problem Details: This makes it safer during the disconnect and avoids requeueing. It's ok to call disable_work[_sync]() more than once. Cc: Namjae Jeon <linkinjeon@kernel.org> Cc: Steve French <smfrench@gmail.com> Cc: Tom Talpey <tom@talpey.com> Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Fixes...
```diff diff --git a/fs/smb/server/transport_rdma.c b/fs/smb/server/transport_rdma.c index 10a6b4ed1a03..74dfb6496095 100644 --- a/fs/smb/server/transport_rdma.c +++ b/fs/smb/server/transport_rdma.c @@ -399,9 +399,9 @@ static void free_transport(struct smb_direct_transport *t) wait_event(t->wait_send_pending, a...
1cde0a74a7a8951b3097417847a458e557be0b5b
Analyze and fix the following issue in the Linux kernel code: smb: server: don't use delayed_work for post_recv_credits_work
Problem Details: If we are using a hardcoded delay of 0 there's no point in using delayed_work it only adds confusion. The client also uses a normal work_struct and now it is easier to move it to the common smbdirect_socket. Cc: Namjae Jeon <linkinjeon@kernel.org> Cc: Steve French <smfrench@gmail.com> Cc: Tom Talpey ...
```diff diff --git a/fs/smb/server/transport_rdma.c b/fs/smb/server/transport_rdma.c index 6550bd9f002c..10a6b4ed1a03 100644 --- a/fs/smb/server/transport_rdma.c +++ b/fs/smb/server/transport_rdma.c @@ -148,7 +148,7 @@ struct smb_direct_transport { wait_queue_head_t wait_send_pending; atomic_t send_pending; - st...
6c15463c4511d26f2a820f63f5b76624a71afc44
Analyze and fix the following issue in the Linux kernel code: sunrpc: fix "occurence"->"occurrence"
Problem Details: Trivial fix to spelling mistake in comment text. Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com> Reviewed-by: Joe Damato <joe@dama.to> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
```diff diff --git a/net/sunrpc/sysfs.c b/net/sunrpc/sysfs.c index 09434e1143c5..8b01b7ae2690 100644 --- a/net/sunrpc/sysfs.c +++ b/net/sunrpc/sysfs.c @@ -389,7 +389,7 @@ static ssize_t rpc_sysfs_xprt_dstaddr_store(struct kobject *kobj, saddr = (struct sockaddr *)&xprt->addr; port = rpc_get_port(saddr); - /* buf_...
a082e4b4d08a4a0e656d90c2c05da85f23e6d0c9
Analyze and fix the following issue in the Linux kernel code: nfsd: nfserr_jukebox in nlm_fopen should lead to a retry
Problem Details: When v3 NLM request finds a conflicting delegation, it triggers a delegation recall and nfsd_open fails with EAGAIN. nfsd_open then translates EAGAIN into nfserr_jukebox. In nlm_fopen, instead of returning nlm_failed for when there is a conflicting delegation, drop this NLM request so that the client r...
```diff diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c index edc9f75dc75c..6b042218668b 100644 --- a/fs/nfsd/lockd.c +++ b/fs/nfsd/lockd.c @@ -57,6 +57,21 @@ nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file **filp, switch (nfserr) { case nfs_ok: return 0; + case nfserr_jukebox: + /* this error ca...
898374fdd7f06fa4c4a66e8be3135efeae6128d5
Analyze and fix the following issue in the Linux kernel code: nfsd: unregister with rpcbind when deleting a transport
Problem Details: When a listener is added, a part of creation of transport also registers program/port with rpcbind. However, when the listener is removed, while transport goes away, rpcbind still has the entry for that port/type. When deleting the transport, unregister with rpcbind when appropriate. ---v2 created a ...
```diff diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index 369a89aea186..2b886f7eb295 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h @@ -104,6 +104,9 @@ enum { * it has access to. It is NOT counted * in ->sv_tmpcnt. */ + XPT_RPCB_U...
a9a15ba23efc4d6d34127e8d175ae63a95434f58
Analyze and fix the following issue in the Linux kernel code: sunrpc: fix pr_notice in svc_tcp_sendto() to show correct length
Problem Details: This pr_notice() is confusing since it only prints xdr->len, which doesn't include the 4-byte record marker. That can make it sometimes look like the socket sent more than was requested if it's short by just a few bytes. Add sizeof(marker) to the size and fix the format accordingly. Signed-off-by: J...
```diff diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index e2c5e0e626f9..1afaeb45d6a3 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1293,10 +1293,10 @@ out_notconn: mutex_unlock(&xprt->xpt_mutex); return -ENOTCONN; out_close: - pr_notice("rpc-srv/tcp: %s: %s %d when sending %d bytes ...
e4f574ca9c6dfa66695bb054ff5df43ecea873ec
Analyze and fix the following issue in the Linux kernel code: nfsd: decouple the xprtsec policy check from check_nfsd_access()
Problem Details: A while back I had reported that an NFSv3 client could successfully mount using '-o xprtsec=none' an export that had been exported with 'xprtsec=tls:mtls'. By "successfully" I mean that the mount command would succeed and the mount would show up in /proc/mount. Attempting to do anything futher with t...
```diff diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index cadfc2bae60e..95b5681152c4 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -1082,50 +1082,62 @@ static struct svc_export *exp_find(struct cache_detail *cd, } /** - * check_nfsd_access - check if access to export is allowed. + * check_xprtsec_pol...
ab1c282c010c4f327bd7addc3c0035fd8e3c1721
Analyze and fix the following issue in the Linux kernel code: NFSD: Fix destination buffer size in nfsd4_ssc_setup_dul()
Problem Details: Commit 5304877936c0 ("NFSD: Fix strncpy() fortify warning") replaced strncpy(,, sizeof(..)) with strlcpy(,, sizeof(..) - 1), but strlcpy() already guaranteed NUL-termination of the destination buffer and subtracting one byte potentially truncated the source string. The incorrect size was then carried ...
```diff diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index bfebe6e25638..d7c58aa64f06 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1519,7 +1519,7 @@ try_again: return 0; } if (work) { - strscpy(work->nsui_ipaddr, ipaddr, sizeof(work->nsui_ipaddr) - 1); + strscpy(work->nsui_ipaddr, ipadd...
b40b1ba37ad5b6099c426765c4bc327c08b390b9
Analyze and fix the following issue in the Linux kernel code: nfsd: fix timestamp updates in CB_GETATTR
Problem Details: When updating the local timestamps from CB_GETATTR, the updated values are not being properly vetted. Compare the update times vs. the saved times in the delegation rather than the current times in the inode. Also, ensure that the ctime is properly vetted vs. its original value. Fixes: 6ae30d6eb26b (...
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index f2fd0cbe256b..205ee8cc6fa2 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -9175,20 +9175,19 @@ static int cb_getattr_update_times(struct dentry *dentry, struct nfs4_delegation int ret; if (deleg_attrs_deleg(dp->dl_type)) { - stru...
3952f1cbcbc454b2cb639ddbf165c07068e90371
Analyze and fix the following issue in the Linux kernel code: nfsd: fix SETATTR updates for delegated timestamps
Problem Details: SETATTRs containing delegated timestamp updates are currently not being vetted properly. Since we no longer need to compare the timestamps vs. the current timestamps, move the vetting of delegated timestamps wholly into nfsd. Rename the set_cb_time() helper to nfsd4_vet_deleg_time(), and make it non-s...
```diff diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 7043fc475458..aacd912a5fbe 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1133,6 +1133,33 @@ nfsd4_secinfo_no_name_release(union nfsd4_op_u *u) exp_put(u->secinfo_no_name.sin_exp); } +/* + * Validate that the requested timestamps are...
7663e963a51122792811811c8119fd55c9ab254a
Analyze and fix the following issue in the Linux kernel code: nfsd: track original timestamps in nfs4_delegation
Problem Details: As Trond points out [1], the "original time" mentioned in RFC 9754 refers to the timestamps on the files at the time that the delegation was granted, and not the current timestamp of the file on the server. Store the current timestamps for the file in the nfs4_delegation when granting one. Add STATX_A...
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 77eea2ad93cc..8737b721daf3 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -6157,7 +6157,8 @@ nfs4_delegation_stat(struct nfs4_delegation *dp, struct svc_fh *currentfh, path.dentry = file_dentry(nf->nf_file); rc = vfs_getattr(&path...
c066ff58e5d6e5d7400e5fda0c33f95b8c37dd02
Analyze and fix the following issue in the Linux kernel code: nfsd: use ATTR_CTIME_SET for delegated ctime updates
Problem Details: Ensure that notify_change() doesn't clobber a delegated ctime update with current_time() by setting ATTR_CTIME_SET for those updates. Don't bother setting the timestamps in cb_getattr_update_times() in the non-delegated case. notify_change() will do that itself. Fixes: 7e13f4f8d27d ("nfsd: handle del...
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 88c347957da5..77eea2ad93cc 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -9167,7 +9167,6 @@ static bool set_cb_time(struct timespec64 *cb, const struct timespec64 *orig, static int cb_getattr_update_times(struct dentry *dentry, struct...
5affb498e70bba3053b835c478a199bf92c99c4d
Analyze and fix the following issue in the Linux kernel code: nfsd: ignore ATTR_DELEG when checking ia_valid before notify_change()
Problem Details: If the only flag left is ATTR_DELEG, then there are no changes to be made. Fixes: 7e13f4f8d27d ("nfsd: handle delegated timestamps in SETATTR") Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
```diff diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index edf050766e57..3cd3b9e069f4 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -467,7 +467,7 @@ static int __nfsd_setattr(struct dentry *dentry, struct iattr *iap) return 0; } - if (!iap->ia_valid) + if ((iap->ia_valid & ~ATTR_DELEG) == 0) return 0; ...
2990b5a47984c27873d165de9e88099deee95c8d
Analyze and fix the following issue in the Linux kernel code: nfsd: fix assignment of ia_ctime.tv_nsec on delegated mtime update
Problem Details: The ia_ctime.tv_nsec field should be set to modify.nseconds. Fixes: 7e13f4f8d27d ("nfsd: handle delegated timestamps in SETATTR") Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
```diff diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 8b68f74a8cf0..52033e2d603e 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -538,7 +538,7 @@ nfsd4_decode_fattr4(struct nfsd4_compoundargs *argp, u32 *bmval, u32 bmlen, iattr->ia_mtime.tv_sec = modify.seconds; iattr->ia_mtime.tv_nsec = modi...
d68886bae76a4b9b3484d23e5b7df086f940fa38
Analyze and fix the following issue in the Linux kernel code: NFSD: Fix last write offset handling in layoutcommit
Problem Details: The data type of loca_last_write_offset is newoffset4 and is switched on a boolean value, no_newoffset, that indicates if a previous write occurred or not. If no_newoffset is FALSE, an offset is not given. This means that client does not try to update the file size. Thus, server should not try to calcu...
```diff diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c index 4c936132eb44..0822d8a119c6 100644 --- a/fs/nfsd/blocklayout.c +++ b/fs/nfsd/blocklayout.c @@ -118,7 +118,6 @@ nfsd4_block_commit_blocks(struct inode *inode, struct nfsd4_layoutcommit *lcp, struct iomap *iomaps, int nr_iomaps) { struct timesp...
6df164e29bd4e6505c5a2e0e5f1e1f6957a16a42
Analyze and fix the following issue in the Linux kernel code: sunrpc: fix null pointer dereference on zero-length checksum
Problem Details: In xdr_stream_decode_opaque_auth(), zero-length checksum.len causes checksum.data to be set to NULL. This triggers a NPD when accessing checksum.data in gss_krb5_verify_mic_v2(). This patch ensures that the value of checksum.len is not less than XDR_UNIT. Fixes: 0653028e8f1c ("SUNRPC: Convert gss_veri...
```diff diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index e82212f6b562..a8ec30759a18 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -724,7 +724,7 @@ svcauth_gss_verify_header(struct svc_rqst *rqstp, struct rsc *rsci, rqstp->rq_auth_sta...
2af8a8a47df36a202c65ce4af93fb8bc7b607210
Analyze and fix the following issue in the Linux kernel code: docs: remove cdomain.py
Problem Details: This is not used anymore, as it was a logic we had to support pre Sphinx 3.x, as shown at: afde706afde2 ("Make the docs build "work" with Sphinx 3.x") Remove it. Fixes: b26717852db7 ("docs: conf.py: drop backward support for old Sphinx versions") Signed-off-by: Mauro Carvalho Chehab <mchehab+hua...
```diff diff --git a/Documentation/sphinx/cdomain.py b/Documentation/sphinx/cdomain.py deleted file mode 100644 index 3dc285dc70f5..000000000000 --- a/Documentation/sphinx/cdomain.py +++ /dev/null @@ -1,247 +0,0 @@ -# -*- coding: utf-8; mode: python -*- -# SPDX-License-Identifier: GPL-2.0 -# pylint: disable=W0141,C0113...
22014a23009326ae63efb08575aada1de2c95bda
Analyze and fix the following issue in the Linux kernel code: Documentation/process: submitting-patches: fix typo in "were do"
Problem Details: Fixes a typo in submitting-patches.rst: "were do" -> "where do" Signed-off-by: Yash Suthar <yashsuthar983@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20250920190856.7394-1-yashsuthar983@gmail.com>
```diff diff --git a/Documentation/process/submitting-patches.rst b/Documentation/process/submitting-patches.rst index 5778cb9701e1..910e8fc9e3c8 100644 --- a/Documentation/process/submitting-patches.rst +++ b/Documentation/process/submitting-patches.rst @@ -343,7 +343,7 @@ https://en.wikipedia.org/wiki/Posting_style#I...
ab588b78cdb8d677f70278587041a7366b0cff71
Analyze and fix the following issue in the Linux kernel code: docs: dev-tools/lkmm: Fix typo of missing file extension
Problem Details: Commit 1e9ddbb2cd34 ("docs: Pull LKMM documentation into dev-tools book") failed to add a file extension in lkmm/docs/herd-representation.rst for referencing its plane-text counterpart. Fix it. Fixes: 1e9ddbb2cd34 ("docs: Pull LKMM documentation into dev-tools book") Reported-by: kernel test robot <l...
```diff diff --git a/Documentation/dev-tools/lkmm/docs/herd-representation.rst b/Documentation/dev-tools/lkmm/docs/herd-representation.rst index ebf4a2181cd7..f7b41f286eb9 100644 --- a/Documentation/dev-tools/lkmm/docs/herd-representation.rst +++ b/Documentation/dev-tools/lkmm/docs/herd-representation.rst @@ -3,7 +3,7 ...
d6d673dd1e92b2bed0096e7e7e9fe5d7e7d2156c
Analyze and fix the following issue in the Linux kernel code: uapi: vduse: fix typo in comment
Problem Details: Fix a spelling mistake in vduse.h: "regsion" → "region" in the documentation for struct vduse_iova_info. No functional change. Signed-off-by: Ashwini Sahu <ashwini@wisig.com> Message-Id: <20250908095645.610336-1-ashwini@wisig.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
```diff diff --git a/include/uapi/linux/vduse.h b/include/uapi/linux/vduse.h index 68a627d04afa..10ad71aa00d6 100644 --- a/include/uapi/linux/vduse.h +++ b/include/uapi/linux/vduse.h @@ -237,7 +237,7 @@ struct vduse_iova_umem { * struct vduse_iova_info - information of one IOVA region * @start: start of the IOVA re...
afe16653e05db07d658b55245c7a2e0603f136c0
Analyze and fix the following issue in the Linux kernel code: vhost: Take a reference on the task in struct vhost_task.
Problem Details: vhost_task_create() creates a task and keeps a reference to its task_struct. That task may exit early via a signal and its task_struct will be released. A pending vhost_task_wake() will then attempt to wake the task and access a task_struct which is no longer there. Acquire a reference on the task_str...
```diff diff --git a/kernel/vhost_task.c b/kernel/vhost_task.c index bc738fa90c1d..27107dcc1cbf 100644 --- a/kernel/vhost_task.c +++ b/kernel/vhost_task.c @@ -100,6 +100,7 @@ void vhost_task_stop(struct vhost_task *vtsk) * freeing it below. */ wait_for_completion(&vtsk->exited); + put_task_struct(vtsk->task); ...
ab152db3cae520154d572cff32e63de441672454
Analyze and fix the following issue in the Linux kernel code: mm/damon/core: implement damon_initialized() function
Problem Details: Patch series "mm/damon: define and use DAMON initialization check function". DAMON is initialized in subsystem initialization time, by damon_init(). If DAMON API functions are called before the initialization, the system could crash. Actually such issues happened and were fixed [1] in the past. For ...
```diff diff --git a/include/linux/damon.h b/include/linux/damon.h index aa7381be388c..cae8c613c5fc 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -938,6 +938,7 @@ static inline unsigned int damon_max_nr_accesses(const struct damon_attrs *attrs } +bool damon_initialized(void); int damon_start(s...
ac93e87c66fd30b6cf328591ea0f09321ab98fac
Analyze and fix the following issue in the Linux kernel code: mm/damon/core: set effective quota on first charge window
Problem Details: The effective quota of a scheme is initialized zero, which means there is no quota. It is set based on user-specified time/quota/quota goals. But the later value set is done only from the second charge window. As a result, a scheme having a user-specified quota can work as not having the quota (unex...
```diff diff --git a/mm/damon/core.c b/mm/damon/core.c index ff2c6bb30621..775121ae7a9b 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -2142,8 +2142,10 @@ static void damos_adjust_quota(struct damon_ctx *c, struct damos *s) return; /* First charge window */ - if (!quota->total_charged_sz && !quota->charge...
2a05df14b3ad921ff2fcc6cc535cb153cbf38c87
Analyze and fix the following issue in the Linux kernel code: mm/damon/core: reset age if nr_accesses changes between non-zero and zero
Problem Details: Patch series "mm/damon: misc fixups and improvements for 6.18", v2. Misc fixes and improvements for DAMON that are not critical and therefore aims to be merged into Linux 6.18-rc1. The first patch improves DAMON's age counting for nr_accesses zero to/from non-zero changes. The second patch fixes an ...
```diff diff --git a/mm/damon/core.c b/mm/damon/core.c index be5942435d78..ff2c6bb30621 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -2261,6 +2261,8 @@ static void damon_merge_regions_of(struct damon_target *t, unsigned int thres, damon_for_each_region_safe(r, next, t) { if (abs(r->nr_accesses - r->last_n...
b9e2f58ffb84afcbba7e66f96ca14f98e0e88f26
Analyze and fix the following issue in the Linux kernel code: alloc_tag: mark inaccurate allocation counters in /proc/allocinfo output
Problem Details: While rare, memory allocation profiling can contain inaccurate counters if slab object extension vector allocation fails. That allocation might succeed later but prior to that, slab allocations that would have used that object extension vector will not be accounted for. To indicate incorrect counters...
```diff diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst index 915a3e44bc12..6ffd04c736db 100644 --- a/Documentation/filesystems/proc.rst +++ b/Documentation/filesystems/proc.rst @@ -1009,6 +1009,19 @@ number, module (if originates from a loadable module) and the function calling th...
e18190b7e97e9db6546390e6e0ceddae606892b2
Analyze and fix the following issue in the Linux kernel code: mm/damon/lru_sort: use param_ctx for damon_attrs staging
Problem Details: damon_lru_sort_apply_parameters() allocates a new DAMON context, stages user-specified DAMON parameters on it, and commits to running DAMON context at once, using damon_commit_ctx(). The code is, however, directly updating the monitoring attributes of the running context. And the attributes are over-...
```diff diff --git a/mm/damon/lru_sort.c b/mm/damon/lru_sort.c index 14d31009c09e..ab6173a646bd 100644 --- a/mm/damon/lru_sort.c +++ b/mm/damon/lru_sort.c @@ -219,7 +219,7 @@ static int damon_lru_sort_apply_parameters(void) goto out; } - err = damon_set_attrs(ctx, &damon_lru_sort_mon_attrs); + err = damon_set_at...
e75f15fb69610cf90e9dfa0cbe436ae9342b9b79
Analyze and fix the following issue in the Linux kernel code: selftests/mm: protection_keys: fix dead code
Problem Details: The while loop doesn't execute and following warning gets generated: protection_keys.c:561:15: warning: code will never be executed [-Wunreachable-code] int rpkey = alloc_random_pkey(); Let's enable the while loop such that it gets executed nr_iterations times. Simplify the code a bit...
```diff diff --git a/tools/testing/selftests/mm/protection_keys.c b/tools/testing/selftests/mm/protection_keys.c index c02fb204547e..2085982dba69 100644 --- a/tools/testing/selftests/mm/protection_keys.c +++ b/tools/testing/selftests/mm/protection_keys.c @@ -557,13 +557,11 @@ int mprotect_pkey(void *ptr, size_t size, u...
3d5022a0f82442e03f84e17a134c7ad8b14d6628
Analyze and fix the following issue in the Linux kernel code: selftests/mm: add -Wunreachable-code and fix warnings
Problem Details: Patch series "selftests/mm: Add -Wunreachable-code and fix warnings". Add -Wunreachable-code to selftests and remove dead code from generated warnings. This patch (of 2): Enable -Wunreachable-code flag to catch dead code and fix them. 1. Remove the dead code and write a comment instead: hmm-tests....
```diff diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 5a1dee50b898..eaf9312097f7 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -34,6 +34,7 @@ endif MAKEFLAGS += --no-builtin-rules CFLAGS = -Wall -O2 -I $(top_srcdir) $(EXT...
9e8a0bbb128ec9379ce271ccecdfb022c483da0b
Analyze and fix the following issue in the Linux kernel code: alloc_tag: prevent enabling memory profiling if it was shut down
Problem Details: Memory profiling can be shut down due to reasons like a failure during initialization. When this happens, the user should not be able to re-enable it. Current sysctrl interface does not handle this properly and will allow re-enabling memory profiling. Fix this by checking for this condition during s...
```diff diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c index 715315f5d9ba..f79217427d81 100644 --- a/lib/alloc_tag.c +++ b/lib/alloc_tag.c @@ -766,6 +766,20 @@ struct page_ext_operations page_alloc_tagging_ops = { EXPORT_SYMBOL(page_alloc_tagging_ops); #ifdef CONFIG_SYSCTL +/* + * Not using proc_do_static_key() dir...
123bcf284205b2513c4172c50da8d193f8f8ab3d
Analyze and fix the following issue in the Linux kernel code: alloc_tag: use release_pages() in the cleanup path
Problem Details: Patch series "Minor fixes for memory allocation profiling", v2. Over the last couple months I gathered a few reports of minor issues in memory allocation profiling which are addressed in this patchset. This patch (of 2): When bulk-freeing an array of pages use release_pages() instead of freeing the...
```diff diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c index e9b33848700a..715315f5d9ba 100644 --- a/lib/alloc_tag.c +++ b/lib/alloc_tag.c @@ -438,9 +438,10 @@ static int vm_module_tags_populate(void) if (nr < more_pages || vmap_pages_range(phys_end, phys_end + (nr << PAGE_SHIFT), PAGE_KERNEL, next_...
7cad96ae59b334a80b6e48c396f147a6c810c9ea
Analyze and fix the following issue in the Linux kernel code: mm/gup: fix handling of errors from arch_make_folio_accessible() in follow_page_pte()
Problem Details: In case we call arch_make_folio_accessible() and it fails, we would incorrectly return a value that is "!= 0" to the caller, indicating that we pinned all requested pages and that the caller can keep going. follow_page_pte() is not supposed to return error values, but instead "0" on failure and "1" on...
```diff diff --git a/mm/gup.c b/mm/gup.c index 00f30e03f736..a8ba5112e4d0 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -2898,12 +2898,9 @@ static int gup_fast_pte_range(pmd_t pmd, pmd_t *pmdp, unsigned long addr, * see Documentation/core-api/pin_user_pages.rst for * details. */ - if (flags & FOLL_PIN) { - ret...
c56325259abc026205c98964616dcc0df5648912
Analyze and fix the following issue in the Linux kernel code: selftests/mm: fix va_high_addr_switch.sh failure on x86_64
Problem Details: The test will fail as below on x86_64 with cpu la57 support (will skip if no la57 support). Note, the test requries nr_hugepages to be set first. # running bash ./va_high_addr_switch.sh # ------------------------------------- # mmap(addr_switch_hint - pagesize, pagesize): 0x7f55b60fa000 - OK ...
```diff diff --git a/tools/testing/selftests/mm/va_high_addr_switch.c b/tools/testing/selftests/mm/va_high_addr_switch.c index 896b3f73fc53..306eba825107 100644 --- a/tools/testing/selftests/mm/va_high_addr_switch.c +++ b/tools/testing/selftests/mm/va_high_addr_switch.c @@ -230,10 +230,10 @@ void testcases_init(void) ...
6e296bcf294ee9e8e024158ed1d279cf823eae63
Analyze and fix the following issue in the Linux kernel code: selftests/mm: fix hugepages cleanup too early
Problem Details: Patch series "Fix va_high_addr_switch.sh test failure", v3. These three patches fix the va_high_addr_switch.sh test failure on x86_64. Patch 1 fixes the hugepage setup issue that nr_hugepages is reset too early in run_vmtests.sh and break the later va_high_addr_switch testing. Patch 2 adds hugepage ...
```diff diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index 9e88cc25b9df..8115fc4526ed 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -174,13 +174,13 @@ fi # set proper nr_hugepages if [ -n "$freepgs" ] &...
e1831e8dd1c839088692c09c97031ce467db1a2a
Analyze and fix the following issue in the Linux kernel code: scripts/decode_stacktrace.sh: code: preserve alignment
Problem Details: With lines having a code to decode, the alignment was not preserved for the first line. With this sample ... [ 52.238089][ T55] RIP: 0010:__ip_queue_xmit+0x127c/0x1820 [ 52.238401][ T55] Code: c1 83 e0 07 48 c1 e9 03 83 c0 03 (...) ... the script was producing the following output: [ ...
```diff diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh index 0c92d6a7f777..c73cb802a0a3 100755 --- a/scripts/decode_stacktrace.sh +++ b/scripts/decode_stacktrace.sh @@ -242,8 +242,10 @@ debuginfod_get_vmlinux() { decode_code() { local scripts=`dirname "${BASH_SOURCE[0]}"` + local lim="Cod...
07adc4cf1ecd316e7b6f4a142e5f5e96ce697e65
Analyze and fix the following issue in the Linux kernel code: mm, swap: implement dynamic allocation of swap table
Problem Details: Now swap table is cluster based, which means free clusters can free its table since no one should modify it. There could be speculative readers, like swap cache look up, protect them by making them RCU protected. All swap table should be filled with null entries before free, so such readers will eith...
```diff diff --git a/mm/swap.h b/mm/swap.h index fe5c20922082..8d8efdf1297a 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -36,7 +36,7 @@ struct swap_cluster_info { u16 count; u8 flags; u8 order; - atomic_long_t *table; /* Swap table entries, see mm/swap_table.h */ + atomic_long_t __rcu *table; /* Swap table entries, ...
8b47299a411a178d572aaac31ff7ab33a8bd27e2
Analyze and fix the following issue in the Linux kernel code: mm, swap: mark swap address space ro and add context debug check
Problem Details: Swap cache is now backed by swap table, and the address space is not holding any mutable data anymore. And swap cache is now protected by the swap cluster lock, instead of the XArray lock. All access to swap cache are wrapped by swap cache helpers. Locking is mostly handled internally by swap cache ...
```diff diff --git a/mm/swap.h b/mm/swap.h index 742db4d46d23..adcd85fa8538 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -99,6 +99,16 @@ static __always_inline struct swap_cluster_info *__swap_cluster_lock( { struct swap_cluster_info *ci = __swap_offset_to_cluster(si, offset); + /* + * Nothing modifies swap cache in...
094dc8b059b11eef0888f43eeb0f3ac53ade5c87
Analyze and fix the following issue in the Linux kernel code: mm, swap: wrap swap cache replacement with a helper
Problem Details: There are currently three swap cache users that are trying to replace an existing folio with a new one: huge memory splitting, migration, and shmem replacement. What they are doing is quite similar. Introduce a common helper for this. In later commits, this can be easily switched to use the swap tab...
```diff diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 26cedfcd7418..4c66e358685b 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -3798,9 +3798,7 @@ static int __folio_split(struct folio *folio, unsigned int new_order, * NOTE: shmem in swap cache is not supported yet. */ if (swap_cache) { ...
84a7a9823e73fe3c0adcc4780fa7a091981048ef
Analyze and fix the following issue in the Linux kernel code: mm/shmem, swap: remove redundant error handling for replacing folio
Problem Details: Shmem may replace a folio in the swap cache if the cached one doesn't fit the swapin's GFP zone. When doing so, shmem has already double checked that the swap cache folio is locked, still has the swap cache flag set, and contains the wanted swap entry. So it is impossible to fail due to an XArray mis...
```diff diff --git a/mm/shmem.c b/mm/shmem.c index 077744a9e9da..dc17717e5631 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2121,35 +2121,17 @@ static int shmem_replace_folio(struct folio **foliop, gfp_t gfp, /* Swap cache still stores N entries instead of a high-order entry */ xa_lock_irq(&swap_mapping->i_pages); ...
0fcf8ef4fdab8e5c91d1bce39c7fe6565974ffad
Analyze and fix the following issue in the Linux kernel code: mm, swap: tidy up swap device and cluster info helpers
Problem Details: swp_swap_info is the most commonly used helper for retrieving swap info. It has an internal check that may lead to a NULL return value, but almost none of its caller checks the return value, making the internal check pointless. In fact, most of these callers already ensured the entry is valid and nev...
```diff diff --git a/include/linux/swap.h b/include/linux/swap.h index 78cc48a65512..762f8db0e811 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -479,7 +479,6 @@ extern sector_t swapdev_block(int, pgoff_t); extern int __swap_count(swp_entry_t entry); extern bool swap_entry_swapped(struct swap_info_st...
4522aed4fffbbd18ab3581d733d0572d45780d07
Analyze and fix the following issue in the Linux kernel code: mm, swap: rename and move some swap cluster definition and helpers
Problem Details: No feature change, move cluster related definitions and helpers to mm/swap.h, also tidy up and add a "swap_" prefix for cluster lock/unlock helpers, so they can be used outside of swap files. And while at it, add kerneldoc. Link: https://lkml.kernel.org/r/20250916160100.31545-7-ryncsn@gmail.com Signe...
```diff diff --git a/include/linux/swap.h b/include/linux/swap.h index a2bb20841616..78cc48a65512 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -235,40 +235,6 @@ enum { /* Special value in each swap_map continuation */ #define SWAP_CONT_MAX 0x7f /* Max count */ -/* - * We use this to track usage o...
3518b931df0cc57b1b97e5c3a307ad7d5fe17650
Analyze and fix the following issue in the Linux kernel code: mm, swap: check page poison flag after locking it
Problem Details: Instead of checking the poison flag only in the fast swap cache lookup path, always check the poison flags after locking a swap cache folio. There are two reasons to do so. The folio is unstable and could be removed from the swap cache anytime, so it's totally possible that the folio is no longer the...
```diff diff --git a/mm/memory.c b/mm/memory.c index 10ef528a5f44..94a5928e8ace 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4661,10 +4661,8 @@ vm_fault_t do_swap_page(struct vm_fault *vmf) goto out; folio = swap_cache_get_folio(entry); - if (folio) { + if (folio) swap_update_readahead(folio, vma, vmf->addr...
a733d8de7f1ccbf093ce2fde424616e529073876
Analyze and fix the following issue in the Linux kernel code: mm, swap: fix swap cache index error when retrying reclaim
Problem Details: The allocator will reclaim cached slots while scanning. Currently, it will try again if reclaim found a folio that is already removed from the swap cache due to a race. But the following lookup will be using the wrong index. It won't cause any OOB issue since the swap cache index is truncated upon l...
```diff diff --git a/mm/swapfile.c b/mm/swapfile.c index 4b8ab2cb49ca..4baebd8b48f4 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -212,7 +212,7 @@ static bool swap_is_last_map(struct swap_info_struct *si, static int __try_to_reclaim_swap(struct swap_info_struct *si, unsigned long offset, unsigned long flags)...
4805ef3707608e04477caeba6a8a0de04d1d77b5
Analyze and fix the following issue in the Linux kernel code: mm/page_alloc: check the correct buddy if it is a starting block
Problem Details: find_large_buddy() search buddy based on start_pfn, which maybe different from page's pfn, e.g. when page is not pageblock aligned, because prep_move_freepages_block() always align start_pfn to pageblock. This means when we found a starting block at start_pfn, it may check on the wrong page theoretic...
```diff diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 8de5fb5528eb..df6df302d0c5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2090,9 +2090,10 @@ static inline void toggle_pageblock_isolate(struct page *page, bool isolate) static bool __move_freepages_block_isolate(struct zone *zone, struct page *pa...
5ce1dbfdd8e3d4dca2f842dd833ca7e264ace85b
Analyze and fix the following issue in the Linux kernel code: mm/hwpoison: decouple hwpoison_filter from mm/memory-failure.c
Problem Details: mm/memory-failure.c defines and uses hwpoison_filter_* parameters but the values of those parameters can only be modified via mm/hwpoison-inject.c from userspace. They have a potentially different life time. Decouple those parameters from mm/memory-failure.c to fix this broken layering. Link: https:...
```diff diff --git a/fs/proc/page.c b/fs/proc/page.c index 771e0b6bc630..fc64f23e05e5 100644 --- a/fs/proc/page.c +++ b/fs/proc/page.c @@ -256,6 +256,7 @@ u64 stable_page_flags(const struct page *page) return u; } +EXPORT_SYMBOL_GPL(stable_page_flags); /* /proc/kpageflags - an array exposing page flags * diff...
0d0e03d5b83ea481801783906d230b2ad591d8c1
Analyze and fix the following issue in the Linux kernel code: selftests/mm: split_huge_page_test: fix occasional is_backed_by_folio() wrong results
Problem Details: Patch series "selftests/mm: split_huge_page_test: split_pte_mapped_thp improvements", v2. One fix for occasional failures I found while testing and a bunch of cleanups that should make that test easier to digest. This patch (of 2): When checking for actual tail or head pages of a folio, we must mak...
```diff diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index 10ae65ea032f..72d6d8bb329e 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -44,6 +44,8 @@ int kpageflags_fd; static ...
69e0a3b490030d8d9e628ea69bdb3ff0010a0bb7
Analyze and fix the following issue in the Linux kernel code: mm: shmem: fix the strategy for the tmpfs 'huge=' options
Problem Details: After commit acd7ccb284b8 ("mm: shmem: add large folio support for tmpfs"), we have extended tmpfs to allow any sized large folios, rather than just PMD-sized large folios. The strategy discussed previously was: : Considering that tmpfs already has the 'huge=' option to control the : PMD-sized large ...
```diff diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst index a16a04841b96..1654211cc6cf 100644 --- a/Documentation/admin-guide/mm/transhuge.rst +++ b/Documentation/admin-guide/mm/transhuge.rst @@ -419,6 +419,8 @@ option: ``huge=``. It can have following values: a...
01422da19cbeb4b044649322968265464991368e
Analyze and fix the following issue in the Linux kernel code: rust: maple_tree: add lock guard for maple tree
Problem Details: To load a value, one must be careful to hold the lock while accessing it. To enable this, we add a lock() method so that you can perform operations on the value before the spinlock is released. This adds a MapleGuard type without using the existing SpinLock type. This ensures that the MapleGuard typ...
```diff diff --git a/rust/kernel/maple_tree.rs b/rust/kernel/maple_tree.rs index 319772878b89..7acb8478d1d9 100644 --- a/rust/kernel/maple_tree.rs +++ b/rust/kernel/maple_tree.rs @@ -213,6 +213,23 @@ impl<T: ForeignOwnable> MapleTree<T> { unsafe { T::try_from_foreign(ret) } } + /// Lock the internal ...
da939ef4c494246bc2102ecb628bbcc71d650410
Analyze and fix the following issue in the Linux kernel code: rust: maple_tree: add MapleTree
Problem Details: Patch series "Add Rust abstraction for Maple Trees", v3. This will be used in the Tyr driver [1] to allocate from the GPU's VA space that is not owned by userspace, but by the kernel, for kernel GPU mappings. Danilo tells me that in nouveau, the maple tree is used for keeping track of "VM regions" on...
```diff diff --git a/MAINTAINERS b/MAINTAINERS index a7e123ddf05a..68d29f0220fc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14672,6 +14672,8 @@ F: net/mctp/ MAPLE TREE M: Liam R. Howlett <Liam.Howlett@oracle.com> +R: Alice Ryhl <aliceryhl@google.com> +R: Andrew Ballance <andrewjballance@gmail.com> L: maple-tree...