id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
5ce9ac1531b8e27e754a7d17fa07fa9da0d4a6b3
Analyze and fix the following issue in the Linux kernel code: drm/i915/mst: Call intel_pfit_compute_config() for sharpness filter
Problem Details: The sharpness filter property is on the CRTC (as opposed to the connector) so the expectation is that it's usable on all output types. Since the sharpness filter is now fully integrateds into the normal pfit code intel_pfit_compute_config() must be called from the encoder .compute_config() on all relev...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index bcdc50491347..0aa3e6b4c781 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -722,6 +722,10 @@ static int mst_stream_compute_config(struct inte...
fad156c2af227f42ca796cbb20ddc354a6dd9932
Analyze and fix the following issue in the Linux kernel code: block: invalidate cached plug timestamp after task switch
Problem Details: blk_time_get_ns() caches ktime_get_ns() in current->plug->cur_ktime and marks the task with PF_BLOCK_TS. That cache is only valid while the task keeps running; if the task is switched out, wall-clock time advances and the cached value must not be reused when the task runs again. The existing invalidat...
```diff diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 5070851cf924..9213a5716f95 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1222,16 +1222,12 @@ static inline void blk_flush_plug(struct blk_plug *plug, bool async) __blk_flush_plug(plug, async); } -/* - * tsk == curren...
fd38b75c4b43295b10d69772a46d1c74dbd6fc81
Analyze and fix the following issue in the Linux kernel code: kernel/fork: clear PF_BLOCK_TS in copy_process()
Problem Details: PF_BLOCK_TS is only set in blk_time_get_ns() when current->plug is non-NULL, and blk_finish_plug() clears it via __blk_flush_plug() before NULLing the plug pointer. copy_process() breaks the invariant by inheriting PF_BLOCK_TS from the parent while resetting the child's plug to NULL. Clear PF_BLOCK_T...
```diff diff --git a/kernel/fork.c b/kernel/fork.c index addc555a1077..1fafcb9bb047 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -2337,6 +2337,7 @@ __latent_entropy struct task_struct *copy_process( #ifdef CONFIG_BLOCK p->plug = NULL; + p->flags &= ~PF_BLOCK_TS; #endif futex_init_task(p); ```
1fe703cc708f19209ae8e6261247483db723c221
Analyze and fix the following issue in the Linux kernel code: io_uring/register: preserve SQ array entries on resize
Problem Details: Ring resizing copies pending SQEs from the old SQE array into the new one so submissions queued before the resize can still be consumed afterwards. That copy currently walks the SQ head/tail range directly. This is only correct when there is no SQ array indirection. With a regular SQ array, each pendi...
```diff diff --git a/io_uring/register.c b/io_uring/register.c index dce5e2f9cf77..02bc103bcc9d 100644 --- a/io_uring/register.c +++ b/io_uring/register.c @@ -503,6 +503,7 @@ static int io_register_resize_rings(struct io_ring_ctx *ctx, void __user *arg) unsigned i, tail, old_head; struct io_uring_params *p = &confi...
9cbbac29d752fb5d95e375fa3685a359b89caa0a
Analyze and fix the following issue in the Linux kernel code: block: Remove redundant plug in __submit_bio()
Problem Details: The patch removes the automatic plug/unplug operations from __submit_bio() that were added to cache nsecs time when no explicit plug is used. The plug mechanism is most effective when batching multiple I/O operations together. Creating a plug for every bio submission provides minimal benefit while add...
```diff diff --git a/block/blk-core.c b/block/blk-core.c index 73a41df98c9a..365641266c9e 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -669,11 +669,6 @@ static inline blk_status_t blk_check_zone_append(struct request_queue *q, static void __submit_bio(struct bio *bio) { - /* If plug is not used, add new ...
4f919141be38ea2b1314e3a531b7b998eb64e8bc
Analyze and fix the following issue in the Linux kernel code: block: fix IORING_URING_CMD_REISSUE flags check in blkdev_uring_cmd
Problem Details: blkdev_uring_cmd() checks IORING_URING_CMD_REISSUE to determine whether this is the first issue. However, this flag lives in cmd->flags instead of issue_flags. Coincidentally, IO_URING_F_NONBLOCK shares bit 31 with IORING_URING_CMD_REISSUE. As a result, the SQE read was never performed, bic->len remai...
```diff diff --git a/block/ioctl.c b/block/ioctl.c index ab2c9ed79946..3d4ea1537457 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -951,7 +951,7 @@ int blkdev_uring_cmd(struct io_uring_cmd *cmd, unsigned int issue_flags) u32 cmd_op = cmd->cmd_op; /* Read what we need from the SQE on the first issue */ - if (!(...
79511603a65b990bed675eb4bcfd85305d3ff42a
Analyze and fix the following issue in the Linux kernel code: tls: remove dead sockmap (psock) handling from the SW path
Problem Details: TLS and sockmap are now mutually exclusive. Try to delete the code from sendmsg and recvmsg path which is now obviously dead. The main goal is to delete enough code for AI security scanners to no longer bother us with sockmap related bugs. At the same time retain the code in case someone has the cycle...
```diff diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h index 19f4f253b4f9..ca0ec9c8608e 100644 --- a/include/linux/skmsg.h +++ b/include/linux/skmsg.h @@ -544,15 +544,6 @@ static inline void psock_progs_drop(struct sk_psock_progs *progs) psock_set_prog(&progs->skb_verdict, NULL); } -int sk_psock_tls_st...
bdc2fc388c348ee14b4f984ff75f2ea440cefd44
Analyze and fix the following issue in the Linux kernel code: io_uring, audit: don't log IORING_OP_RECV_ZC
Problem Details: IORING_OP_RECV_ZC is a read operation. Audit only tracks file/socket creation, not subsequent reads. Set audit_skip to align with audit-userspace uringop_table.h. Fixes: 11ed914bbf94 ("io_uring/zcrx: add io_recvzc request") Suggested-by: Steve Grubb <sgrubb@redhat.com> Signed-off-by: Ricardo Robaina <...
```diff diff --git a/io_uring/opdef.c b/io_uring/opdef.c index 88a45c7d897f..4e58eb1344ea 100644 --- a/io_uring/opdef.c +++ b/io_uring/opdef.c @@ -520,6 +520,7 @@ const struct io_issue_def io_issue_defs[] = { #endif }, [IORING_OP_RECV_ZC] = { + .audit_skip = 1, .needs_file = 1, .unbound_nonreg_file = 1, ...
87267803a8c824616eb147c5dad7030a5db6f878
Analyze and fix the following issue in the Linux kernel code: RDMA/bnxt_re: Proper rollback if the ioremap fails
Problem Details: bnxt_qplib_alloc_dpi returns success even if ioremap fails. Add the proper rollback when the ioremap fails and return -ENOMEM status. Fixes: 0ac20faf5d83 ("RDMA/bnxt_re: Reorg the bar mapping") Fixes: 360da60d6c6e ("RDMA/bnxt_re: Enable low latency push") Link: https://patch.msgid.link/r/2026061522475...
```diff diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.c b/drivers/infiniband/hw/bnxt_re/qplib_res.c index 95e0489c53c3..756f8b5f042a 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_res.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.c @@ -764,9 +764,13 @@ int bnxt_qplib_alloc_dpi(struct bnxt_qplib_res *res, ...
dc95931b7e1326dacae547874bf38c092e5960d8
Analyze and fix the following issue in the Linux kernel code: RDMA/bnxt_re: Add a max slot check for SQ
Problem Details: The variable WQE mode must be validated against the maximum slots supported by HW. The max supported value is 64K. Adding a max and min check and fail if user supplied value is more than the max supported and zero. Fixes: d8ea645d6984 ("RDMA/bnxt_re: Handle variable WQE support for user applications")...
```diff diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index 35905ae7d168..c3570bf0204f 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -1748,6 +1748,9 @@ static int bnxt_re_init_qp_attr(struct bnxt_re_qp *qp, stru...
7d70c704a06f620d5d421ab76bac5e225bfb4308
Analyze and fix the following issue in the Linux kernel code: RDMA/bnxt_re: Avoid displaying the kernel pointer
Problem Details: While dumping the info on MR using the rdma tool, we dump the mr_hwq which is a kernel pointer. There is no need to expose this value for end user. So avoid it. Fixes: 7363eb76b7f3 ("RDMA/bnxt_re: Support driver specific data collection using rdma tool") Link: https://patch.msgid.link/r/20260615224751...
```diff diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index a892f1172917..d25fdc458120 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -1093,8 +1093,6 @@ static int bnxt_re_fill_res_mr_entry(struct sk_buff *msg, struct ib_mr *ib_...
bb45e06f9914ca64ac95341a80a0c20bb8dd46a9
Analyze and fix the following issue in the Linux kernel code: RDMA/bnxt_re: Free CQ toggle page after firmware teardown
Problem Details: Free the toggle page only after firmware teardown completes so that an NQ interrupt arriving during bnxt_qplib_destroy_cq() won't write the toggle value to an already-freed page. Move free_page() after bnxt_qplib_destroy_cq. Fixes: e275919d9669 ("RDMA/bnxt_re: Share a page to expose per CQ info with u...
```diff diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index e48ae2e62be8..35905ae7d168 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -3472,11 +3472,11 @@ int bnxt_re_destroy_cq(struct ib_cq *ib_cq, struct ib_uda...
131e2918b9b0529687e67e2e58047304027f095a
Analyze and fix the following issue in the Linux kernel code: RDMA/bnxt_re: Free SRQ toggle page after firmware teardown
Problem Details: Free the toggle page only after firmware teardown completes so that an NQ interrupt arriving during bnxt_qplib_destroy_srq() won't write the toggle values to an already-freed page. Move free_page() after bnxt_qplib_destroy_srq(). Fixes: 181028a0d84c ("RDMA/bnxt_re: Share a page to expose per SRQ info ...
```diff diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index 13e765f10db1..e48ae2e62be8 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -2149,11 +2149,11 @@ int bnxt_re_destroy_srq(struct ib_srq *ib_srq, struct ib_...
978b27d6ce538bb832ccd69e45802824e4301c4b
Analyze and fix the following issue in the Linux kernel code: RDMA/bnxt_re: Initialize dpi variable to zero
Problem Details: dpi is initialized only for BNXT_RE_ALLOC_WC_PAGE, but copied for all the cases. So initialize the dpi to 0. Fixes: eee6268421a2 ("RDMA/bnxt_re: Move the UAPI methods to a dedicated file") Fixes: 360da60d6c6e ("RDMA/bnxt_re: Enable low latency push") Link: https://patch.msgid.link/r/20260615224751.232...
```diff diff --git a/drivers/infiniband/hw/bnxt_re/uapi.c b/drivers/infiniband/hw/bnxt_re/uapi.c index 9e68b4a7e952..b9922360f11b 100644 --- a/drivers/infiniband/hw/bnxt_re/uapi.c +++ b/drivers/infiniband/hw/bnxt_re/uapi.c @@ -76,8 +76,8 @@ static int UVERBS_HANDLER(BNXT_RE_METHOD_ALLOC_PAGE)(struct uverbs_attr_bundle ...
9108f7fa493b4c88cbc09503e0c164244456bad5
Analyze and fix the following issue in the Linux kernel code: regcache: Do not overwrite error code when finalizing cache after error
Problem Details: During regcache initialization, if an error occurs in the cache_ops->populate callback, and if cache operations include an exit callback, the error code from populate() is overwritten with the return value from exit(). This hides the error condition from the caller of regcache_init(), and can cause NUL...
```diff diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index 27616b05111c..aa8f2efed779 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c @@ -245,7 +245,7 @@ err_exit: if (map->cache_ops->exit) { dev_dbg(map->dev, "Destroying %s cache\n", map->cache_ops-...
e43f32816a1b1fe5a86279411626fe3a9be56d45
Analyze and fix the following issue in the Linux kernel code: i2c: davinci: Unregister cpufreq notifier on probe failure
Problem Details: davinci_i2c_probe() registers a cpufreq transition notifier before adding the I2C adapter. If i2c_add_numbered_adapter() fails, the probe error path releases the device resources without unregistering the notifier. Add a dedicated error path to unregister the cpufreq notifier after i2c_add_numbered_a...
```diff diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index 66c23535656b..0617f416cb0b 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -818,12 +818,14 @@ static int davinci_i2c_probe(struct platform_device *pdev) adap->nr = pdev->id; r = i2c...
c554246ff4c68abf71b61a89c6e39d3cf94f523e
Analyze and fix the following issue in the Linux kernel code: io_uring/rw: preserve partial result for iopoll
Problem Details: A partial read will store the completed byte count in io->bytes_done. The regular completion path applies io_fixup_rw_res() so that, when the following operation reaches EOF, the number of bytes already read is returned. The iopoll completion path does not apply this fixup to the return value and can ...
```diff diff --git a/io_uring/rw.c b/io_uring/rw.c index 0c4834645279..63b6519e498c 100644 --- a/io_uring/rw.c +++ b/io_uring/rw.c @@ -601,15 +601,15 @@ static void io_complete_rw_iopoll(struct kiocb *kiocb, long res) { struct io_rw *rw = container_of(kiocb, struct io_rw, kiocb); struct io_kiocb *req = cmd_to_io_k...
2564ca2e31bd8ee8348362941af2ee4671e487ca
Analyze and fix the following issue in the Linux kernel code: io_uring/nop: fix file reference leak with IOSQE_FIXED_FILE
Problem Details: NOP file-acquisition support choses between a fixed (registered) file and a normal fget()'d file based on its own IORING_NOP_FIXED_FILE flag in sqe->nop_flags. However, a request's REQ_F_FIXED_FILE is set independently from the generic IOSQE_FIXED_FILE sqe flag during request init, before the issue han...
```diff diff --git a/io_uring/nop.c b/io_uring/nop.c index 91ae0b2e7e55..60ab19604b36 100644 --- a/io_uring/nop.c +++ b/io_uring/nop.c @@ -40,6 +40,8 @@ int io_nop_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) nop->fd = READ_ONCE(sqe->fd); else nop->fd = -1; + if (nop->flags & IORING_NOP_FIXED_FILE...
42f252f5a646866a95f025863c8b201042494ba1
Analyze and fix the following issue in the Linux kernel code: powerpc/fadump: define MIN_RMA in bytes rather than MB
Problem Details: The MIN_RMA size checks in fadump_setup_param_area() use (MIN_RMA * 1024 * 1024), which is evaluated in int and can overflow when MIN_RMA is increased to values such as SZ_2G, triggering compiler warnings such as: warning: integer overflow in expression of type 'int' results in '0' [-Woverflow] Defin...
```diff diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h index f679a11a7e7f..f4991d10d89e 100644 --- a/arch/powerpc/include/asm/prom.h +++ b/arch/powerpc/include/asm/prom.h @@ -12,12 +12,14 @@ * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp. */ #include <linux/types...
4e1187e12de40b5301977b2476d21b569358dafb
Analyze and fix the following issue in the Linux kernel code: powerpc: Restore KUAP registers on syscall restart exit
Problem Details: During a syscall restart, block KUAP so that pending interrupts can be replayed. The original KUAP state is not restored before returning to userspace, causing subsequent userspace accesses to fault and eventually trigger bad_access_pkey(), crashing the kernel. The original KUAP register values are al...
```diff diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c index 89a999be1352..f04978080837 100644 --- a/arch/powerpc/kernel/interrupt.c +++ b/arch/powerpc/kernel/interrupt.c @@ -166,6 +166,7 @@ again: goto again; } + kuap_user_restore(regs); regs->exit_result |= regs->exit_flags; ...
0482862a90169f4daaba0ed31a85d8304bf51e04
Analyze and fix the following issue in the Linux kernel code: gpio: mlxbf3: fail probe if gpiochip registration fails
Problem Details: mlxbf3_gpio_probe() logs a devm_gpiochip_add_data() failure but still returns success. That leaves the platform device bound even though the GPIO chip was not registered. Return the registration error so probe failure matches the missing gpiochip state. Fixes: cd33f216d241 ("gpio: mlxbf3: Add gpio dr...
```diff diff --git a/drivers/gpio/gpio-mlxbf3.c b/drivers/gpio/gpio-mlxbf3.c index 4770578269ba..566326644a2c 100644 --- a/drivers/gpio/gpio-mlxbf3.c +++ b/drivers/gpio/gpio-mlxbf3.c @@ -255,7 +255,8 @@ static int mlxbf3_gpio_probe(struct platform_device *pdev) ret = devm_gpiochip_add_data(dev, gc, gs); if (ret) ...
66725039f7090afe14c31bd259e2059a68f04023
Analyze and fix the following issue in the Linux kernel code: Input: mms114 - reject an oversized device packet size
Problem Details: mms114_interrupt() reads a packet of touch data from the device into a fixed-size on-stack buffer struct mms114_touch touch[MMS114_MAX_TOUCH]; which holds MMS114_MAX_TOUCH (10) events of MMS114_EVENT_SIZE (8) bytes, i.e. 80 bytes. The length of the I2C read into it is taken verbatim from the device:...
```diff diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c index 9597214d9d3c..4d748a13408d 100644 --- a/drivers/input/touchscreen/mms114.c +++ b/drivers/input/touchscreen/mms114.c @@ -226,6 +226,12 @@ static irqreturn_t mms114_interrupt(int irq, void *dev_id) if (packet_size <= 0) ...
72dfa4700f78a6d79300cb8a1a600791795232de
Analyze and fix the following issue in the Linux kernel code: net: dsa: sja1105: fix lastused timestamp in flower stats
Problem Details: flow_stats_update() takes an absolute timestamp for lastused, not delta. Fix that. Signed-off-by: David Yang <mmyangfl@gmail.com> Link: https://patch.msgid.link/20260614141320.1133321-1-mmyangfl@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
```diff diff --git a/drivers/net/dsa/sja1105/sja1105_vl.c b/drivers/net/dsa/sja1105/sja1105_vl.c index 0ae9cb5ea8d1..e6ba9d4f8d1e 100644 --- a/drivers/net/dsa/sja1105/sja1105_vl.c +++ b/drivers/net/dsa/sja1105/sja1105_vl.c @@ -791,8 +791,7 @@ int sja1105_vl_stats(struct sja1105_private *priv, int port, pkts = timinge...
bc5c25c8f684982d0363380e3490f626c68e0427
Analyze and fix the following issue in the Linux kernel code: selftests/net: Move netkit lease hw setup into per-test fixtures
Problem Details: The HW counterpart of nk_qlease.py was carrying its lease setup in main() and stashing src_queue / nk_queue / nk_*_ifname on cfg, which had drawbacks called out during the review at [0]. This is the deferred half of the cleanup that landed in commit e254ffb9502c ("selftests/net: Split netdevsim tests ...
```diff diff --git a/tools/testing/selftests/drivers/net/hw/nk_qlease.py b/tools/testing/selftests/drivers/net/hw/nk_qlease.py index f5fd64775989..3723574dcd30 100755 --- a/tools/testing/selftests/drivers/net/hw/nk_qlease.py +++ b/tools/testing/selftests/drivers/net/hw/nk_qlease.py @@ -18,8 +18,10 @@ from lib.py import...
66aefc277ebb796ec285d550305535dc3fc0179f
Analyze and fix the following issue in the Linux kernel code: scsi: xen: scsiback: Free the command tag on the TMR submit-failure path
Problem Details: scsiback_device_action() obtains a command tag in scsiback_get_pend_req() and submits a task-management request with target_submit_tmr(). When target_submit_tmr() fails it returns < 0 and scsiback jumps to the err: label, which sends a response but frees nothing, leaking the tag. Impact: a pvSCSI gues...
```diff diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index f324732eba7f..c7036e0e41bd 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c @@ -658,7 +658,7 @@ static void scsiback_device_action(struct vscsibk_pend *pending_req, return; err: - scsiback_do_resp_with_sense(...
ca978f8a93d4d36841839bf2847d29b88c2591d6
Analyze and fix the following issue in the Linux kernel code: scsi: xen: scsiback: Free unsubmitted command instead of double-putting it
Problem Details: scsiback_get_pend_req() obtains a command tag and returns a vscsibk_pend whose embedded se_cmd has only been memset to 0, so its cmd_kref is 0; the se_cmd is initialised (kref_init() via target_init_cmd()) only later, in scsiback_cmd_exec(), on the successful VSCSIIF_ACT_SCSI_CDB path. The two error pa...
```diff diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index e33f95c91b09..f324732eba7f 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c @@ -611,6 +611,25 @@ static void scsiback_disconnect(struct vscsibk_info *info) xenbus_unmap_ring_vfree(info->dev, info->ring.sring); ...
542e88a4c6f7b6edd1326ce767d4cb3c2ea9d61d
Analyze and fix the following issue in the Linux kernel code: perf cs-etm: Reject CPU IDs that would overflow signed comparison
Problem Details: metadata[j][CS_ETM_CPU] is a u64 from perf.data, but the comparison with max_cpu casts it to (int). A crafted value like 0xFFFFFFFF becomes -1 after the cast, which compares less than max_cpu (0), so the queue array is never sized to accommodate it. When the value is later passed to cs_etm__get_queue...
```diff diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 5e92359f51a7..0927b0b9c06b 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -6,6 +6,7 @@ * Author: Mathieu Poirier <mathieu.poirier@linaro.org> */ +#include <limits.h> #include <linux/bitfield.h> #include <linu...
4a7500d772fe59653053db22ca83c9e2232b22e1
Analyze and fix the following issue in the Linux kernel code: perf c2c: Free format list entries when releasing c2c hist entries
Problem Details: c2c_hists__init() calls hpp_list__parse() which allocates and registers format entries on hists->list. When c2c_he_free() destroys a c2c hist entry, it deletes the histogram entries and frees the hists container but never unregisters the format list entries, leaking them. Call perf_hpp__reset_output_...
```diff diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index e205f58b2f3d..07c7e8fb315e 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -185,6 +185,7 @@ static void c2c_he_free(void *he) c2c_he = container_of(he, struct c2c_hist_entry, he); if (c2c_he->hists) { hists__de...
033e85edfbf271f92979d2a39aeaf40f8472a795
Analyze and fix the following issue in the Linux kernel code: perf bpf: Bounds-check array offsets in bpil_offs_to_addr()
Problem Details: bpil_offs_to_addr() converts offsets stored in perf.data's bpf_prog_info_linear structure into heap pointers by adding the offset to the data allocation base. The offsets come from untrusted file input and are not validated against data_len. If an offset exceeds data_len, the computed address points ...
```diff diff --git a/tools/perf/util/bpf-utils.c b/tools/perf/util/bpf-utils.c index d6d2c9c190f7..69148197b1ef 100644 --- a/tools/perf/util/bpf-utils.c +++ b/tools/perf/util/bpf-utils.c @@ -264,12 +264,28 @@ void bpil_offs_to_addr(struct perf_bpil *info_linear) for (i = PERF_BPIL_FIRST_ARRAY; i < PERF_BPIL_LAST_ARRA...
2d6ea0875093da9033fcb62c09a9e2f1de49fe91
Analyze and fix the following issue in the Linux kernel code: perf bpf: Reject oversized BPF metadata events that truncate header.size
Problem Details: bpf_metadata_alloc() computes event_size from the number of BPF metadata variables and stores it in header.size, which is __u16. With 204 or more .rodata variables prefixed "bpf_metadata_", event_size exceeds 65535 and silently truncates. The truncated header.size causes synthesize_perf_record_bpf_me...
```diff diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c index fe6fbca508c5..57d53ba84835 100644 --- a/tools/perf/util/bpf-event.c +++ b/tools/perf/util/bpf-event.c @@ -369,6 +369,15 @@ static struct bpf_metadata *bpf_metadata_alloc(__u32 nr_prog_tags, event_size = sizeof(metadata->event->bpf_...
10b3c3d63ecc17c6acb855bac5f40367f1115765
Analyze and fix the following issue in the Linux kernel code: perf bpf: Validate func_info_rec_size and sub_id in synthesize_bpf_prog_name()
Problem Details: synthesize_bpf_prog_name() computes a pointer into the func_info array using sub_id * info->func_info_rec_size without validating either value. Both come from perf.data and are untrusted: - A func_info_rec_size smaller than sizeof(struct bpf_func_info) means the finfo pointer would reference a trunc...
```diff diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c index c4594969d767..fe6fbca508c5 100644 --- a/tools/perf/util/bpf-event.c +++ b/tools/perf/util/bpf-event.c @@ -143,7 +143,9 @@ static int synthesize_bpf_prog_name(char *buf, int size, name_len = scnprintf(buf, size, "bpf_prog_"); name_l...
500f5dd0a8b6f7bd174102587c7dff5a7d2fecbf
Analyze and fix the following issue in the Linux kernel code: perf sched: Replace (void*)1 sentinel with proper runtime allocation
Problem Details: map__findnew_thread() marks color-pid threads by storing (void*)1 as the thread private data via thread__set_priv(). This sentinel value causes two problems: 1. thread__get_runtime() returns (void*)1 as a struct thread_runtime pointer. Any field access (e.g. tr->shortname) dereferences address ...
```diff diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 5f16caebd964..7fd63a9db457 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -274,6 +274,7 @@ struct thread_runtime { u64 migrations; int prio; + bool color; }; /* per event run time data */ @@ -1589,2...
cfafef390ca9c753b34c7e97b5abee4cab0ce270
Analyze and fix the following issue in the Linux kernel code: perf hwmon: Fix fd check to accept fd 0 in hwmon_pmu__describe_items()
Problem Details: hwmon_pmu__describe_items() checks 'if (fd > 0)' after openat(), which incorrectly rejects fd 0. While fd 0 is normally stdin, if stdin has been closed (common in daemon/service contexts), the kernel reuses fd 0 for the next open. With fd > 0, the sysfs file is not read and the fd is leaked. Change ...
```diff diff --git a/tools/perf/util/hwmon_pmu.c b/tools/perf/util/hwmon_pmu.c index efd3067a2e59..ed544dca70c3 100644 --- a/tools/perf/util/hwmon_pmu.c +++ b/tools/perf/util/hwmon_pmu.c @@ -435,7 +435,7 @@ static size_t hwmon_pmu__describe_items(struct hwmon_pmu *hwm, char *out_buf, si hwmon_item_strs[bit], is...
7b0df6f4d498b1608afccfd6dffb264e6da91693
Analyze and fix the following issue in the Linux kernel code: perf tools: Use snprintf() for root_dir path construction
Problem Details: get_kernel_version() in machine.c and dso__load_guest_kernel_sym() in symbol.c use sprintf() to construct paths by prepending root_dir to "/proc/version" and "/proc/kallsyms" respectively. Both write into PATH_MAX stack buffers, but root_dir comes from --guestmount or KVM configuration and is not leng...
```diff diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 1ea06fde14e0..31715366e29f 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1336,7 +1336,7 @@ static char *get_kernel_version(const char *root_dir) char *name, *tmp; const char *prefix = "Linux version "; - ...
d2c6069d68ee9d53b05fe38bc2049cc4286fbb16
Analyze and fix the following issue in the Linux kernel code: perf dso: Set error code when open() fails on uncompressed fallback path
Problem Details: filename__decompress() has an early return for files that are not actually compressed, where it calls open() directly. When open() fails, the function returns -1 but never sets *err. The caller chain (decompress_kmodule → dso__decompress_kmodule_path → dso__get_filename) then reads *dso__load_errno(d...
```diff diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index 511921bd901d..1a2fc6d18da7 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -344,9 +344,12 @@ int filename__decompress(const char *name, char *pathname, * descriptor to the uncompressed file. */ if (!compressions[comp].is_...
f973e52a99776fcc473488984828d1fce56d5382
Analyze and fix the following issue in the Linux kernel code: perf dso: Fix heap overflow in dso__get_filename() on decompressed path
Problem Details: dso__get_filename() allocates name with malloc(PATH_MAX), but the dso__filename_with_chroot() path replaces name with an asprintf'd exact-size string (e.g. 8 bytes for "/a/b.ko"). When the DSO needs decompression, dso__decompress_kmodule_path() writes the temp path ("/tmp/perf-kmod-XXXXXX", 22 bytes) ...
```diff diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index 5d0179758738..511921bd901d 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -603,8 +603,15 @@ static char *dso__get_filename(struct dso *dso, const char *root_dir, /* empty pathname means file wasn't actually compressed */ ...
063c647b24f640657d6d9e2e90d620ea3ee19ae6
Analyze and fix the following issue in the Linux kernel code: perf symbols: Break infinite loop on zero-filled notes in sysfs__read_build_id()
Problem Details: sysfs__read_build_id() iterates ELF note headers from sysfs files in a while(1) loop. If the file contains a zero-filled note header (both n_namesz and n_descsz are 0), the code computes n = namesz + descsz = 0 and calls read(fd, bf, 0). read() with count 0 returns 0, which matches the expected (ssiz...
```diff diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index c301c298ded9..39562bdec8b9 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -995,6 +995,9 @@ int sysfs__read_build_id(const char *filename, struct build_id *bid) } else { n = namesz + descsz; ...
2a3716544359d4312c81b0fa909a13301186da17
Analyze and fix the following issue in the Linux kernel code: perf symbols: Validate p_filesz before use in filename__read_build_id()
Problem Details: filename__read_build_id() stores ELF p_filesz in a ssize_t variable. A crafted 32-bit ELF with p_filesz = 0xFFFFFFFF produces ssize_t value -1. The comparison `p_filesz > buf_size` evaluates false because signed -1 is less than any non-negative buf_size, so the realloc is skipped and buf remains NULL....
```diff diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c index f4b0a711a62c..0a71d1463952 100644 --- a/tools/perf/util/symbol-minimal.c +++ b/tools/perf/util/symbol-minimal.c @@ -186,6 +186,9 @@ int filename__read_build_id(const char *filename, struct build_id *bid) continue; p_...
081b387c7397498c583b1ba7c2fdaf4c6da6b538
Analyze and fix the following issue in the Linux kernel code: perf symbols: Fix bswap copy-paste error for 32-bit ELF p_filesz
Problem Details: filename__read_build_id() byte-swaps 32-bit ELF program headers on cross-endian files, but line 178 passes p_offset to bswap_32() instead of p_filesz: hdrs.phdr32[i].p_filesz = bswap_32(hdrs.phdr32[i].p_offset); This clobbers p_filesz with the already-swapped p_offset value. The 64-bit path on lin...
```diff diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c index 091071d06416..f4b0a711a62c 100644 --- a/tools/perf/util/symbol-minimal.c +++ b/tools/perf/util/symbol-minimal.c @@ -175,7 +175,7 @@ int filename__read_build_id(const char *filename, struct build_id *bid) if (elf32) { ...
3277e605ac01fd11d0a7c6c68c617547ba66c87f
Analyze and fix the following issue in the Linux kernel code: ionic: Get "link_down_count" ext link stat from firmware
Problem Details: The number of times that link has gone down at the port level is tracked by the firmware and sent to the driver via regular DMA writes to an instance of struct ionic_port_status in the driver's memory. This statistic was never reported in favor of a driver-derived stat, but doing it in the driver was ...
```diff diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.c b/drivers/net/ethernet/pensando/ionic/ionic_dev.c index 3838c4a70766..648d9d24be85 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.c @@ -1076,3 +1076,13 @@ bool ionic_q_is_posted(struct ...
7678e69079c10b2fb10977f28f44ddb22971ea5b
Analyze and fix the following issue in the Linux kernel code: ionic: Fix check in ionic_get_link_ext_stats
Problem Details: The current check will fail if SR-IOV is not initialized for the physical function; this is because is_physfn is 0 if sriov_init() isn't run or fails. Change the check that prevents getting the link down count to use is_virtfn instead so that VFs don't get this functionality, which was the original int...
```diff diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c index 78a802eb159f..6069fa460913 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c @@ -116,8 +116,15 @@ static void ioni...
31e56112e6544afba0a50d60251175585ee62943
Analyze and fix the following issue in the Linux kernel code: dt-bindings: net: updated interrupt type to be active low, level triggered
Problem Details: According to OPEN Alliance 10BASE-T1x MACPHY Serial Interface (TC6) specification, interrupt type is active low, level triggered interrupt. Specification calls for when interrupt level will be asserted and what condition it is de-asserted. By using edge triggered interrupt, there is a potential chance...
```diff diff --git a/Documentation/devicetree/bindings/net/microchip,lan8650.yaml b/Documentation/devicetree/bindings/net/microchip,lan8650.yaml index 61e11d4a07c4..766ff58147ae 100644 --- a/Documentation/devicetree/bindings/net/microchip,lan8650.yaml +++ b/Documentation/devicetree/bindings/net/microchip,lan8650.yaml @...
a5a1d11dd3729146abe7420b874bab15870a42b4
Analyze and fix the following issue in the Linux kernel code: net: ethernet: oa_tc6: Remove FCS size in RX frame
Problem Details: OA TC6 MAC-PHY appends FCS to the incoming frame. It must be removed from the frame before being passed to the stack. With FCS in the frame, many applications, like ping or any application that uses IP layer may work as they may carry the packet size information in the protocol. Application like ptp4...
```diff diff --git a/drivers/net/ethernet/oa_tc6.c b/drivers/net/ethernet/oa_tc6.c index 477ceefde2c5..0727d53345a3 100644 --- a/drivers/net/ethernet/oa_tc6.c +++ b/drivers/net/ethernet/oa_tc6.c @@ -785,6 +785,17 @@ static int oa_tc6_process_rx_chunk_footer(struct oa_tc6 *tc6, u32 footer) static void oa_tc6_submit_r...
a221d3f7e3f3ea6a3b4bc511cf2a59242daa06e1
Analyze and fix the following issue in the Linux kernel code: net: ethernet: oa_tc6: mdiobus->parent initialized with NULL
Problem Details: As "dev" pointer in oa_tc6 structure is never initialized, mbiobus->parent was initialized with NULL. This change fixes it by initializing it with device pointer of spi. Fixes: 8f9bf857e43b ("net: ethernet: oa_tc6: implement internal PHY initialization") Signed-off-by: Selvamani Rajagopal <Selvamani....
```diff diff --git a/drivers/net/ethernet/oa_tc6.c b/drivers/net/ethernet/oa_tc6.c index f3ac2875adfb..477ceefde2c5 100644 --- a/drivers/net/ethernet/oa_tc6.c +++ b/drivers/net/ethernet/oa_tc6.c @@ -110,7 +110,6 @@ /* Internal structure for MAC-PHY drivers */ struct oa_tc6 { - struct device *dev; struct net_devic...
b542d13fab0f556660ce5f10179fb3ae66bdb9a4
Analyze and fix the following issue in the Linux kernel code: net: ethernet: oa_tc6: Interrupt is active low, level triggered.
Problem Details: According OPEN Alliance 10BASET1x MAC-PHY Serial Interface specification, interrupt is active low, level triggered. Code used edge triggered interrupt which has the risk of losing an interrupt on instances like when interrupt is disabled. Level triggered interrupt won't be deasserted unless handler ru...
```diff diff --git a/drivers/net/ethernet/oa_tc6.c b/drivers/net/ethernet/oa_tc6.c index 91a906a7918a..f3ac2875adfb 100644 --- a/drivers/net/ethernet/oa_tc6.c +++ b/drivers/net/ethernet/oa_tc6.c @@ -7,6 +7,7 @@ #include <linux/bitfield.h> #include <linux/iopoll.h> +#include <linux/interrupt.h> #include <linux/mdio...
f9691288413ceb4fc72f3ccc4d8e42adf66eb28d
Analyze and fix the following issue in the Linux kernel code: net: ti: icssg: Use undirected TX tag for XDP zero copy in HSR offload mode
Problem Details: emac_xsk_xmit_zc() has the same issue as the fixed emac_xmit_xdp_frame(): it always sets the CPPI5 descriptor destination tag to emac->port_id, which directs the PRU firmware to transmit on only one slave port in HSR mode, breaking redundancy. Apply the same fix: in HSR offload mode when NETIF_F_HW_HS...
```diff diff --git a/drivers/net/ethernet/ti/icssg/icssg_common.c b/drivers/net/ethernet/ti/icssg/icssg_common.c index ede32f266729..82ddef9c17d5 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_common.c +++ b/drivers/net/ethernet/ti/icssg/icssg_common.c @@ -105,6 +105,7 @@ static int emac_xsk_xmit_zc(struct prueth_ema...
bcbf73d98195577a89e788179843f6d0c66244a5
Analyze and fix the following issue in the Linux kernel code: net: ti: icssg: Use undirected TX tag for native XDP in HSR offload mode
Problem Details: emac_xmit_xdp_frame() always sets the CPPI5 descriptor destination tag to emac->port_id, which directs the PRU firmware to transmit the frame on that specific slave port only. In HSR offload mode this bypasses the firmware's HSR duplication logic: the frame goes out on one ring leg and never appears o...
```diff diff --git a/drivers/net/ethernet/ti/icssg/icssg_common.c b/drivers/net/ethernet/ti/icssg/icssg_common.c index 55a696912811..ede32f266729 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_common.c +++ b/drivers/net/ethernet/ti/icssg/icssg_common.c @@ -696,6 +696,7 @@ u32 emac_xmit_xdp_frame(struct prueth_emac *e...
dfb787f7d157f97ba91344b584d33481f572530e
Analyze and fix the following issue in the Linux kernel code: net: ti: icssg-prueth: Fix AF_XDP fill ring alloc and wakeup condition
Problem Details: emac_rx_packet_zc() calls prueth_rx_alloc_zc() with count (frames received in the current NAPI poll) as the allocation budget. Two problems arise from this: 1. When the CPPI5 descriptor pool is exhausted (avail_desc == 0, FDQ already holds the maximum number of descriptors), count > 0 still tri...
```diff diff --git a/drivers/net/ethernet/ti/icssg/icssg_common.c b/drivers/net/ethernet/ti/icssg/icssg_common.c index a28a608f9bf4..55a696912811 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_common.c +++ b/drivers/net/ethernet/ti/icssg/icssg_common.c @@ -927,6 +927,7 @@ static int emac_rx_packet_zc(struct prueth_em...
658eb696544cc0e39ef1d60795546e64f542604a
Analyze and fix the following issue in the Linux kernel code: tcp: rehash onto different local ECMP path on retransmit timeout
Problem Details: Currently sk_rethink_txhash() re-rolls the socket's txhash on RTO, PLB, and spurious-retransmission events, but the cached route is reused and the new hash is not propagated into the ECMP path selection logic. Two changes are needed to make rehash select a different local ECMP path: 1. Add __sk_dst_r...
```diff diff --git a/Documentation/networking/ip-sysctl.rst b/Documentation/networking/ip-sysctl.rst index 4c6a35d07a08..208f46967ee5 100644 --- a/Documentation/networking/ip-sysctl.rst +++ b/Documentation/networking/ip-sysctl.rst @@ -2444,7 +2444,11 @@ fib_multipath_hash_policy - INTEGER Possible values: - - 0 -...
b0d62ed164247b55dc39f4f9f668e6e8e067763c
Analyze and fix the following issue in the Linux kernel code: net: airoha: Fix MODULE_LICENSE to match SPDX GPL-2.0-only identifier
Problem Details: Both airoha_eth.c and airoha_npu.c declare SPDX-License-Identifier: GPL-2.0-only but use MODULE_LICENSE("GPL"), which the kernel module loader interprets as GPL-2.0+ (any GPL version). This mismatch causes license compliance tools (FOSSology, ScanCode, etc.) to misidentify the effective license as more...
```diff diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c index 25a698342300..01083e90d7e2 100644 --- a/drivers/net/ethernet/airoha/airoha_eth.c +++ b/drivers/net/ethernet/airoha/airoha_eth.c @@ -3710,6 +3710,6 @@ static struct platform_driver airoha_driver = { }; module...
a061dfb063fa03ed09cf21145ffff247cf94721a
Analyze and fix the following issue in the Linux kernel code: net: airoha: Fix typos in comments and Kconfig
Problem Details: Fix several typos found during code review: - Kconfig: "Aiorha" -> "Airoha" in NET_AIROHA_FLOW_STATS help text - Comment: "CMD1" -> "CDM1" (Central DMA, not Command) - Comments: "GMD1/2/3/4" -> "GDM1/2/3/4" (Gigabit DMA, not GMD) These are pure comment and documentation fixes with no functional impact...
```diff diff --git a/drivers/net/ethernet/airoha/Kconfig b/drivers/net/ethernet/airoha/Kconfig index ad3ce501e7a5..1f6640a15fc9 100644 --- a/drivers/net/ethernet/airoha/Kconfig +++ b/drivers/net/ethernet/airoha/Kconfig @@ -29,6 +29,6 @@ config NET_AIROHA_FLOW_STATS bool "Airoha flow stats" depends on NET_AIROHA && ...
c66f8511a8109fa50767941b26d3623e316fde02
Analyze and fix the following issue in the Linux kernel code: net: airoha: Fix always-true condition in PPE1 queue reservation loop
Problem Details: In airoha_fe_pse_ports_init(), the inner condition for PPE1 queue reservation is identical to the for-loop bound, making it always true and the else branch dead code: for (q = 0; q < pse_port_num_queues[FE_PSE_PORT_PPE1]; q++) { if (q < pse_port_num_queues[FE_PSE_PORT_PPE1]) /* always true */...
```diff diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c index 329988a8400c..7b8d0c5e262a 100644 --- a/drivers/net/ethernet/airoha/airoha_eth.c +++ b/drivers/net/ethernet/airoha/airoha_eth.c @@ -311,7 +311,7 @@ static void airoha_fe_pse_ports_init(struct airoha_eth *eth) ...
05173fa30add3787e7ab2e735c4ee00431994259
Analyze and fix the following issue in the Linux kernel code: net: airoha: Fix non-standard return value in airoha_ppe_get_wdma_info()
Problem Details: airoha_ppe_get_wdma_info() returns -1 when the last path in the forwarding path stack is not of type DEV_PATH_MTK_WDMA. This is not a standard kernel error code. Replace it with -EINVAL since the input path type is invalid from the caller's perspective. Signed-off-by: Wayen.Yan <win847@gmail.com> Acke...
```diff diff --git a/drivers/net/ethernet/airoha/airoha_ppe.c b/drivers/net/ethernet/airoha/airoha_ppe.c index 91bcc55a6ac6..0d42f82be77a 100644 --- a/drivers/net/ethernet/airoha/airoha_ppe.c +++ b/drivers/net/ethernet/airoha/airoha_ppe.c @@ -277,7 +277,7 @@ static int airoha_ppe_get_wdma_info(struct net_device *dev, c...
d9e4dd3c6f1fab3531d954c4ddedd7207402920b
Analyze and fix the following issue in the Linux kernel code: docs: net: fix minor issues with strparser docs
Problem Details: Not sure if anyone would read this doc, but the API has evolved since it was written. Update to: - show the int return type for strp_init() - refer to strp_data_ready(), not the old strp_tcp_data_ready() name - direct users to strp_msg(skb) for strparser metadata instead of treating skb->cb as struct...
```diff diff --git a/Documentation/networking/strparser.rst b/Documentation/networking/strparser.rst index 8dc6bb04c710..372106b61e65 100644 --- a/Documentation/networking/strparser.rst +++ b/Documentation/networking/strparser.rst @@ -40,8 +40,8 @@ Functions :: - strp_init(struct strparser *strp, struct sock ...
e504cf18ef4706b4794fb91a010d345e3d48c72d
Analyze and fix the following issue in the Linux kernel code: docs: net: fix minor issues with devlink docs
Problem Details: Update devlink documentation to match current code: - describe health reporter defaults (it's currently under "callbacks"), best-effort auto-dump, and port-scoped reporters - fix generic parameter names and values - fix nested devlink setup wording and registration ordering Link: https://patch.msgi...
```diff diff --git a/Documentation/networking/devlink/devlink-health.rst b/Documentation/networking/devlink/devlink-health.rst index 4d10536377ab..bedac58a2f36 100644 --- a/Documentation/networking/devlink/devlink-health.rst +++ b/Documentation/networking/devlink/devlink-health.rst @@ -33,7 +33,9 @@ Device driver can p...
ef057cbf825e03b63f6edf5980f96abf3c53089d
Analyze and fix the following issue in the Linux kernel code: KVM: x86/mmu: Ensure hugepage is in by slot before checking max mapping level
Problem Details: When recovering hugepages in the shadow MMU, verify that the base gfn of the shadow page is actually contained within the target memslot, *before* querying the max mapping level given the shadow page's gfn. Failure to pre-check the validity of the gfn can lead to an out-of-bounds access to the slot's ...
```diff diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index c13b80fe3125..26ed97efda91 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -7360,13 +7360,19 @@ restart: sp = sptep_to_sp(sptep); /* - * We cannot do huge page mapping for indirect shadow pages, - * which are foun...
81ccda30b4e83d8f5cc4fd50503c44e3a33abfeb
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Fix shadow paging use-after-free due to unexpected role
Problem Details: Commit 0cb2af2ea66ad ("KVM: x86: Fix shadow paging use-after-free due to unexpected GFN") fixed a shadow paging mismatch between stored and computed GFNs; the bug could be triggered by changing a PDE mapping from outside the guest, and then deleting a memslot. The rmap_remove() call would miss entries...
```diff diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 9368a71336fe..c13b80fe3125 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -2459,13 +2459,15 @@ static struct kvm_mmu_page *kvm_mmu_get_child_sp(struct kvm_vcpu *vcpu, u64 *sptep, gfn_t gfn, bool direct, unsig...
6c1ca112a6e4e62706477b06ea94fa0fd8ff2e66
Analyze and fix the following issue in the Linux kernel code: net: atlantic: fix AQC113 HW init: ART, L2 filter slot, MAC address
Problem Details: Fix initialization issues in hw_atl2 to correctly support AQC113: - hw_atl2_hw_reset: replace unconditional priv memset with selective field clears so that l3l4_filters[].l3_index and l4_index can be initialized to -1 (not allocated) rather than 0; 0 is a valid filter index and would incorrectly...
```diff diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c index ba9555fb8f11..ec5b2a03fd6f 100644 --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c @@ -11,6 +11,7 @@...
4428d3b99414e1402d4b4351c05e7a0d969bafa1
Analyze and fix the following issue in the Linux kernel code: net: atlantic: add AQC113 filter data structures, firmware query and register dump
Problem Details: Add filter infrastructure for AQC113 hardware: - Define L3 (IPv4/IPv6), L4 (TCP/UDP/SCTP), and combined L3L4 filter structures with serialized usage counter for filter sharing. - Define tag policy structure for ethertype filter management. - Add RPF L3/L4 command bit definitions for filter programmi...
```diff diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c index 0ce9caae8799..ba9555fb8f11 100644 --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c @@ -540,17 +540,8...
1221e50b4aa60b98aade37eb4e536d4a2cb93e75
Analyze and fix the following issue in the Linux kernel code: perf tools: Document recent additions to the perf.data file header
Problem Details: Add documentation for recently added HEADER_E_MACHINE and HEADER_CLN_SIZE data to the perf.data file. Also fix a typo at the end of the header section. Reviewed-by: Ian Rogers <irogers@google.com> Signed-off-by: Thomas Falcon <thomas.falcon@intel.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Al...
```diff diff --git a/tools/perf/Documentation/perf.data-file-format.txt b/tools/perf/Documentation/perf.data-file-format.txt index 0e4d0ecc9e12..b90cba9168f8 100644 --- a/tools/perf/Documentation/perf.data-file-format.txt +++ b/tools/perf/Documentation/perf.data-file-format.txt @@ -464,7 +464,21 @@ struct cpu_domain_in...
9361bff6bdb743dabe69d71fa1b8be69575d5b0c
Analyze and fix the following issue in the Linux kernel code: selftests/vsock: skip vng setsid workaround on >= 1.41
Problem Details: virtme-ng 1.41 ships the upstream fix for the SIGTTOU hang (https://github.com/arighi/virtme-ng/pull/453), so the setsid wrapper in vng_dry_run() is no longer needed there. Gate the workaround on the vng version: setsid is used for vng < 1.41, and vng is invoked directly on >= 1.41. Signed-off-by: Bob...
```diff diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh index ee69ac9dd3dc..310dfc2a39ad 100755 --- a/tools/testing/selftests/vsock/vmtest.sh +++ b/tools/testing/selftests/vsock/vmtest.sh @@ -445,8 +445,14 @@ vng_dry_run() { # stopped with SIGTTOU and hangs until kselfte...
2bf43d0e2e6a27d52a7d624e2d6b9116972e8a22
Analyze and fix the following issue in the Linux kernel code: tcp: ipv6: clamp default adverting MSS to avoid GSO_BY_FRAGS (0xFFFF)
Problem Details: When MTU is large, ip6_default_advmss() can return IPV6_MAXPLEN (65535). This is interpreted by TCP as mss_clamp, allowing the MSS to reach 65535. However, 0xFFFF is also used as a magic value GSO_BY_FRAGS in the kernel. If a TCP packet with gso_size=0xFFFF is passed to skb_segment(), it will be mista...
```diff diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 636f0120d7e3..3c97ba01297a 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -3275,11 +3275,11 @@ static unsigned int ip6_default_advmss(const struct dst_entry *dst) /* * Maximal non-jumbo IPv6 payload is IPV6_MAXPLEN and * corresponding MSS i...
f4c3d89fc986b0da196ddfc6cfe0ea5d5d08bec6
Analyze and fix the following issue in the Linux kernel code: tipc: fix UAF in tipc_l2_send_msg()
Problem Details: Syzbot reported a slab-use-after-free in ipvlan_hard_header() when called from tipc_l2_send_msg(). The root cause is that tipc_disable_l2_media() calls synchronize_net() while b->media_ptr is still valid. This allows concurrent RCU readers to obtain the device pointer after synchronize_net() has finis...
```diff diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index a3bd1ef17558..05dcd2f9e887 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c @@ -482,6 +482,7 @@ void tipc_disable_l2_media(struct tipc_bearer *b) dev = (struct net_device *)rtnl_dereference(b->media_ptr); dev_remove_pack(&b->pt); RCU_INIT_POIN...
0b352f04b9be2c83c0240aa6dae7257fefa90464
Analyze and fix the following issue in the Linux kernel code: octeontx2-vf: clear stale mailbox IRQ state before request_irq()
Problem Details: otx2vf_register_mbox_intr() currently installs the VF mailbox IRQ handler before clearing stale mailbox interrupt state. The code then says that local interrupt bits should be cleared first to avoid spurious interrupts, but that clear still happens only after request_irq() has already made the handler ...
```diff diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c index f4fdbfba8667..b022f52c6845 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c @@ -251,9 +251,17 @@ static int o...
f918554fb7246e89b98ef90abe80801f038258b3
Analyze and fix the following issue in the Linux kernel code: octeontx2-pf: clear stale mailbox IRQ state before request_irq()
Problem Details: otx2_register_mbox_intr() currently installs the PF mailbox IRQ handler before clearing stale mailbox interrupt state. The function itself then comments that the local interrupt bits must be cleared first to avoid spurious interrupts, but that clear happens only after request_irq() has already exposed ...
```diff diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c index f9fbf0c17648..0311357dd05b 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c @@ -1119,9 +1119,16 @@ int otx2_r...
528ad521a433cf873724893bda339df95d8ac1e0
Analyze and fix the following issue in the Linux kernel code: pmdomain: core: fix unused variable warning with !PM_GENERIC_DOMAINS_OF
Problem Details: The genpd provider bus is really only used when CONFIG_PM_GENERIC_DOMAINS_OF is enabled, and since the recent deferred initialisation of domain parent devices, the root device pointer is otherwise unused. Fix the unused variable warning by moving the definition of the root device pointer inside the co...
```diff diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index 7796042e3f37..842c4169e290 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -32,9 +32,6 @@ static const struct bus_type genpd_provider_bus_type = { .name = "genpd_provider", }; -/* The parent for genpd_provider devic...
41fe0f7b84f0cb822ae10ab08592996a592b2a25
Analyze and fix the following issue in the Linux kernel code: NFSv4/pNFS: reject zero-length r_addr in nfs4_decode_mp_ds_addr
Problem Details: nfs4_decode_mp_ds_addr() decodes the r_netid and r_addr opaques of a netaddr4 from a GETDEVICEINFO multipath-DS body, then immediately calls strrchr(buf, '.') to locate the port separator. Both decodes use xdr_stream_decode_string_dup(), and the current code checks only "nlen < 0" / "rlen < 0" before d...
```diff diff --git a/fs/nfs/pnfs_nfs.c b/fs/nfs/pnfs_nfs.c index 12632a706da8..0ff43dbcb7cd 100644 --- a/fs/nfs/pnfs_nfs.c +++ b/fs/nfs/pnfs_nfs.c @@ -1075,14 +1075,14 @@ nfs4_decode_mp_ds_addr(struct net *net, struct xdr_stream *xdr, gfp_t gfp_flags) /* r_netid */ nlen = xdr_stream_decode_string_dup(xdr, &netid, X...
64587e936b6526539f5d2cf1bb667c52be937cd7
Analyze and fix the following issue in the Linux kernel code: ipv4: fib: Flush all fib_info in fib_table_flush() during netns dismantle.
Problem Details: Even when fib_table_flush() is called with flush_all true, it does not flush all fib_info due to this condition: !(fi->fib_flags & RTNH_F_DEAD) && !fib_props[fa->fa_type].error) This creates an implicit ordering between default_device_exit_batch() and fib_net_exit_batch(). fib_table_flush(flush_al...
```diff diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 1308213791f1..07068207b888 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -2046,18 +2046,12 @@ int fib_table_flush(struct net *net, struct fib_table *tb, bool flush_all) hlist_for_each_entry_safe(fa, tmp, &n->leaf, fa_list) { str...
cd355f6dc70503191249c5147e2f2e8f3c8838bd
Analyze and fix the following issue in the Linux kernel code: perf trace: Fix noise and signed formatting of __probe_ip in bare dynamic probes
Problem Details: When a dynamic probe is created without explicitly requested arguments via perf probe --add, the Ftrace subsystem automatically appends "__probe_ip" to the tracepoint format to record the instruction pointer. Currently, perf trace prints this implicit field by default. Furthermore, because the formatt...
```diff diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 377f0a18b00e..a8492da23a9c 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -3261,6 +3261,27 @@ static size_t trace__fprintf_tp_fields(struct trace *trace, struct perf_sample * if (val == 0 && !trace->show_z...
190c4546384461f3dee70a649b438aa41c24d01e
Analyze and fix the following issue in the Linux kernel code: perf test: Add inject ASLR test
Problem Details: Add a new shell test to verify the feature. The test covers: - Basic address remapping for user space samples. - Pipe mode coverage for piped into. - Callchain address remapping. - Consistency of output before and after injection. - Pipe mode report consistency. - Dropping of samples that leak ASLR inf...
```diff diff --git a/tools/perf/tests/shell/inject_aslr.sh b/tools/perf/tests/shell/inject_aslr.sh new file mode 100755 index 000000000000..c00461828ea7 --- /dev/null +++ b/tools/perf/tests/shell/inject_aslr.sh @@ -0,0 +1,533 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# perf inject --aslr test + +set -e +set ...
575c6d2bc470ec809d6c803ec0db9e61762cfa32
Analyze and fix the following issue in the Linux kernel code: perf inject/aslr: Implement sample address remapping
Problem Details: Add the sample address remapping logic to the ASLR tool. This patch implements aslr_tool__process_sample, which parses sample events, remaps IPs, ADDRs, callchains, and branch stacks using the mappings collected from metadata events, and drops potentially leaking raw, register, stack, physical address,...
```diff diff --git a/tools/perf/util/aslr.c b/tools/perf/util/aslr.c index 56fc444fbf54..d0760ca8926d 100644 --- a/tools/perf/util/aslr.c +++ b/tools/perf/util/aslr.c @@ -20,6 +20,7 @@ #include <linux/zalloc.h> #include <inttypes.h> #include <unistd.h> +#include <byteswap.h> /** * struct remap_addresses_key - K...
61a7e4c2c98c08da6bbf8c30c71da57610930ae7
Analyze and fix the following issue in the Linux kernel code: dt-bindings: vendor-prefixes: add Gira
Problem Details: Add vendor prefix for Gira Giersiepen GmbH & Co. KG Link: https://www.gira.de/ Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Alexander Dahl <ada@thorsis.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://patch.msgid.link/20260610213047.500701-1-l.stach@pengutroni...
```diff diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 28784d66ae7b..2b7bf7d7b9c2 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -656,6 +656,8 @@ patte...
8b2c4f88c6ee86efdbc81bed1684e13e2efebd53
Analyze and fix the following issue in the Linux kernel code: pinctrl: Export pinctrl_get_group_selector()
Problem Details: The recently added UltraRISC DP1000 is using this symbol, and in a reasonable way as well, so export it. Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Reported-by: Nathan Chancellor <nathan@kernel.org> Closes: Link: https://lore.kernel.org/linux-gpio/20260613164847.GA3152104@ax162/ Reporte...
```diff diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 3fcb7e584a93..1675dd36bd5c 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -772,6 +772,7 @@ int pinctrl_get_group_selector(struct pinctrl_dev *pctldev, return -EINVAL; } +EXPORT_SYMBOL_GPL(pinctrl_get_group_selector); ...
6df6b1f2c49678211f65647c300bc51dda02893b
Analyze and fix the following issue in the Linux kernel code: HID: hidpp: fix potential UAF in hidpp_connect_event()
Problem Details: If input_register_device() fails, we call input_free_device(), but keep stale pointer to the old device in hidpp->input, which could potentially lead to UAF. Fix that by resetting it to NULL before returning from hidpp_connect_event(). Reported-by: zdi-disclosures@trendmicro.com Signed-off-by: Jiri Ko...
```diff diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index ccbf28869a96..d8e86b6ccf37 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -4295,6 +4295,7 @@ static void hidpp_connect_event(struct work_struct *work) ret = input_register_device(i...
7d87a5a284bb34edb3f4e7e312ef403b3385a7b7
Analyze and fix the following issue in the Linux kernel code: fuse-uring: clear ent->fuse_req in commit_fetch error path
Problem Details: fuse_uring_commit_fetch() error path called fuse_request_end(req) without clearing ent->fuse_req when fuse_ring_ent_set_commit() fails. The still-pending fuse_uring_send_in_task() task-work later dereferences the dangling pointer through fuse_uring_prepare_send(), causing a use-after-free. End the req...
```diff diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index ba5edf5d01b3..77c8cec43d9c 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -1003,9 +1003,7 @@ static int fuse_uring_commit_fetch(struct io_uring_cmd *cmd, int issue_flags, pr_info_ratelimited("qid=%d commit_id %llu state %d", ...
1b9524250996b1f2f49833a1b2ae21c34e486f85
Analyze and fix the following issue in the Linux kernel code: keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP
Problem Details: Replace two BUG() calls in keyctl_pkey_params_get_2() and keyctl_pkey_e_d_s() default cases with -EOPNOTSUPP, matching the error style already used in these functions. Signed-off-by: Mohammed EL Kadiri <med08elkadiri@gmail.com> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
```diff diff --git a/security/keys/keyctl_pkey.c b/security/keys/keyctl_pkey.c index ba150ee2d4a3..15b6bf6399b5 100644 --- a/security/keys/keyctl_pkey.c +++ b/security/keys/keyctl_pkey.c @@ -163,7 +163,7 @@ static int keyctl_pkey_params_get_2(const struct keyctl_pkey_params __user *_par params->out_len = info.max_si...
10366fe27a4ce08a392eb16ed48ea0a440e671c2
Analyze and fix the following issue in the Linux kernel code: keys: request_key: replace BUG with return -EINVAL
Problem Details: Replace BUG() in construct_get_dest_keyring() default case with return -EINVAL to handle the unimplemented group keyring destination gracefully. Signed-off-by: Mohammed EL Kadiri <med08elkadiri@gmail.com> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Link: https://lore.kernel.org/r/20260613130408.1...
```diff diff --git a/security/keys/request_key.c b/security/keys/request_key.c index a7673ad86d18..fa2bb9f2f538 100644 --- a/security/keys/request_key.c +++ b/security/keys/request_key.c @@ -332,7 +332,7 @@ static int construct_get_dest_keyring(struct key **_dest_keyring) case KEY_REQKEY_DEFL_GROUP_KEYRING: def...
fd15b457a86939c38aa12116adabd8ff686c5e51
Analyze and fix the following issue in the Linux kernel code: keys: Pin request_key_auth payload in instantiate paths
Problem Details: A: request_key() B: KEYCTL_INSTANTIATE_IOV ================ ========================= create auth key store rka in auth key wait for helper get auth key load rka from auth key copy user payload slee...
```diff diff --git a/include/keys/request_key_auth-type.h b/include/keys/request_key_auth-type.h index 36b89a933310..01e42ee5f409 100644 --- a/include/keys/request_key_auth-type.h +++ b/include/keys/request_key_auth-type.h @@ -9,12 +9,14 @@ #define _KEYS_REQUEST_KEY_AUTH_TYPE_H #include <linux/key.h> +#include <lin...
c1201b37f666f6466ab1fd3a381c2b7a4b7e9fee
Analyze and fix the following issue in the Linux kernel code: KEYS: Use acquire when reading state in keyring search
Problem Details: The negative-key race fix added release/acquire ordering for key use. Publish payload before state; read state before payload. keyring_search_iterator() still uses READ_ONCE() before match callbacks. An asymmetric match callback calls asymmetric_key_ids(), which reads key->payload.data[asym_key_ids]....
```diff diff --git a/security/keys/keyring.c b/security/keys/keyring.c index 5a9887d6b7be..7a2ee0ded7c9 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c @@ -576,7 +576,7 @@ static int keyring_search_iterator(const void *object, void *iterator_data) struct keyring_search_context *ctx = iterator_data;...
4d05e948cebe03974ab9927daee55273207fdc22
Analyze and fix the following issue in the Linux kernel code: KEYS: trusted: Debugging as a feature
Problem Details: TPM_DEBUG, and other similar flags, are a non-standard way to specify a feature in Linux kernel. Introduce CONFIG_TRUSTED_KEYS_DEBUG for trusted keys, and use it to replace these ad-hoc feature flags. Given that trusted keys debug dumps can contain sensitive data, harden the feature as follows: 1. In...
```diff diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 672665ea6265..2f0056b8e692 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -7875,6 +7875,22 @@ Kernel parameters first tr...
cb481e59ea6cae3b7796ac1d7a22b6b24c3f3c0b
Analyze and fix the following issue in the Linux kernel code: KEYS: fix overflow in keyctl_pkey_params_get_2()
Problem Details: The length for the internal output buffer is calculated incorrectly, which can result overflow when a too small buffer is provided. Fix the bug by allocating internal output with the size of the maximum length of the cryptographic primitive instead of caller provided size. Link: https://lore.kernel.o...
```diff diff --git a/security/keys/keyctl_pkey.c b/security/keys/keyctl_pkey.c index 97bc27bbf079..ba150ee2d4a3 100644 --- a/security/keys/keyctl_pkey.c +++ b/security/keys/keyctl_pkey.c @@ -138,28 +138,35 @@ static int keyctl_pkey_params_get_2(const struct keyctl_pkey_params __user *_par if (uparams.in_len > info....
0fa8346099b5794b9909989e3f1cb617e9d8d3fa
Analyze and fix the following issue in the Linux kernel code: fuse: invalidate readdir cache on epoch bump
Problem Details: FUSE_NOTIFY_INC_EPOCH invalidates dentries, but does not invalidate cached readdir results. A process with cwd inside a FUSE mount can therefore observe stale readdir(".") output after an epoch bump. Fix this by recording epoch in the readdir cache and checking it on reuse. Minimal reproducer: - mou...
```diff diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 6455617b74a0..85f738c53122 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -190,6 +190,11 @@ struct fuse_inode { */ struct timespec64 mtime; + /** + * @epoch: epoch of fc when cache was started + */ + int epoch; + /** *...
2b0408d0284f4ff376cf5610fa8c9905e93c2541
Analyze and fix the following issue in the Linux kernel code: fuse: invalidate page cache after DIO and async DIO writes
Problem Details: This fixe does page cache invalidation after DIO and async DIO writes for both O_DIRECT and FOPEN_DIRECT_IO cases. Commit b359af8275a9 ("fuse: Invalidate the page cache after FOPEN_DIRECT_IO write") fixed xfstests generic/209 for DIO writes in the FOPEN_DIRECT_IO path. DIO writes without FOPEN_DIRECT_...
```diff diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 9160836664b0..cb8da4c06d17 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -639,6 +639,19 @@ static ssize_t fuse_get_res_by_io(struct fuse_io_priv *io) return io->bytes < 0 ? io->size : io->bytes; } +static void fuse_aio_invalidate_worker(struct work_s...
521fed4886ccb3b78846595e843ec9419d343623
Analyze and fix the following issue in the Linux kernel code: fuse: use READ_ONCE in fuse_chan_num_background()
Problem Details: fuse_chan_num_background() is called without holding fch->bg_lock (for example from fuse_writepages() to compare against fc->congestion_threshold), while fch->num_background is updated under bg_lock in dev.c and dev_uring.c. This is the same locked-write/lockless-read pattern already used for max_backg...
```diff diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 63a289853023..d09cddd68e03 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -383,7 +383,7 @@ EXPORT_SYMBOL_GPL(fuse_dev_chan_new); unsigned int fuse_chan_num_background(struct fuse_chan *fch) { - return fch->num_background; + return READ_ONCE(fch->num_backgr...
03728af4aeef6ee9914f93d60936db351e106863
Analyze and fix the following issue in the Linux kernel code: fuse: convert page array allocation to kcalloc()
Problem Details: fuse_get_user_pages() allocates the temporary pages[] array used by iov_iter_extract_pages() with the open-coded kzalloc(n * sizeof(*p), ...) form. max_pages is derived from the inbound iov_iter and is not bounded at compile time, so the multiplication can overflow on sufficiently large iter counts; t...
```diff diff --git a/fs/fuse/file.c b/fs/fuse/file.c index e8833e2a6610..cbd02fa3cb74 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1590,7 +1590,7 @@ static int fuse_get_user_pages(struct fuse_args_pages *ap, struct iov_iter *ii, * manually extract pages using iov_iter_extract_pages() and then * copy that ...
567820f02a9b34df65130c10ffa617c36e63a04d
Analyze and fix the following issue in the Linux kernel code: fuse: fuse_i.h: clean up kernel-doc comments
Problem Details: Convert many comments to kernel-doc format to eliminate around 20 kernel-doc warnings like these: Warning: fs/fuse/fuse_i.h:374 This comment starts with '/**', but isn't a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst * A Fuse connection. Warning: fs/fuse/fuse_i.h:817 This comme...
```diff diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 8c58a030d296..93087fc04975 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -71,137 +71,166 @@ extern unsigned int max_user_congthresh; struct fuse_forget_link; -/* Submount lookup tracking */ +/** + * struct fuse_submount_lookup - Submount look...
48649c0603bd355fb1d2c26ed4b6f635146278ea
Analyze and fix the following issue in the Linux kernel code: fuse: alloc pqueue before installing fch in fuse_dev
Problem Details: Prior to this patchset, fuse_dev (containing fuse_pqueue) was allocated on mount. But now fuse_dev is allocated when opening /dev/fuse, even though the queues are not needed at that time. Delay allocation of the pqueue (4k worth of list_head) just before mounting or cloning a device. Various distrib...
```diff diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 2403cd445e72..fd0b86ea5691 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -329,6 +329,7 @@ void fuse_chan_release(struct fuse_chan *fch) void fuse_chan_free(struct fuse_chan *fch) { WARN_ON(!list_empty(&fch->devices)); + kfree(fch->pq_prealloc); kfree(fc...
31da059891bd3be9c6e59280b8e1777ead90db34
Analyze and fix the following issue in the Linux kernel code: fuse: fix io-uring background queue dispatch on request completion
Problem Details: When a background request completes via the io_uring path, the background queue gets flushed to dispatch pending background requests, but this is done before the connection-level background counters (fc->num_background, fc->active_background) are properly accounted, which may reduce effective queue dep...
```diff diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 12b57a8c6024..916c214798ca 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -448,6 +448,29 @@ static void flush_bg_queue(struct fuse_conn *fc) } } +void fuse_request_bg_finish(struct fuse_conn *fc, struct fuse_req *req) +{ + lockdep_assert_held(&fc->bg_lock...
9fa4f7a53406430ee9982f2f636a15b338185122
Analyze and fix the following issue in the Linux kernel code: fuse: fix device node leak in cuse_process_init_reply()
Problem Details: If device_add() succeeds during CUSE initialization but a subsequent step (cdev_alloc() or cdev_add()) fails, the error path calls put_device() without first calling device_del(). This leaks the devtmpfs entry created by device_add(), leaving a stale /dev/<name> node that persists until reboot. Since...
```diff diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c index 174333633471..3d38828af41f 100644 --- a/fs/fuse/cuse.c +++ b/fs/fuse/cuse.c @@ -391,7 +391,7 @@ static void cuse_process_init_reply(struct fuse_mount *fm, rc = -ENOMEM; cdev = cdev_alloc(); if (!cdev) - goto err_unlock; + goto err_dev; cdev->owner =...
6e1b235627bb1172d27c1b2ea7bf53e67dbced8d
Analyze and fix the following issue in the Linux kernel code: fuse: do not use start_removing_noperm()
Problem Details: Revert the fuse part of commit c9ba789dad15 ("VFS: introduce start_creating_noperm() and start_removing_noperm()"). Commit c9ba789dad15 ("VFS: introduce start_creating_noperm() and start_removing_noperm()") caused a regression in FUSE_NOTIFY_INVAL_ENTRY, which failed to invalidate negative dentries. ...
```diff diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 6b05846c9bed..97751bacb79c 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1594,25 +1594,27 @@ int fuse_reverse_inval_entry(struct fuse_conn *fc, u64 parent_nodeid, if (!parent) return -ENOENT; + inode_lock_nested(parent, I_MUTEX_PARENT); if (!S_ISDIR...
c12bbaf7c2d19325913ffd7002e580e63952d9e2
Analyze and fix the following issue in the Linux kernel code: Revert "fuse: fix conversion of fuse_reverse_inval_entry() to start_removing()"
Problem Details: This reverts commit cab012375122304a6343c1ed09404e5143b9dc01. Commit c9ba789dad15 ("VFS: introduce start_creating_noperm() and start_removing_noperm()") caused a regression in FUSE_NOTIFY_INVAL_ENTRY, which failed to invalidate negative dentries. This manifests in the filesystem returning -ENOENT for...
```diff diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index b658b6baf72f..6b05846c9bed 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1587,8 +1587,8 @@ int fuse_reverse_inval_entry(struct fuse_conn *fc, u64 parent_nodeid, { int err = -ENOTDIR; struct inode *parent; - struct dentry *dir = NULL; - struct dentry *en...
54243797cedf55447b4c5d560e8cd709900061ae
Analyze and fix the following issue in the Linux kernel code: fuse: avoid 32-bit prune notification count wrap
Problem Details: FUSE_NOTIFY_PRUNE validates the nodeid payload length with: size - sizeof(outarg) != outarg.count * sizeof(u64) On 32-bit kernels, size_t is also 32 bits, so the daemon-controlled count multiplication can wrap. A prune notification with count 0x20000000 and no nodeid payload passes the check, en...
```diff diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 296cdb696f58..12b57a8c6024 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -2076,7 +2076,7 @@ static int fuse_notify_prune(struct fuse_conn *fc, unsigned int size, if (err) return err; - if (size - sizeof(outarg) != outarg.count * sizeof(u64)) + if (size...
1c57a69be962d459c5e705f5cb4355b841b3461c
Analyze and fix the following issue in the Linux kernel code: fuse-uring: remove request-less entries from ent_w_req_queue to fix NULL deref
Problem Details: If a copy into the userspace ring buffer fails, a request will be terminated and fuse_uring_req_end() will set ent->fuse_req to NULL but it will leave the entry on ent_w_req_queue in FRRS_FUSE_REQ state. This can lead to a NULL deref if the request expiration logic scans ent_w_req_queue in the window b...
```diff diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index aae79d5a6588..7e5fe462b935 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -709,10 +709,20 @@ static int fuse_uring_prepare_send(struct fuse_ring_ent *ent, int err; err = fuse_uring_copy_to_ring(ent, req); - if (!err) + if (!err) {...
f8fce75fedf73ac72aa09163deb8f4291fdcaad2
Analyze and fix the following issue in the Linux kernel code: fuse: clear intr_entry in fuse_resend and fuse_remove_pending_req
Problem Details: When fuse_resend() moves a request from fpq->processing back to fiq->pending, it sets FR_PENDING and clears FR_SENT but does not remove the requests intr_entry from fiq->interrupts. If the request had FR_INTERRUPTED set from a prior signal, intr_entry remains dangling on fiq->interrupts. When the req...
```diff diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index b527d90ef74b..296cdb696f58 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -148,6 +148,7 @@ static struct fuse_req *fuse_request_alloc(struct fuse_mount *fm, gfp_t flags) static void fuse_request_free(struct fuse_req *req) { + WARN_ON(!list_empty(&req->intr...
1efd3d474fc0ba74dfd984249bca78807d739812
Analyze and fix the following issue in the Linux kernel code: fuse-uring: make a fuse_req on SQE commit only findable after memcpy
Problem Details: Bad userspace might try to trick us and send commit SQEs request unique / commit-id of requests that are not even send to fuse-server (io_uring_cmd_done() not called) yet. fuse_uring_commit_fetch() ends the fuse request when the ring entry has a wrong state, but that could have caused a use-after-free...
```diff diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index ed652034927e..aae79d5a6588 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -717,6 +717,19 @@ static int fuse_uring_prepare_send(struct fuse_ring_ent *ent, return err; } +/* Used to find the request on SQE commit */ +static void fuse...
b70a3aca16934c196f92abb17b01c1647b9bb63c
Analyze and fix the following issue in the Linux kernel code: fuse-uring: Avoid queue->stopped races and set/read that value under lock
Problem Details: There are several readers of queue->stopped that check the value under lock, but fuse_uring_commit_fetch() did not and actually the value was not set under the lock in fuse_uring_abort_end_requests() either. Especially in fuse_uring_commit_fetch it is important to check under a lock, because due to rac...
```diff diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index 38b5a05a423f..ed652034927e 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -130,10 +130,9 @@ void fuse_uring_abort_end_requests(struct fuse_ring *ring) if (!queue) continue; - queue->stopped = true; - WARN_ON_ONCE(ring->fc->...
d351da75066955144515cb2f9aa959f24a04287a
Analyze and fix the following issue in the Linux kernel code: fuse-uring: Avoid use-after-free in fuse_uring_async_stop_queues
Problem Details: fuse_uring_async_stop_queues() might run when the last reference on ring->queue_refs was already dropped. In order to avoid an early destruction a reference on struct fuse_conn is now taken before starting fuse_uring_async_stop_queues() and that reference is only released when that delayed work queue ...
```diff diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index 7b20a0f7643d..38b5a05a423f 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -470,6 +470,7 @@ static void fuse_uring_async_stop_queues(struct work_struct *work) FUSE_URING_TEARDOWN_INTERVAL); } else { wake_up_all(&ring->sto...
bea4fe98204b6ce7eb8e29f7bf867dd7619b3ddd
Analyze and fix the following issue in the Linux kernel code: fuse-uring: end fuse_req on io-uring cancel task work
Problem Details: When io_uring delivers task work with tw.cancel set (PF_EXITING, PF_KTHREAD fallback, or percpu_ref_is_dying on the ring context), fuse_uring_send_in_task() takes the cancel branch, assigns -ECANCELED, and falls through to fuse_uring_send(). That path only flips the entry to FRRS_USERSPACE and complete...
```diff diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index 0bda31f76c7f..7b20a0f7643d 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -1238,11 +1238,21 @@ static void fuse_uring_send_in_task(struct io_tw_req tw_req, io_tw_token_t tw) fuse_uring_next_fuse_req(ent, queue, issue_flags); ret...
198f45eeb9f78b2a2d6d8be95e4e43468eb2c6bc
Analyze and fix the following issue in the Linux kernel code: fuse-uring: fix moving cancelled entry to ent_in_userspace list
Problem Details: fuse_uring_cancel() moves entries that are available (these have no reqs attached) to the ent_in_userspace list. ent_list_request_expired() checks the first entry on ent_in_userspace and dereferences ent->fuse_req unconditionally, which will crash on a cancelled entry that was moved to this list. Fix ...
```diff diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index fb24a2cb53dc..0bda31f76c7f 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -511,8 +511,7 @@ static void fuse_uring_cancel(struct io_uring_cmd *cmd, queue = ent->queue; spin_lock(&queue->lock); if (ent->state == FRRS_AVAILABLE) { - ...
952b5d36f6a298f57c52a59e72076c69386a8aaf
Analyze and fix the following issue in the Linux kernel code: fuse-uring: fix race between registration and connection abortion
Problem Details: This fixes this race: - thread a: io_uring_enter -> register sqe -> fuse_uring_create_ring_ent -> allocate ent but doesn't grab queue_ref yet - thread b: fuse_conn_destroy() -> fuse_chan_abort() -> fuse_uring_abort() is a no-op due to queue ref being 0 - thread a: grabs the queue_ref, queue_ref i...
```diff diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index 33b9fcee4fc3..16b9229c2dbd 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -972,15 +972,26 @@ static bool is_ring_ready(struct fuse_ring *ring, int current_qid) /* * fuse_uring_req_fetch command handling */ -static void fuse_uring_d...