id stringlengths 40 40 | instruction stringlengths 68 308 | input stringlengths 17 33.4k | output stringlengths 100 30k |
|---|---|---|---|
8fa30821180a9a19e78e9f4df1c0ba710252801e | Analyze and fix the following issue in the Linux kernel code: timekeeping: Register default clocksource before taking tk_core.lock | Problem Details:
Commit f24df84cbe05 ("time/jiffies: Register jiffies clocksource before
usage") moved the jiffies clocksource registration into
clocksource_default_clock(), so that it is registered lazily on the first
call. __clocksource_register() acquires clocksource_mutex, but the first
caller is timekeeping_init()... | ```diff
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 0d5b67f609bb..b1b5ec43c0f2 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -2061,13 +2061,14 @@ void __init timekeeping_init(void)
*/
wall_to_mono = timespec64_sub(boot_offset, wall_time);
+ clock = clockso... |
c35eb77a67515d4201bc91294f40761591f43bbd | Analyze and fix the following issue in the Linux kernel code: rtla/tests: Fix pgrep filter in get_workload_pids.sh | Problem Details:
Multiple runtime tests in RTLA rely on the get_workload_pids() shell
helper function to get the PIDs of both kernel and user workloads.
On some systems (e.g. Fedora 43), pgrep matches kernel thread names
including square brackets: "[osnoise/0]"; on other systems (e.g.
RHEL 9.8), brackets are not inclu... | ```diff
diff --git a/tools/tracing/rtla/tests/scripts/lib/get_workload_pids.sh b/tools/tracing/rtla/tests/scripts/lib/get_workload_pids.sh
index 8aff98cd2c1f..d10a4e3b321d 100644
--- a/tools/tracing/rtla/tests/scripts/lib/get_workload_pids.sh
+++ b/tools/tracing/rtla/tests/scripts/lib/get_workload_pids.sh
@@ -5,7 +5,7 ... |
6cf83f43bfc36dccc35a7f3f12094b14c4c0dda4 | Analyze and fix the following issue in the Linux kernel code: rtla: Fix and clean up .gitignore | Problem Details:
.gitignore includes several entries prone to unwanted matches in
subdirectories. One of them, the recently added "lib/", matches the
recently added directory "tests/scripts/lib/" in addition to the
intended top-level "lib/", which contains object files built from
sources in tools/lib.
Add "/" to all .... | ```diff
diff --git a/tools/tracing/rtla/.gitignore b/tools/tracing/rtla/.gitignore
index c7b4bf1c8ba9..2a1c99ddd1bf 100644
--- a/tools/tracing/rtla/.gitignore
+++ b/tools/tracing/rtla/.gitignore
@@ -1,14 +1,9 @@
# SPDX-License-Identifier: GPL-2.0-only
-rtla
-rtla-static
-unit_tests
+/rtla
+/rtla-static
+/unit_tests
f... |
12aad822fb9a761f3a9d278083a5bdcb1524e5ec | Analyze and fix the following issue in the Linux kernel code: spi: acpi: Free resource list at appropriate time | Problem Details:
We do unneeded "double free" (emptying an empty list) in one case.
This is not a critical issue at all, the fix just makes code robust
against any possible future changes in the flow.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260617092406.2649... | ```diff
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index ab37b50bbf79..d7e584afa301 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2979,12 +2979,12 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
INIT_LIST_HEAD(&resource_list);
ret = acpi_dev_get_resources(adev, &resourc... |
fdf043f5f3bae150b678feae3d7bb1beed87ec14 | Analyze and fix the following issue in the Linux kernel code: ASoC: tlv320aic3x: restrict CLKDIV bypass Q values in dual-rate mode | Problem Details:
The datasheet documents that when the PLL is disabled and dual-rate mode
is enabled, only Q values {4, 8, 9, 12, 16} are valid for the CLKDIV
bypass path; all other Q values produce invalid bitclock output.
The existing loop iterates Q from 2 to 17 without this restriction,
causing silent audio failur... | ```diff
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index b12c1952823b..b38393a8130f 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -1049,11 +1049,13 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *... |
2e9261761b35f0b67b7487688cd1365f535be0b3 | Analyze and fix the following issue in the Linux kernel code: ASoC: qcom: q6apm: fix NULL pointer dereference in graph_callback | Problem Details:
When q6apm_free_fragments() is called it frees rx_data.buf/tx_data.buf
and sets them to NULL under graph->lock. A late DSP buffer-done response
can race with this: graph_callback() passes the !graph->ar_graph guard
(not yet NULL), acquires the lock, but then dereferences a now-NULL buf
pointer to read ... | ```diff
diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c
index 2e5b25b8d00f..641d6d243229 100644
--- a/sound/soc/qcom/qdsp6/q6apm.c
+++ b/sound/soc/qcom/qdsp6/q6apm.c
@@ -587,6 +587,10 @@ static int graph_callback(const struct gpr_resp_pkt *data, void *priv, int op)
token = hdr->token & APM_W... |
ec40342aaca8162bc8ab2607076535ebab1838b8 | Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Sync SPSR_EL1 when injecting an exception into a pVM | Problem Details:
When pKVM injects a synchronous exception into a protected guest, it
re-enters without restoring the guest's EL1 sysregs and writes the EL1
exception registers to hardware by hand: ESR_EL1 and ELR_EL1, but not
SPSR_EL1. enter_exception64() sets SPSR_EL1 (the interrupted PSTATE)
only in memory, so the g... | ```diff
diff --git a/arch/arm64/kvm/hyp/nvhe/sys_regs.c b/arch/arm64/kvm/hyp/nvhe/sys_regs.c
index 8c3fbb413a06..1a7d5cd16d72 100644
--- a/arch/arm64/kvm/hyp/nvhe/sys_regs.c
+++ b/arch/arm64/kvm/hyp/nvhe/sys_regs.c
@@ -268,6 +268,7 @@ static void inject_sync64(struct kvm_vcpu *vcpu, u64 esr)
write_sysreg_el1(esr, S... |
1a5f9334a45a6b0c1cd7341cc72a3b87adad1d27 | Analyze and fix the following issue in the Linux kernel code: perf dso: Set standard errno on decompression failure | Problem Details:
dso__get_filename() sets errno to a negative custom DSO_LOAD_ERRNO
value when kernel module decompression fails:
errno = *dso__load_errno(dso); /* e.g. -9996 */
The caller __open_dso() then computes fd = -errno, producing a large
positive value (9996) that looks like a valid file descriptor. This... | ```diff
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 79f1a30f3683..2309196d8df3 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -600,7 +600,13 @@ static char *dso__get_filename(struct dso *dso, const char *root_dir,
size_t len = sizeof(newpath);
if (dso__decompress_kmodule_... |
5ebf4137d23a4fd6c0cc6a6fb766ee60d2b09193 | Analyze and fix the following issue in the Linux kernel code: perf bpf: Validate array presence before casting BPF prog info pointers | Problem Details:
Several functions cast bpf_prog_info fields (jited_ksyms,
jited_func_lens, jited_prog_insns) from u64 to pointers and
dereference them. These fields are only valid pointers if
bpil_offs_to_addr() converted their file offsets to addresses, which
only happens when the corresponding PERF_BPIL_* bits are ... | ```diff
diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c
index 57d53ba84835..fa3ebc8ea7f0 100644
--- a/tools/perf/util/bpf-event.c
+++ b/tools/perf/util/bpf-event.c
@@ -59,6 +59,10 @@ static int machine__process_bpf_event_load(struct machine *machine,
return 0;
info_linear = info_node->info_l... |
fe68cf349fb343c0a7cb6c4fe6c3de4f4afe8d1c | Analyze and fix the following issue in the Linux kernel code: perf c2c: Fix hist entry and format list leaks in c2c_he_free() | Problem Details:
c2c_he_free() calls hists__delete_entries() which only walks the
output-sorted entries tree. During c2c resort, when cacheline entries
are merged and the redundant entry is freed, the inner hists have not
been output-resorted yet, so hists->entries is empty. The actual inner
hist_entry objects live i... | ```diff
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index eabb922ef295..c9584dbedf77 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -184,7 +184,7 @@ static void c2c_he_free(void *he)
c2c_he = container_of(he, struct c2c_hist_entry, he);
if (c2c_he->hists) {
- hists__... |
61a21d11afd8dd83b2260ae00541bed62a843219 | Analyze and fix the following issue in the Linux kernel code: perf c2c: Free format list entries when c2c_hists__init() fails | Problem Details:
When c2c_hists__init() fails partway through hpp_list__parse(),
dynamically allocated format structures that were already added to
hists->list are leaked because he__get_c2c_hists() frees the hists
container without first unregistering the format entries.
Call perf_hpp__reset_output_field() before fre... | ```diff
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 07c7e8fb315e..eabb922ef295 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -226,6 +226,7 @@ he__get_c2c_hists(struct hist_entry *he,
ret = c2c_hists__init(hists, sort, nr_header_lines, env);
if (ret) {
+ perf_h... |
9a989e60cc6e29d98aed2087425cba53bf4b392d | Analyze and fix the following issue in the Linux kernel code: perf cs-etm: Bounds-check CPU in cs_etm__get_queue() | Problem Details:
cs_etm__get_queue() indexes etm->queues.queue_array[cpu] without
validating that cpu is within nr_queues. When processing
AUX_OUTPUT_HW_ID events, the cpu value comes from untrusted perf.data
trace payload and flows through cs_etm__process_trace_id_v0_1() and
cs_etm__queue_aux_fragment() without bound... | ```diff
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index d121c8f22028..5d0664ff73b7 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -292,8 +292,11 @@ static struct cs_etm_queue *cs_etm__get_queue(struct cs_etm_auxtrace *etm, int c
{
if (etm->per_thread_decoding)
retur... |
78d8ba680126f3545e8d0fba667e12d79fd4353b | Analyze and fix the following issue in the Linux kernel code: perf cs-etm: Require full global header in auxtrace_info size check | Problem Details:
cs_etm__process_auxtrace_info() checks that header.size covers
event_header_size + INFO_HEADER_SIZE (16 bytes total), but then
accesses ptr[CS_PMU_TYPE_CPUS] at offset 24 from the start of the
event. A crafted 16-byte auxtrace_info event passes the size check
but reads out-of-bounds.
Include CS_ETM_H... | ```diff
diff --git a/tools/perf/util/cs-etm-base.c b/tools/perf/util/cs-etm-base.c
index 4abe416e3feb..aebef71d3a0a 100644
--- a/tools/perf/util/cs-etm-base.c
+++ b/tools/perf/util/cs-etm-base.c
@@ -170,7 +170,9 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
u64 *ptr = NULL;
u64 hdr_version;
- if (... |
312d91329b8fc6989a916a3f9a12d0674167b7e4 | Analyze and fix the following issue in the Linux kernel code: perf cs-etm: Validate num_cpu before metadata allocation | Problem Details:
cs_etm__process_auxtrace_info_full() reads num_cpu from untrusted
perf.data and uses it to allocate the metadata pointer array:
metadata = zalloc(sizeof(*metadata) * num_cpu);
On 32-bit, sizeof(*metadata) is 4, so num_cpu = 0x40000000 overflows
the multiplication to 0, causing zalloc(0) to return a... | ```diff
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 0927b0b9c06b..d121c8f22028 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -3431,6 +3431,18 @@ int cs_etm__process_auxtrace_info_full(union perf_event *event,
/* First the global part */
ptr = (u64 *) auxtrace_inf... |
fe63d3bca288c5bb983304efd5fc3a5ff3183403 | Analyze and fix the following issue in the Linux kernel code: perf machine: Use snprintf() for guestmount path construction | Problem Details:
machines__findnew() and machines__create_guest_kernel_maps() use
sprintf() to build paths by prepending symbol_conf.guestmount.
Both write into PATH_MAX stack buffers, but guestmount comes from
user configuration and is not length-checked. A guestmount path
at or near PATH_MAX causes a stack buffer ov... | ```diff
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 9329d319bd03..0d2ebf6a84bc 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -333,7 +333,7 @@ struct machine *machines__findnew(struct machines *machines, pid_t pid)
if ((pid != HOST_KERNEL_ID) &&
(pid != DE... |
8a4506595857356fcef9f7aad3506593e9fabbbc | Analyze and fix the following issue in the Linux kernel code: perf machine: Propagate machine__init() error to callers | Problem Details:
machine__init() always returns 0 even when memory allocation fails,
because commit 81f981d7ec43ed93 ("perf machine: Free root_dir in
machine__init() error path") introduced 'int err = -ENOMEM' and an
error cleanup path but left the final 'return 0' instead of
'return err'.
Fix by returning err, check ... | ```diff
diff --git a/tools/perf/tests/hists_cumulate.c b/tools/perf/tests/hists_cumulate.c
index 267cbc24691a..09ee08085b06 100644
--- a/tools/perf/tests/hists_cumulate.c
+++ b/tools/perf/tests/hists_cumulate.c
@@ -704,7 +704,7 @@ out:
static int test__hists_cumulate(struct test_suite *test __maybe_unused, int subtest... |
e2cb1f4578625e71f461d5c1ce70984193389cbb | Analyze and fix the following issue in the Linux kernel code: KVM: arm64: nv: Write ESR_EL2 for injected nested SError exceptions | Problem Details:
kvm_inject_el2_exception() writes ESR_EL2 for synchronous exceptions
but not for SError. enter_exception64() does not write ESR_ELx for any
exception type, so the constructed syndrome is dropped. A guest L2
hypervisor taking a nested SError observes stale ESR_EL2.
This affects both kvm_inject_nested_s... | ```diff
diff --git a/arch/arm64/kvm/emulate-nested.c b/arch/arm64/kvm/emulate-nested.c
index e688bc5139c1..76c3e6c1144c 100644
--- a/arch/arm64/kvm/emulate-nested.c
+++ b/arch/arm64/kvm/emulate-nested.c
@@ -2826,6 +2826,7 @@ static void kvm_inject_el2_exception(struct kvm_vcpu *vcpu, u64 esr_el2,
break;
case excep... |
9f1667098c6ae7ec81a9a56859cfdacb822aa0d0 | Analyze and fix the following issue in the Linux kernel code: KVM: arm64: nv: Drop bogus WARN for write to ZCR_EL2 | Problem Details:
It is entirely possible for a guest to write to the ZCR_EL2 sysreg alias
while in a nested context, as it is expected if FEAT_NV2 is advertised
to the L1 hypervisor.
Get rid of the bogus WARN which, since the hyp vectors were installed at
this point, has the effect of a hyp_panic...
Cc: stable@vger.k... | ```diff
diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/include/hyp/switch.h
index d56371b189bf..ea22d1b50512 100644
--- a/arch/arm64/kvm/hyp/include/hyp/switch.h
+++ b/arch/arm64/kvm/hyp/include/hyp/switch.h
@@ -598,8 +598,6 @@ static inline bool kvm_hyp_handle_fpsimd(struct kvm_vcpu *vcpu, u... |
ff1022c3de46753eb7eba2f6efd990569e66ff95 | Analyze and fix the following issue in the Linux kernel code: KVM: arm64: nv: Fix SPSR_EL2 restore in kvm_hyp_handle_mops() | Problem Details:
kvm_hyp_handle_mops() resets the single-step state machine as part of
rewinding state for a MOPS exception by modifying vcpu_cpsr() and
writing the result directly into hardware.
In the case of nested virtualization, vcpu_cpsr() is a synthetic value
such that the rest of KVM can deal with vEL2 cleanly... | ```diff
diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/include/hyp/switch.h
index 161bb2a3e1d9..d56371b189bf 100644
--- a/arch/arm64/kvm/hyp/include/hyp/switch.h
+++ b/arch/arm64/kvm/hyp/include/hyp/switch.h
@@ -446,16 +446,19 @@ static inline bool __populate_fault_info(struct kvm_vcpu *vcpu)... |
0074b82cdfcb5fd13710a0ac308ade68ac6f6fbe | Analyze and fix the following issue in the Linux kernel code: KVM: arm64: vgic: Check the interrupt is still ours before migrating it | Problem Details:
vgic_prune_ap_list() drops both ap_list_lock and irq_lock while migrating
an interrupt to another vCPU. After reacquiring the locks it only checks
that the affinity is unchanged (target_vcpu == vgic_target_oracle(irq))
before moving the interrupt, which assumes that an interrupt whose affinity
is prese... | ```diff
diff --git a/arch/arm64/kvm/vgic/vgic.c b/arch/arm64/kvm/vgic/vgic.c
index 70a161383e5a..ccb7e3a90cd0 100644
--- a/arch/arm64/kvm/vgic/vgic.c
+++ b/arch/arm64/kvm/vgic/vgic.c
@@ -820,15 +820,16 @@ retry:
raw_spin_lock(&irq->irq_lock);
/*
- * If the affinity has been preserved, move the
- * interrupt... |
7258770e5814f15e8308ebda82ac9acf6964ba8e | Analyze and fix the following issue in the Linux kernel code: KVM: arm64: vgic: Handle race between interrupt affinity change and LPI disabling | Problem Details:
Hyunwoo Kim reports some really bad races should the following
situation occur:
- LPI-I is pending in vcpu-B's AP list
- vcpu-A writes to vcpu-B's RD to disable its LPIs
- vcpu-C moves I from B to C
If the last two race nicely enough, vgic_prune_ap_list() can drop
the irq and AP list locks, reacquire... | ```diff
diff --git a/arch/arm64/kvm/vgic/vgic.c b/arch/arm64/kvm/vgic/vgic.c
index 5a4768d8cd4f..70a161383e5a 100644
--- a/arch/arm64/kvm/vgic/vgic.c
+++ b/arch/arm64/kvm/vgic/vgic.c
@@ -203,6 +203,7 @@ void vgic_flush_pending_lpis(struct kvm_vcpu *vcpu)
list_for_each_entry_safe(irq, tmp, &vgic_cpu->ap_list_head, ap_... |
c454531af72e0df811600601413bb8d3d039ed08 | Analyze and fix the following issue in the Linux kernel code: dt-bindings: mfd: syscon: Revert renesas,r9a08g046-lvds-cmn | Problem Details:
Revert commit 51284d8b1dbc ("dt-bindings: mfd: syscon: Document the
LVDS_CMN syscon for the RZ/G3L") because it is completely not matching
reality and clearly incorrect in respect of renesas,r9a08g046-lvds-cmn.
It wasn't ever build-tested by author on their DTS, either.
The documented renesas,r9a08g0... | ```diff
diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
index 9c81010d5a74..e22867088063 100644
--- a/Documentation/devicetree/bindings/mfd/syscon.yaml
+++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
@@ -221,7 +221,6 @@ properties:
... |
f167dc91aeed1928292e65a03d6472d3d01711fb | Analyze and fix the following issue in the Linux kernel code: dt-bindings: mfd: st,stmpe: Add missing properties for PWM subnode | Problem Details:
The st,stmpe-pwm binding is already covered by the MFD schema in
Documentation/devicetree/bindings/mfd/st,stmpe.yaml. However, the
PWM subnode was missing a 'required' properties block. This allowed
Device Tree nodes to pass validation even if the 'compatible'
string was omitted. This omission could le... | ```diff
diff --git a/Documentation/devicetree/bindings/mfd/st,stmpe.yaml b/Documentation/devicetree/bindings/mfd/st,stmpe.yaml
index df43878fbe18..4bb05d544901 100644
--- a/Documentation/devicetree/bindings/mfd/st,stmpe.yaml
+++ b/Documentation/devicetree/bindings/mfd/st,stmpe.yaml
@@ -127,6 +127,10 @@ properties:
... |
3001ed2b4e06da2276c42ace6551617065a5b1f9 | Analyze and fix the following issue in the Linux kernel code: mfd: tps6586x: Fix OF node refcount | Problem Details:
Platform devices created with platform_device_alloc() call
platform_device_release() when the last reference to the device's
kobject is dropped. This function calls of_node_put() unconditionally.
This works fine for devices created with platform_device_register_full()
but users of the split approach (p... | ```diff
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index 8d5fe2b60bfa..f5f805446603 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -397,7 +397,7 @@ static int tps6586x_add_subdevs(struct tps6586x *tps6586x,
pdev->dev.parent = tps6586x->dev;
pdev->dev.platform_data = subdev... |
a44ec8fd3839434c0c85ae68106a94081a31341f | Analyze and fix the following issue in the Linux kernel code: mfd: si476x-i2c: Fix spelling mistakes in comments | Problem Details:
Fix spelling mistake in comments:
- succes -> success (4 times)
Signed-off-by: Md Shofiqul Islam <shofiqtest@gmail.com>
Link: https://patch.msgid.link/20260514181954.1442-1-shofiqtest@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org> | ```diff
diff --git a/drivers/mfd/si476x-i2c.c b/drivers/mfd/si476x-i2c.c
index 899c0b5ea3aa..7ddc97dfc940 100644
--- a/drivers/mfd/si476x-i2c.c
+++ b/drivers/mfd/si476x-i2c.c
@@ -30,7 +30,7 @@
*
* Configure the functions of the pins of the radio chip.
*
- * The function returns zero in case of succes or negative ... |
b6ef1a74b3ec254f87a6a3c554fe8f8083ebd37c | Analyze and fix the following issue in the Linux kernel code: mfd: cs42l43: Sanity check firmware size | Problem Details:
Currently the code checks if a firmware was received, however it does
not verify that the firmware size is larger than the firmware header. As
the firmware pointer is dereferenced as a pointer to the header
structure this could lead to an out of bounds memory access. Add the
missing check.
Fixes: ace6... | ```diff
diff --git a/drivers/mfd/cs42l43.c b/drivers/mfd/cs42l43.c
index 166881751e69..ed6d93893de0 100644
--- a/drivers/mfd/cs42l43.c
+++ b/drivers/mfd/cs42l43.c
@@ -722,7 +722,7 @@ static void cs42l43_mcu_load_firmware(const struct firmware *firmware, void *con
unsigned int loadaddr, val;
int ret;
- if (!firmwa... |
8b2c1d41bc36c100b38ce5ee6def246c527eaf8a | Analyze and fix the following issue in the Linux kernel code: mfd: cros_ec: Delay dev_set_drvdata() until probe success | Problem Details:
If ec_device_probe() fails, cros_ec_class_release releases memory for the
cros_ec_dev structure. However, because the drvdata was already set,
sub-drivers like cros_ec_typec can still retrieve the stale pointer via the
platform device. This leads to a use-after-free when cros_ec_typec attempts
to acces... | ```diff
diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
index 70d64b7c6243..11ee1146cf71 100644
--- a/drivers/mfd/cros_ec_dev.c
+++ b/drivers/mfd/cros_ec_dev.c
@@ -191,7 +191,6 @@ static int ec_device_probe(struct platform_device *pdev)
if (!ec)
return retval;
- dev_set_drvdata(dev, ec);
ec-... |
7b7b7fa42d08087a9d5f3d49453dbe721cbbd2d4 | Analyze and fix the following issue in the Linux kernel code: mfd: max77759: Improve static struct formatting and commentary | Problem Details:
Improve code style. This includes the following:
- Formatting the max77759_chgr_irqs entries to fit in a single line
instead of breaking them into multiple lines to improve readability.
- Refactoring comments such that they're full sentences and have
punctuation marks for a couple of macro definit... | ```diff
diff --git a/drivers/mfd/max77759.c b/drivers/mfd/max77759.c
index 9fa6027a92c4..b50433e7b3d3 100644
--- a/drivers/mfd/max77759.c
+++ b/drivers/mfd/max77759.c
@@ -286,38 +286,22 @@ static const struct regmap_irq max77759_topsys_irqs[] = {
};
static const struct regmap_irq max77759_chgr_irqs[] = {
- REGMAP_I... |
6bc38f26ed07197b11a2b588edf1f43bfbc81d76 | Analyze and fix the following issue in the Linux kernel code: mfd: rsmu: Fix page register setup | Problem Details:
Fix writes to page register in 8A3400x family (Clock Matrix).
All calls to rsmu_write_page_register() (both in i2c and spi) have
resulted in early return, because all addresses in
include/linux/mfd/idt8a340_reg.h are less than RSMU_CM_SCSR_BASE.
There were 2 separate patch series which have to be mer... | ```diff
diff --git a/drivers/mfd/rsmu_i2c.c b/drivers/mfd/rsmu_i2c.c
index cba64f107a2f..9e5fc8259eec 100644
--- a/drivers/mfd/rsmu_i2c.c
+++ b/drivers/mfd/rsmu_i2c.c
@@ -134,14 +134,10 @@ static int rsmu_i2c_write_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u8 by
static int rsmu_write_page_register(struct rsmu_d... |
8c2f0b42fc252e1bf1c7746447091a468e784ca1 | Analyze and fix the following issue in the Linux kernel code: mfd: sm501: Fix reference leak on failed device registration | Problem Details:
When platform_device_register() fails in sm501_register_device(), the
embedded struct device in pdev has already been initialized by
device_initialize(), but the failure path only reports the error and
returns without dropping the device reference for the current platform
device:
sm501_register_devi... | ```diff
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
index 0ee6d8940e69..8276456b142f 100644
--- a/drivers/mfd/sm501.c
+++ b/drivers/mfd/sm501.c
@@ -704,9 +704,11 @@ static int sm501_register_device(struct sm501_devdata *sm,
if (ret >= 0) {
dev_dbg(sm->dev, "registered %s\n", pdev->name);
list_add_tai... |
6a2cb13761d90ef3fa960db189a2cc1bdf965ae1 | Analyze and fix the following issue in the Linux kernel code: mfd: bd72720: Drop BUCK11 ID | Problem Details:
The BD72720 header reserves an ID for BUCK11. While this does not (at
the moment) cause problems I can see, it is misleading as the BD72720
contains only 10 BUCKs.
Make the code clearer and drop the BUCK11 ID.
Fixes: af25277b1ddc ("mfd: rohm-bd71828: Support ROHM BD72720")
Signed-off-by: Matti Vaitti... | ```diff
diff --git a/include/linux/mfd/rohm-bd72720.h b/include/linux/mfd/rohm-bd72720.h
index ae7343bcab06..d8ddbf232bb3 100644
--- a/include/linux/mfd/rohm-bd72720.h
+++ b/include/linux/mfd/rohm-bd72720.h
@@ -21,7 +21,6 @@ enum {
BD72720_BUCK8,
BD72720_BUCK9,
BD72720_BUCK10,
- BD72720_BUCK11,
BD72720_LDO1,
... |
938fda9671dd07196f4e591d30977b2e69d8f320 | Analyze and fix the following issue in the Linux kernel code: leds: Fix sysfs ABI date | Problem Details:
The "multi_max_intensity" sysfs attribute was not included
in kernel 7.1, so update the KernelVersion and Date tags
accordingly.
Fixes: b1a9b7a904af ("leds: Introduce the multi_max_intensity sysfs attribute")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/20260527001422.5111... | ```diff
diff --git a/Documentation/ABI/testing/sysfs-class-led-multicolor b/Documentation/ABI/testing/sysfs-class-led-multicolor
index 197da3e775b4..62ce58f393d6 100644
--- a/Documentation/ABI/testing/sysfs-class-led-multicolor
+++ b/Documentation/ABI/testing/sysfs-class-led-multicolor
@@ -26,8 +26,8 @@ Description: re... |
9ba15b2eb87ec33a9037343785e44594df4a59fc | Analyze and fix the following issue in the Linux kernel code: leds: Fix CONFIG_OF dependency for LEDS_LP5860_CORE | Problem Details:
Building LEDS_LP5860_SPI without CONFIG_OF leads to a build time warning:
WARNING: unmet direct dependencies detected for LEDS_LP5860_CORE
Depends on [n]: NEW_LEDS [=y] && LEDS_CLASS_MULTICOLOR [=y] && LEDS_CLASS [=y] && OF [=n]
Selected by [y]:
- LEDS_LP5860_SPI [=y] && NEW_LEDS [=y] && LEDS_CL... | ```diff
diff --git a/drivers/leds/rgb/Kconfig b/drivers/leds/rgb/Kconfig
index 5599b71be54d..6e9ab5f60714 100644
--- a/drivers/leds/rgb/Kconfig
+++ b/drivers/leds/rgb/Kconfig
@@ -56,6 +56,7 @@ config LEDS_LP5860_CORE
config LEDS_LP5860_SPI
tristate "LED Support for TI LP5860 SPI LED driver chip"
depends on SPI
+ d... |
c19fe864f667afc49d1391d764e20b66555bcf7a | Analyze and fix the following issue in the Linux kernel code: leds: uleds: Fix potential buffer overread | Problem Details:
The name string supplied by userspace is not guaranteed to be
null-terminated, so using strchr() on it might result in a buffer
overread. The same thing will happen when said string is used by
the LED class device.
Fix this by using strnchr() instead and explicitly check that
the name string is proper... | ```diff
diff --git a/drivers/leds/uleds.c b/drivers/leds/uleds.c
index 470015e3f802..6affa581b61d 100644
--- a/drivers/leds/uleds.c
+++ b/drivers/leds/uleds.c
@@ -102,7 +102,8 @@ static ssize_t uleds_write(struct file *file, const char __user *buffer,
name = udev->user_dev.name;
if (!name[0] || !strcmp(name, ".")... |
f92135f100669b508dd62b424ab20bcb33494c79 | Analyze and fix the following issue in the Linux kernel code: leds: core: Fix race condition for software blink | Problem Details:
led_set_brightness() function: Change handling of software blink to
avoid race conditions when stopping blink and setting brightness.
Triggers may call led_set_brightness(LED_OFF),
led_set_brightness(LED_FULL) in quick succession to disable blinking and
turn the LED on. If the delayed work task has no... | ```diff
diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c
index 385e78af1dac..073c547068cc 100644
--- a/drivers/leds/led-core.c
+++ b/drivers/leds/led-core.c
@@ -303,24 +303,31 @@ EXPORT_SYMBOL_GPL(led_stop_software_blink);
void led_set_brightness(struct led_classdev *led_cdev, unsigned int brightness)
... |
2682d6308654850ee4d4f9b3bbe3a31417890594 | Analyze and fix the following issue in the Linux kernel code: leds: Introduce the multi_max_intensity sysfs attribute | Problem Details:
Some multicolor LEDs support global brightness control in hardware,
meaning that the maximum intensity of the color components is not
connected to the maximum global brightness. Such LEDs cannot be
described properly by the current multicolor LED class interface,
because it assumes that the maximum int... | ```diff
diff --git a/Documentation/ABI/testing/sysfs-class-led-multicolor b/Documentation/ABI/testing/sysfs-class-led-multicolor
index 16fc827b10cb..197da3e775b4 100644
--- a/Documentation/ABI/testing/sysfs-class-led-multicolor
+++ b/Documentation/ABI/testing/sysfs-class-led-multicolor
@@ -16,9 +16,22 @@ Date: March 2... |
a03484e1e42893e2b219d9d780ce6933d319ef46 | Analyze and fix the following issue in the Linux kernel code: leds: blinkm: Fix spelling and comment style above lock acquire | Problem Details:
Fix two issues in the comment above mutex_lock_interruptible() in
blinkm_transfer_hw():
- Spelling mistake (Aquire -> Acquire).
- Trailing "*/" was on the same line as text; move it to its own
line to match kernel coding style.
No functional change.
Signed-off-by: Stepan Ionichev <sozdayvek@... | ```diff
diff --git a/drivers/leds/leds-blinkm.c b/drivers/leds/leds-blinkm.c
index 577497b9d426..1978bbda47db 100644
--- a/drivers/leds/leds-blinkm.c
+++ b/drivers/leds/leds-blinkm.c
@@ -356,7 +356,8 @@ static int blinkm_transfer_hw(struct i2c_client *client, int cmd)
struct blinkm_data *data = i2c_get_clientdata(cli... |
d92e7ca6931910e72ebbed7ff96f4f74c24cf0d8 | Analyze and fix the following issue in the Linux kernel code: leds: as3668: Fix Kconfig symbol name mismatch in Makefile | Problem Details:
kconfiglint reports:
X001: CONFIG_LEDS_AS3668 referenced in Makefile but not defined
in any Kconfig
The AS3668 LED driver was introduced in
commit c7dd343a3756 ("leds:
as3668: Driver for the ams Osram 4-channel i2c LED driver").
That commit defined the Kconfig symbol as LEDS_OSRAM_AMS_AS366... | ```diff
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 8fdb45d5b439..7db3768912ca 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -15,7 +15,7 @@ obj-$(CONFIG_LEDS_ADP5520) += leds-adp5520.o
obj-$(CONFIG_LEDS_AN30259A) += leds-an30259a.o
obj-$(CONFIG_LEDS_APU) += leds-apu.o
obj... |
7bf097d90e0439c3b601ed72758706a6978c7a41 | Analyze and fix the following issue in the Linux kernel code: docs: leds: Fix sysfs ABI reference in lp5812.rst | Problem Details:
Documentation/ABI/testing/sysfs-class-led-multicolor is a plain ABI
description without a .rst suffix. The lp5812 documentation incorrectly
referred to sysfs-class-led-multicolor.rst, which does not exist.
This was reported by documentation-file-ref-check (make refcheckdocs).
Signed-off-by: Xinhong H... | ```diff
diff --git a/Documentation/leds/leds-lp5812.rst b/Documentation/leds/leds-lp5812.rst
index c2a6368d5149..12e757d45c3a 100644
--- a/Documentation/leds/leds-lp5812.rst
+++ b/Documentation/leds/leds-lp5812.rst
@@ -20,7 +20,7 @@ Sysfs Interface
===============
This driver uses the standard multicolor LED class ... |
40f0b1047918539f0b0f795ac65e35336b4c2c78 | Analyze and fix the following issue in the Linux kernel code: xfrm: validate selector family and prefixlen during match | Problem Details:
syzbot reported a shift-out-of-bounds in xfrm_selector_match()
due to AF_UNSPEC selector with large prefixlen (e.g. 128) matched
against IPv4 flow (when XFRM_STATE_AF_UNSPEC is set).
Fix this by:
- Rejecting mismatched families in xfrm_selector_match.
- Returning false in addr4_match if prefixlen > 3... | ```diff
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 35a743129329..f8c909b0f0c3 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -943,6 +943,9 @@ static inline bool addr_match(const void *token1, const void *token2,
unsigned int pdw;
unsigned int pbi;
+ if (prefixlen > 128)
+ return fals... |
007800408002d871f5699bdb944f985896730b8f | Analyze and fix the following issue in the Linux kernel code: espintcp: use sk_msg_free_partial to fix partial send | Problem Details:
sk_msg_free_partial() ensures consistency of the skmsg at every
iteration, without having to manually handle uncharges and offsets.
This simplifies the code, and fixes some bugs in skmsg accounting when
we don't send the full contents.
Cc: stable@vger.kernel.org
Fixes: e27cca96cd68 ("xfrm: add espintc... | ```diff
diff --git a/net/xfrm/espintcp.c b/net/xfrm/espintcp.c
index d9035546375e..374e1b964438 100644
--- a/net/xfrm/espintcp.c
+++ b/net/xfrm/espintcp.c
@@ -212,43 +212,23 @@ static int espintcp_sendskmsg_locked(struct sock *sk,
struct sk_msg *skmsg = &emsg->skmsg;
bool more = flags & MSG_MORE;
struct scatterli... |
68de007d5ac9df0e3f4f187a179c5c842bb5a2be | Analyze and fix the following issue in the Linux kernel code: xfrm: annotate data-races around xfrm_policy_count[] and xfrm_policy_default[] | Problem Details:
KCSAN reported a data race involving net->xfrm.policy_count access.
Add missing READ_ONCE()/WRITE_ONCE() annotations on
xfrm_policy_count and xfrm_policy_default.
Fixes: 2518c7c2b3d7 ("[XFRM]: Hash policies when non-prefixed.")
Reported-by: syzbot+d85ba1c732720b9a4097@syzkaller.appspotmail.com
Closes... | ```diff
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 874409127e29..35a743129329 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1250,8 +1250,8 @@ int __xfrm_policy_check(struct sock *, int dir, struct sk_buff *skb,
static inline bool __xfrm_check_nopolicy(struct net *net, struct sk_buff *skb... |
ddd3d0132920319ac426e12456013eadbae67e15 | Analyze and fix the following issue in the Linux kernel code: xfrm: Fix xfrm state cache insertion race | Problem Details:
The xfrm input state cache insertion code checks the validity of
the state before acquiring the global xfrm_state_lock. Thus it's
possible for someone else to kill the state after it passed the
validity check, and then the insertion will add the dead state
to the cache.
Fix this by moving the validit... | ```diff
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index d8457ceaf28c..9e87f7028201 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -1207,9 +1207,11 @@ struct xfrm_state *xfrm_input_state_lookup(struct net *net, u32 mark,
struct hlist_head *state_cache_input;
struct xfrm_state *x =... |
218cfe364b55b2768221629bd4a69ad190b7fbbc | Analyze and fix the following issue in the Linux kernel code: i2c: imx-lpi2c: mark I2C adapter when hardware is powered down | Problem Details:
On some i.MX platforms, certain I2C client drivers keep a periodic
workqueue which continues to trigger I2C transfers.
During system suspend/resume, there exists a time window between:
- suspend_noirq and the system entering suspend
- the system starting to resume and resume_noirq
In this window,... | ```diff
diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index cd4da50c4dd9..e6c24a9d934d 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -1646,7 +1646,18 @@ static int __maybe_unused lpi2c_runtime_resume(struct device *dev)
static int _... |
7d69804a35103a50852eae41bfe6a2e0061c68fd | Analyze and fix the following issue in the Linux kernel code: ALSA: usb-audio: qcom: Free sideband sg_table objects | Problem Details:
The Qualcomm USB audio offload driver obtains an endpoint transfer-ring
table by calling xhci_sideband_get_endpoint_buffer(). This getter passes
the endpoint ring to xhci_ring_to_sgtable(), which allocates the outer
struct sg_table with kzalloc_obj(*sgt). The event-ring path is
equivalent: xhci_sideban... | ```diff
diff --git a/sound/usb/qcom/qc_audio_offload.c b/sound/usb/qcom/qc_audio_offload.c
index a3f90cc7c6ca..436d6821c5c9 100644
--- a/sound/usb/qcom/qc_audio_offload.c
+++ b/sound/usb/qcom/qc_audio_offload.c
@@ -1160,6 +1160,7 @@ uaudio_endpoint_setup(struct snd_usb_substream *subs,
tr_pa = page_to_phys(pg);
mem... |
4a60127debb9e370d6c0e22a307326b624a141f3 | Analyze and fix the following issue in the Linux kernel code: ALSA: compress: Fix task creation error unwind | Problem Details:
snd_compr_task_new() allocates the driver task before validating the
returned DMA buffers and reserving file descriptors. When either of
those later steps fails, the core frees its task wrapper and DMA-buffer
references without calling the driver's task_free() callback. Any
driver resources allocated b... | ```diff
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index fd63d219bf86..ea699491f0c3 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -1083,15 +1083,18 @@ static int snd_compr_task_new(struct snd_compr_stream *stream, struct snd_compr_
file descriptor... |
111bb7f9f4a90b32e495d70a607c67b137f3074a | Analyze and fix the following issue in the Linux kernel code: i2c: stm32f7: truncate clock period instead of rounding it | Problem Details:
stm32f7_i2c_compute_timing() derives the I2C clock source period
(i2cclk) with DIV_ROUND_CLOSEST, which may round it up. When the
period is overestimated, all timings computed from it (SCLDEL,
SDADEL, SCLL, SCLH) come out shorter on the wire than calculated,
and the resulting bus rate can exceed the re... | ```diff
diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index 16c6e61c7e11..d6d993b436cb 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -464,8 +464,13 @@ static int stm32f7_i2c_compute_timing(struct stm32f7_i2c_dev *i2c_dev,
{
struct stm32f7_i... |
ae9f812df3149729643d27d2af488c112f62af9a | Analyze and fix the following issue in the Linux kernel code: gpiolib: acpi: Prevent out-of-bounds pin access in OperationRegion handler | Problem Details:
The ACPI GPIO OperationRegion handler receives pin offsets as a
64-bit address. Previously, this value could be assigned to a pin index
without validation, potentially causing out-of-bounds access if
the ACPI table provides an invalid offset.
This patch explicitly checks that the 64-bit address is les... | ```diff
diff --git a/drivers/gpio/gpiolib-acpi-core.c b/drivers/gpio/gpiolib-acpi-core.c
index b09f89832890..220f0ac4204e 100644
--- a/drivers/gpio/gpiolib-acpi-core.c
+++ b/drivers/gpio/gpiolib-acpi-core.c
@@ -1098,10 +1098,10 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address,
struct gpio_ch... |
dece79032f529d2c9fdbf63a9f2fc32244722775 | Analyze and fix the following issue in the Linux kernel code: gpiolib: acpi: Add robust bounds-checking for GPIO pin resources | Problem Details:
Ensure that GPIO pin resource arrays are safely bounded before accessing
indices. Add explicit bounds checking in acpi_request_own_gpiod(),
acpi_gpio_irq_is_wake(), and acpi_gpiochip_alloc_event() to prevent
out-of-bounds array reads if the ACPI namespace provides malformed or empty
pin tables.
This c... | ```diff
diff --git a/drivers/gpio/gpiolib-acpi-core.c b/drivers/gpio/gpiolib-acpi-core.c
index 1a762a2988b7..b09f89832890 100644
--- a/drivers/gpio/gpiolib-acpi-core.c
+++ b/drivers/gpio/gpiolib-acpi-core.c
@@ -316,10 +316,17 @@ static struct gpio_desc *acpi_request_own_gpiod(struct gpio_chip *chip,
unsigned int... |
289cf458a69ccda4a4aee2b0274d233d415814ca | Analyze and fix the following issue in the Linux kernel code: erofs: call erofs_exit_ishare() before rcu_barrier() | Problem Details:
Ensure all inode free callbacks have completed before
destroying the inode slab cache.
Fixes: 5ef3208e3be5 ("erofs: introduce the page cache share feature")
Reviewed-by: Hongbo Li <lihongbo22@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> | ```diff
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 802add6652fd..579443e6acfe 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -1048,11 +1048,11 @@ shrinker_err:
static void __exit erofs_module_exit(void)
{
unregister_filesystem(&erofs_fs_type);
+ erofs_exit_ishare();
- /* Ensure all RCU free i... |
1c8951963d8ed357f70f59e0ad4ddce2199d2016 | Analyze and fix the following issue in the Linux kernel code: ksmbd: fix path resolution in ksmbd_vfs_kern_path_create | Problem Details:
The SMB2 open lookup is rooted at the share with LOOKUP_BENEATH, but the
create/mkdir/hardlink sink is not: ksmbd_vfs_kern_path_create() builds an
absolute path with convert_to_unix_name() and resolves it from AT_FDCWD
via start_creating_path(), so a ".." component is walked from the real
filesystem ro... | ```diff
diff --git a/fs/smb/server/misc.c b/fs/smb/server/misc.c
index a543ec9d3581..966004c414a8 100644
--- a/fs/smb/server/misc.c
+++ b/fs/smb/server/misc.c
@@ -283,39 +283,6 @@ char *ksmbd_extract_sharename(struct unicode_map *um, const char *treename)
return ksmbd_casefold_sharename(um, name);
}
-/**
- * conve... |
be6d26bf27499977c746abc163659915082348d8 | Analyze and fix the following issue in the Linux kernel code: ksmbd: serialize QUERY_DIRECTORY requests per file | Problem Details:
smb2_query_dir() stores a pointer to its stack-allocated private data in
the ksmbd_file readdir_data. Concurrent QUERY_DIRECTORY requests using the
same file handle can overwrite this pointer while an iterate_dir() callback
is still using it, resulting in a stack use-after-free.
Add a per-file mutex a... | ```diff
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 32f568cea16a..96dcb78cfb92 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -4569,6 +4569,8 @@ int smb2_query_dir(struct ksmbd_work *work)
ksmbd_debug(SMB, "Search pattern is %s\n", srch_ptr);
}
+ mutex_lock(&dir_fp... |
388e4139db27a9e3612c9d356b826f5b1ff6a9e3 | Analyze and fix the following issue in the Linux kernel code: ksmbd: add permission checks for FSCTL_DUPLICATE_EXTENTS_TO_FILE | Problem Details:
The FSCTL_DUPLICATE_EXTENTS_TO_FILE arm of smb2_ioctl() overwrites the
destination file's data via vfs_clone_file_range() with neither the
share-level KSMBD_TREE_CONN_FLAG_WRITABLE check nor a per-handle
fp->daccess check that the other write-bearing arms carry. A client can
overwrite destination data ... | ```diff
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 4e0087931795..32f568cea16a 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -8766,6 +8766,17 @@ int smb2_ioctl(struct ksmbd_work *work)
goto dup_ext_out;
}
+ if (!test_tree_conn_flag(work->tcon,
+ KSMBD_TREE... |
20c8442dc1003f9f7bb522d3dcd81d09ea59a79e | Analyze and fix the following issue in the Linux kernel code: ksmbd: enforce FILE_READ_ATTRIBUTES on SMB_FIND_FILE_POSIX_INFORMATION | Problem Details:
find_file_posix_info() in smb2_query_info() returns file metadata (owner
uid, group gid, mode, inode, size, allocation size, hard-link count and all
four timestamps) but performs no per-handle access check. Every sibling
query handler gates on the handle's granted access first --
get_file_basic_info(),... | ```diff
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 9efafa56c03e..4e0087931795 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -5437,6 +5437,12 @@ static int find_file_posix_info(struct smb2_query_info_rsp *rsp,
int out_buf_len = sizeof(struct smb311_posix_qinfo) + 32;
... |
609ca17d869d04ba249e32cdcbf13c0b1c66f43c | Analyze and fix the following issue in the Linux kernel code: ksmbd: reject non-VALID session in compound request branch | Problem Details:
smb2_check_user_session() takes a shortcut for any operation that is not
the first in a COMPOUND request: it reuses work->sess (the session bound by
the first operation) and validates only the SessionId, then returns
"valid". It never re-checks work->sess->state == SMB2_SESSION_VALID, and a
SessionId o... | ```diff
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index ae451e77689c..9efafa56c03e 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -615,6 +615,11 @@ int smb2_check_user_session(struct ksmbd_work *work)
sess_id, work->sess->id);
return -EINVAL;
}
+ if (work->sess-... |
13f3942f2bf45856bb751faed2f0c4618f41ca20 | Analyze and fix the following issue in the Linux kernel code: ksmbd: add per-handle permission check to FILE_LINK_INFORMATION | Problem Details:
The FILE_LINK_INFORMATION arm of smb2_set_info_file() calls
smb2_create_link() with no per-handle fp->daccess check. On the
ReplaceIfExists path smb2_create_link() unlinks an existing file at the
target name (ksmbd_vfs_remove_file) and creates a hardlink
(ksmbd_vfs_link); neither helper checks daccess.... | ```diff
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 42669402637d..f9106b35e63c 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -6575,6 +6575,11 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
}
case FILE_LINK_INFORMATION:
{
+ if (!(f... |
3320ba068198adc144c89d6661b805acce01735b | Analyze and fix the following issue in the Linux kernel code: ksmbd: add a permission check for FSCTL_SET_ZERO_DATA | Problem Details:
FSCTL_SET_ZERO_DATA in smb2_ioctl() destroys file data via
ksmbd_vfs_zero_data() -> vfs_fallocate(PUNCH_HOLE/ZERO_RANGE) after
checking only the share-level KSMBD_TREE_CONN_FLAG_WRITABLE, with no
per-handle access check. A handle opened with only FILE_WRITE_ATTRIBUTES
still yields an FMODE_WRITE filp (... | ```diff
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index a2c6ff7d8b89..42669402637d 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -8565,6 +8565,12 @@ int smb2_ioctl(struct ksmbd_work *work)
goto out;
}
+ if (!(fp->daccess & FILE_WRITE_DATA_LE)) {
+ ksmbd_fd_pu... |
44df157a1183a7f746caa970c169255da5ac61f8 | Analyze and fix the following issue in the Linux kernel code: ksmbd: add a WRITE_DAC/WRITE_OWNER check to SMB2 SET_INFO SECURITY | Problem Details:
commit cc57232cae23 ("ksmbd: fix FSCTL permission bypass by adding a
permission check for FSCTL_SET_SPARSE") added a fp->daccess gate to
fsctl_set_sparse and noted that "similar handle-level checks exist in other
functions but are missing here." The SMB2 SET_INFO SECURITY arm is one of
the missing ones... | ```diff
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 06c92af288fc..a2c6ff7d8b89 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -6632,6 +6632,9 @@ static int smb2_set_info_sec(struct ksmbd_file *fp, int addition_info,
fp->saccess |= FILE_SHARE_DELETE_LE;
+ if (!(fp->d... |
10f293a07f9e10e988b0ae44e2e99c631f5a68e0 | Analyze and fix the following issue in the Linux kernel code: ksmbd: fix use-after-free of a deferred file_lock on SMB2_CLOSE then SMB2_CANCEL | Problem Details:
Commit f580d27e8928 ("ksmbd: fix use-after-free of a deferred file_lock on
double SMB2_CANCEL") made smb2_cancel() skip a work whose state is
KSMBD_WORK_CANCELLED, so its cancel_fn cannot be fired a second time. But
KSMBD_WORK has three states (ACTIVE, CANCELLED, CLOSED), and the same
freeing producer ... | ```diff
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 327ec625d42b..06c92af288fc 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -7349,14 +7349,14 @@ int smb2_cancel(struct ksmbd_work *work)
continue;
/*
- * A cancelled deferred byte-range lock frees its
- *... |
f4d556008fd443c05dc599ae3b1bd56c56c93741 | Analyze and fix the following issue in the Linux kernel code: smb/server: fix incorrect file size in get_file_compression_info() | Problem Details:
Before this patch, we got the wrong file size:
- client: touch /mnt/file
- client: smbinfo setcompression default /mnt/file
- client: dd if=/dev/zero of=/mnt/file bs=1 count=1000
- client: smbinfo filecompressioninfo /mnt/file
Compressed File Size: 4096
Compression Form... | ```diff
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 6258a8a92c56..327ec625d42b 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -5292,7 +5292,7 @@ static int get_file_compression_info(struct smb2_query_info_rsp *rsp,
return ret;
file_info = (struct smb2_file_comp_inf... |
54bab9ba5a9f156ffa9324fcbe5a356fd0242f95 | Analyze and fix the following issue in the Linux kernel code: ksmbd: prevent path traversal bypass by restricting caseless retry | Problem Details:
ksmbd_vfs_path_lookup() enforces LOOKUP_BENEATH to restrict path
resolution within the share root. When a crafted path attempts to
escape the share boundary using parent-directory components ('..'),
vfs_path_parent_lookup() detects this and immediately fails,
returning -EXDEV.
However, a bug exists in... | ```diff
diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c
index cd1dbca0cffb..18c0a7c6b41b 100644
--- a/fs/smb/server/vfs.c
+++ b/fs/smb/server/vfs.c
@@ -1140,7 +1140,7 @@ int __ksmbd_vfs_kern_path(struct ksmbd_work *work, char *filepath,
retry:
err = ksmbd_vfs_path_lookup(share_conf, filepath, flags, path, f... |
d20d1c8ba5765d1d12eefc0aee6385ab3f240e1e | Analyze and fix the following issue in the Linux kernel code: ksmbd: fix UAF of struct file_lock in SMB2_LOCK deferred-lock cancellation | Problem Details:
When a blocking byte-range lock request is deferred in the
FILE_LOCK_DEFERRED path, ksmbd registers the asynchronous work into
the connection's async_requests list via setup_async_work(). The cancel
callback smb2_remove_blocked_lock() holds a reference to the flock.
If the lock waiter is subsequently ... | ```diff
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 00e63debcbe9..82f93b191c6c 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -7755,29 +7755,27 @@ skip:
list_del(&work->fp_entry);
spin_unlock(&fp->f_lock);
- if (work->state != KSMBD_WORK_ACTIVE) {
- lis... |
65b655f65c3ca1ab5d598d3832bb0ff531725858 | Analyze and fix the following issue in the Linux kernel code: ksmbd: fix use-after-free in same_client_has_lease() | Problem Details:
same_client_has_lease() returns an opinfo pointer from ci->m_op_list
after dropping ci->m_lock without taking a reference.
smb_grant_oplock() then dereferences that pointer in copy_lease() and
when checking breaking_cnt. A concurrent close can remove the old lease
from ci->m_op_list and drop the last ... | ```diff
diff --git a/fs/smb/server/oplock.c b/fs/smb/server/oplock.c
index b193dde4810d..60e7e821c245 100644
--- a/fs/smb/server/oplock.c
+++ b/fs/smb/server/oplock.c
@@ -528,7 +528,12 @@ static struct oplock_info *same_client_has_lease(struct ksmbd_inode *ci,
ret = compare_guid_key(opinfo, client_guid, lctx->leas... |
1ef06004ed4bd6d3ed8c840d9d1a376b66d4935b | Analyze and fix the following issue in the Linux kernel code: ksmbd: fix out-of-bounds read in smb_check_perm_dacl() | Problem Details:
The permission-check ACE walk in smb_check_perm_dacl() validates the ACE
header size and caps sid.num_subauth at SID_MAX_SUB_AUTHORITIES, but it
never checks that ace->size is actually large enough to contain
num_subauth sub-authorities before compare_sids() dereferences them.
CIFS_SID_BASE_SIZE cover... | ```diff
diff --git a/fs/smb/server/smbacl.c b/fs/smb/server/smbacl.c
index 664b1b4a3233..340ea98fa494 100644
--- a/fs/smb/server/smbacl.c
+++ b/fs/smb/server/smbacl.c
@@ -1477,7 +1477,9 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
break;
aces_size -= ace_size;
- if (ace->sid.nu... |
f09d2312d1d44a8b8c9d3bfd33acfe930a6d8250 | Analyze and fix the following issue in the Linux kernel code: rust: bitfield: mark `Debug` impl as `#[inline]` | Problem Details:
A `Debug` impl is for debugging and is normally not used, and therefore
should ideally not be code-generated unless used. However, Rust has no way
of knowing if a dependent crate is going to use the trait impl or not, so
unless it is marked as `#[inline]`, it will be code-generated in the
defining crat... | ```diff
diff --git a/rust/kernel/bitfield.rs b/rust/kernel/bitfield.rs
index 554a5a2ff0ab..35ede53f2b8e 100644
--- a/rust/kernel/bitfield.rs
+++ b/rust/kernel/bitfield.rs
@@ -535,6 +535,7 @@ macro_rules! bitfield {
// `Debug` implementation.
(@debug $name:ident { $($field:ident;)* }) => {
impl ::kern... |
6ee2ba9dcefe5bb41d179e183919531c8da01d14 | Analyze and fix the following issue in the Linux kernel code: i2c: ls2x-v2: return IRQ_HANDLED after servicing an error | Problem Details:
The event ISR reads SR1 and, when an error flag (ARLO/AF/BERR) is set,
calls loongson2_i2c_isr_error() which clears the offending flag, issues
STOP for the AF case, records msg->result, masks every CR2 interrupt
enable and completes the waiter. The handler then returns IRQ_NONE,
declaring to the IRQ co... | ```diff
diff --git a/drivers/i2c/busses/i2c-ls2x-v2.c b/drivers/i2c/busses/i2c-ls2x-v2.c
index 517760d70169..9df73557ecc4 100644
--- a/drivers/i2c/busses/i2c-ls2x-v2.c
+++ b/drivers/i2c/busses/i2c-ls2x-v2.c
@@ -304,7 +304,7 @@ static irqreturn_t loongson2_i2c_isr_event(int irq, void *data)
regmap_read(priv->regmap, L... |
d954a67a7dfa58b7a9b3194322d321b940eb60c8 | Analyze and fix the following issue in the Linux kernel code: ipv4: fib_rule: Move fib4_rules_exit() to ->exit(). | Problem Details:
syzbot reported use-after-free of net->ipv4.rules_ops. [0]
It can be reproduced with these commands:
while true; do
ip netns add ns1
ip -n ns1 link set dev lo up
ip -n ns1 address add 192.0.2.1/24 dev lo
ip -n ns1 link add name dummy1 up type dummy
ip -n ns1 address add 198.51.100.1/... | ```diff
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index c7d1f31650d7..42212970d735 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -1612,10 +1612,6 @@ static void ip_fib_net_exit(struct net *net)
fib_free_table(tb);
}
}
-
-#ifdef CONFIG_IP_MULTIPLE_TABLES
- fib4_rules... |
46762cefe7f4e5bffc1eb467810a7bbb02e461d7 | Analyze and fix the following issue in the Linux kernel code: net: serialize netif_running() check in enqueue_to_backlog() | Problem Details:
Syzbot reported a KASAN slab-use-after-free in fib_rules_lookup().
The root cause is a race condition where packets can escape the backlog
flushing during device unregistration (e.g., during netns exit).
Commit e9e4dd3267d0 ("net: do not process device backlog during unregistration")
introduced a loc... | ```diff
diff --git a/net/core/dev.c b/net/core/dev.c
index 569c10b122f6..5c01dfaa6c44 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5383,8 +5383,6 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu,
u32 tail;
reason = SKB_DROP_REASON_DEV_READY;
- if (unlikely(!netif_running(skb->dev)))
- goto b... |
ff3ac1a0bd75400375678c0f81c2b613cbc03e14 | Analyze and fix the following issue in the Linux kernel code: io_uring: Use system_dfl_wq instead of system_unbound_wq | Problem Details:
Commit de7341ffe49e ("io_uring: switch normal task_work to a mpscq")
added a use of system_unbound_wq, which is deprecated in favor of
system_dfl_wq added by commit 128ea9f6ccfb ("workqueue: Add
system_percpu_wq and system_dfl_wq"). An upcoming warning in the
workqueue tree flags this with:
workqueu... | ```diff
diff --git a/io_uring/tw.c b/io_uring/tw.c
index f2ce806b01a1..a4c872870d81 100644
--- a/io_uring/tw.c
+++ b/io_uring/tw.c
@@ -51,7 +51,7 @@ static void io_fallback_tw(struct io_uring_task *tctx)
* the queued work) stay around until the drain has run.
*/
get_task_struct(tctx->task);
- if (!queue_work(sy... |
406e8a651a7b854c41fecd5117bb282b3a6c2c6b | Analyze and fix the following issue in the Linux kernel code: net: skmsg: preserve sg.copy across SG transforms | Problem Details:
The sk_msg sg.copy bitmap is part of the scatterlist entry ownership
state. A set bit tells sk_msg_compute_data_pointers() not to expose the
entry through writable BPF ctx->data. This protects entries backed by
pages that are not private to the sk_msg, such as splice-backed file
page-cache pages.
Seve... | ```diff
diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h
index 19f4f253b4f9..937823856de5 100644
--- a/include/linux/skmsg.h
+++ b/include/linux/skmsg.h
@@ -4,6 +4,7 @@
#ifndef _LINUX_SKMSG_H
#define _LINUX_SKMSG_H
+#include <linux/bitops.h>
#include <linux/bpf.h>
#include <linux/filter.h>
#include <li... |
79ce29e100ab3de0cad66eb48d32a7de4043e2ae | Analyze and fix the following issue in the Linux kernel code: i3c: master: Add missing runtime PM get in dev_nack_retry_count_store() | Problem Details:
Ensure the device is runtime resumed while updating the retry
configuration to avoid accessing the controller while suspended.
Call i3c_master_rpm_get() before accessing the controller in
dev_nack_retry_count_store() and release it with
i3c_master_rpm_put() afterwards.
Fixes: 990c149c61ee4 ("i3c: mas... | ```diff
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 05ea9e3c4d46..a24944047e30 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -767,12 +767,18 @@ static ssize_t dev_nack_retry_count_store(struct device *dev,
if (ret)
return ret;
+ ret = i3c_master_rpm_get(master);
+ if (ret)
+ ... |
ab5f9c5cb527c03790a92142ad368881a9100aaf | Analyze and fix the following issue in the Linux kernel code: i3c: master: Update dev_nack_retry_count under maintenance lock | Problem Details:
Protect master->dev_nack_retry_count against concurrent sysfs updates
by updating it while holding the bus maintenance lock.
Consequently, combine adjacent return statements into one.
For consistency, read dev_nack_retry_count while holding the bus normaluse
lock.
Fixes: b58f47eb39268 ("i3c: add sys... | ```diff
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 372d911ecbad..05ea9e3c4d46 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -744,7 +744,14 @@ static DEVICE_ATTR_RW(hotjoin);
static ssize_t dev_nack_retry_count_show(struct device *dev,
struct device_attribute *attr, char *bu... |
d5b58fbb2fd7ac25fcd7e1c14730f998a90b0322 | Analyze and fix the following issue in the Linux kernel code: block: respect iov_iter::nofault flag in bio_iov_iter_bounce_write() | Problem Details:
For the incoming usage of IOMAP_DIO_BOUNCE in btrfs, btrfs has set
iov_iter::nofault to prevent deadlock when a page fault is needed to
read out the buffer.
However bio_iov_iter_bounce_write() doesn't respect iov_iter::nofault
flag, and just call a plain copy_from_iter() so it can still trigger
page f... | ```diff
diff --git a/block/bio.c b/block/bio.c
index 96f40d39b62b..f2a5f4d0a967 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1335,7 +1335,11 @@ static int bio_iov_iter_bounce_write(struct bio *bio, struct iov_iter *iter,
break;
bio_add_folio_nofail(bio, folio, this_len, 0);
- copied = copy_from_iter(folio_a... |
b68d4979c88e31488970373f67ac79b4f6267008 | Analyze and fix the following issue in the Linux kernel code: block: revert the iov_iter after a short copy in bio_iov_iter_bounce_write() | Problem Details:
For the incoming IOMAP_DIO_BOUNCE flag usage inside btrfs, it's pretty
easy to hit short copy inside bio_iov_iter_bounce_write().
This is because btrfs has disabled page fault to avoid certain deadlock
during direct writes, and instead btrfs manually fault in the pages then
retry.
And inside bio_iov_... | ```diff
diff --git a/block/bio.c b/block/bio.c
index 811a96796202..96f40d39b62b 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1321,6 +1321,7 @@ static int bio_iov_iter_bounce_write(struct bio *bio, struct iov_iter *iter,
do {
size_t this_len = min(total_len, SZ_1M);
+ size_t copied;
struct folio *folio;
... |
66b6605bcea7af7aca3d1d858b9c5f14903f9f9a | Analyze and fix the following issue in the Linux kernel code: spi: dw: fix wrong BAUDR setting after resume | Problem Details:
After resuming from suspend to ram, spi transfer stops working. Further
debugging shows that the BAUDR register isn't correctly set, this is
due to dws->current_freq doesn't match the HW BAUDR setting,
specifically, the dws->current_freq equals to speed_hz, but BAUDR is 0.
so the dw_spi_set_clk() in be... | ```diff
diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h
index 9cc79c566a70..2f2debc64e73 100644
--- a/drivers/spi/spi-dw.h
+++ b/drivers/spi/spi-dw.h
@@ -282,6 +282,7 @@ static inline void dw_spi_shutdown_chip(struct dw_spi *dws)
{
dw_spi_enable_chip(dws, 0);
dw_spi_set_clk(dws, 0);
+ dws->current_freq = ... |
f3ad1c87d8201e54b66bd6072442f0b5d5a308ee | Analyze and fix the following issue in the Linux kernel code: spi: uniphier: Fix completion initialization order before devm_request_irq() | Problem Details:
The driver calls devm_request_irq() before initializing the completion
used by the interrupt handler. Because the interrupt may occur immediately
after devm_request_irq(), the handler may execute before init_completion().
This may result in calling complete() on an uninitialized completion,
causing un... | ```diff
diff --git a/drivers/spi/spi-uniphier.c b/drivers/spi/spi-uniphier.c
index cc20fd11f03f..86fce9a571da 100644
--- a/drivers/spi/spi-uniphier.c
+++ b/drivers/spi/spi-uniphier.c
@@ -656,6 +656,8 @@ static int uniphier_spi_probe(struct platform_device *pdev)
priv->host = host;
priv->is_save_param = false;
+ i... |
f1b061b4d4c6cbf861319ba954caa80145cf018f | Analyze and fix the following issue in the Linux kernel code: spi: Add NULL check for spi_get_device_id() in spi_get_device_match_data() | Problem Details:
Prevent NULL pointer dereference when spi_get_device_id() returns NULL,
which can happen when using driver_override without matching SPI ID entry.
Signed-off-by: guoqi0226 <guoqi0226@163.com>
Link: https://patch.msgid.link/20260616103018.105612-3-guoqi0226@163.com
Signed-off-by: Mark Brown <broonie@ke... | ```diff
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index fe7e3b3b98fc..ab37b50bbf79 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -355,12 +355,16 @@ EXPORT_SYMBOL_GPL(spi_get_device_id);
const void *spi_get_device_match_data(const struct spi_device *sdev)
{
const void *match;
+ const struct spi_... |
7caf2a2351d4053075670ff3e26a6815da0a9e1e | Analyze and fix the following issue in the Linux kernel code: accel/amdxdna: Use caller client for debug BO sync | Problem Details:
amdxdna_drm_sync_bo_ioctl() looks up args->handle in the ioctl caller's
drm_file. For SYNC_DIRECT_FROM_DEVICE, it then calls
amdxdna_hwctx_sync_debug_bo(), but passes abo->client.
amdxdna_hwctx_sync_debug_bo() uses the passed client both as the handle
namespace for debug_bo_hdl and as the owner of the... | ```diff
diff --git a/drivers/accel/amdxdna/amdxdna_gem.c b/drivers/accel/amdxdna/amdxdna_gem.c
index 6e367ddb9e1b..6c16b21994ab 100644
--- a/drivers/accel/amdxdna/amdxdna_gem.c
+++ b/drivers/accel/amdxdna/amdxdna_gem.c
@@ -1027,6 +1027,7 @@ int amdxdna_drm_get_bo_info_ioctl(struct drm_device *dev, void *data, struct dr... |
d9c8c45e6d2f438a3c8e643ae78b59454fa0fadd | Analyze and fix the following issue in the Linux kernel code: RDMA/irdma: Replace waitqueue and flag with completion | Problem Details:
The driver previously used a waitqueue along with an explicit
request_done flag, but without proper barriers around request_done.
An earlier patch by Gui-Dong Han <hanguidong02@gmail.com> attempted
to fix this by adding the missing memory barriers. Rather than
adding the barriers, this patch replaces ... | ```diff
diff --git a/drivers/infiniband/hw/irdma/hw.c b/drivers/infiniband/hw/irdma/hw.c
index f9be467d137f..c345cc654256 100644
--- a/drivers/infiniband/hw/irdma/hw.c
+++ b/drivers/infiniband/hw/irdma/hw.c
@@ -235,8 +235,7 @@ static void irdma_complete_cqp_request(struct irdma_cqp *cqp,
struct irdma_cqp_re... |
c0bd03b850d81a8914168d87ddf7f6ffa58875ef | Analyze and fix the following issue in the Linux kernel code: RDMA/hns: Fix memory leak of bonding resources | Problem Details:
In a corner case of concurrent driver removal and driver reset,
bonding resource is first released in hns_roce_hw_v2_exit() during
driver removal, and then is allocated again in hns_roce_register_device()
during driver reset. This leads to memory leak because the release
timing has already passed. This... | ```diff
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 332a4816f2ca..2b3a1cafd1b2 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -7654,8 +7654,8 @@ static int __init hns_roce_hw_v2_init(void)
stat... |
963af8d97a8c6a117134a8d0db1415e0489200b1 | Analyze and fix the following issue in the Linux kernel code: RDMA/rtrs-srv: Bound RDMA-Write length to chunk size in rdma_write_sg | Problem Details:
When the server answers an RTRS READ, rdma_write_sg() builds the source
scatter/gather entry for the IB_WR_RDMA_WRITE that returns data to the
peer. Its length is taken directly from the wire descriptor:
plist->length = le32_to_cpu(id->rd_msg->desc[0].len);
rd_msg points into the chunk buffer that ... | ```diff
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
index f2fd80c8a044..7d8e4422cc57 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
@@ -225,8 +225,9 @@ static int rdma_write_sg(struct rtrs_srv_op *id)
/* WR will fail wi... |
33a215f499b0643cd88a32ab5b8de1547be419c6 | Analyze and fix the following issue in the Linux kernel code: RDMA/bnxt_re: Reject GET_TOGGLE_MEM when toggle page was not allocated | Problem Details:
If a user calls BNXT_RE_METHOD_GET_TOGGLE_MEM on a device that does not
support the CQ/SRQ toggle feature, uctx_cq_page or uctx_srq_page will
be NULL.
Add an explicit -EOPNOTSUPP return after capturing the address from
uctx_cq_page / uctx_srq_page if the address is zero.
Fixes: e275919d9669 ("RDMA/bn... | ```diff
diff --git a/drivers/infiniband/hw/bnxt_re/uapi.c b/drivers/infiniband/hw/bnxt_re/uapi.c
index 19f92d6a46c0..263238a6e4cd 100644
--- a/drivers/infiniband/hw/bnxt_re/uapi.c
+++ b/drivers/infiniband/hw/bnxt_re/uapi.c
@@ -277,6 +277,8 @@ static int UVERBS_HANDLER(BNXT_RE_METHOD_GET_TOGGLE_MEM)(struct uverbs_attr_b... |
a57592c6392a8e333c9c2731701297a5a279313a | Analyze and fix the following issue in the Linux kernel code: RDMA/bnxt_re: Fail DBR related page allocation UAPIs if the feature is disabled | Problem Details:
No need to support the DBR related page allocations if the pacing feature
is disabled. Fail the request if pacing is disabled.
Fixes: ea2224857882 ("RDMA/bnxt_re: Update alloc_page uapi for pacing")
Link: https://patch.msgid.link/r/20260615224751.232802-15-selvin.xavier@broadcom.com
Reviewed-by: Sriha... | ```diff
diff --git a/drivers/infiniband/hw/bnxt_re/uapi.c b/drivers/infiniband/hw/bnxt_re/uapi.c
index 7e5a55d29076..19f92d6a46c0 100644
--- a/drivers/infiniband/hw/bnxt_re/uapi.c
+++ b/drivers/infiniband/hw/bnxt_re/uapi.c
@@ -121,12 +121,16 @@ static int UVERBS_HANDLER(BNXT_RE_METHOD_ALLOC_PAGE)(struct uverbs_attr_bun... |
441baa79043431807115fd030d7d0bb14ed441a0 | Analyze and fix the following issue in the Linux kernel code: RDMA/bnxt_re: Avoid repeated requests to allocate WC pages | Problem Details:
Applications can request multiple WC pages for the same ucontext.
As of now, only 1 WC page per ucontext is supported. Add a lock to
avoid concurrent access and a check to fail repeated requests.
Also, if the mmap entry insert fails for the WC, free the Doorbell
page index mapped for the WC page.
Fixe... | ```diff
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index c3570bf0204f..565762529007 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -4770,6 +4770,7 @@ int bnxt_re_alloc_ucontext(struct ib_ucontext *ctx, struct ... |
0b5ed2756d45b04669502a1f13b1657ec7664571 | Analyze and fix the following issue in the Linux kernel code: drm/xe: Add compact-PT and addr mask handling for page reclaim | Problem Details:
Current implementation of generate_reclaim_entry() overlooks some
differences between the different page implementations: address masking
and compact 64K page handling.
Address masking of each leaf varies depending on the leaf entry size.
generate_reclaim_entry() is using XE_PTE_ADDR_MASK [51:12] for ... | ```diff
diff --git a/drivers/gpu/drm/xe/regs/xe_gtt_defs.h b/drivers/gpu/drm/xe/regs/xe_gtt_defs.h
index 4d83461e538b..d6bc19ef277b 100644
--- a/drivers/gpu/drm/xe/regs/xe_gtt_defs.h
+++ b/drivers/gpu/drm/xe/regs/xe_gtt_defs.h
@@ -9,7 +9,11 @@
#define XELPG_GGTT_PTE_PAT0 BIT_ULL(52)
#define XELPG_GGTT_PTE_PAT1 BIT_UL... |
632ecc90e1ca5d3b6822bb4d08f84a175b6c42c0 | Analyze and fix the following issue in the Linux kernel code: drm/xe/guc: Fix buffer overflow in steered register list allocation | Problem Details:
The size calculation for the steered register extarray uses only the
geometry DSS mask (g_dss_mask) to determine the number of entries to
allocate:
total = bitmap_weight(gt->fuse_topo.g_dss_mask, ...) * steer_reg_num;
However, the filling loop uses for_each_dss_steering(), which iterates
over for_e... | ```diff
diff --git a/drivers/gpu/drm/xe/xe_guc_capture.c b/drivers/gpu/drm/xe/xe_guc_capture.c
index 21f7caf9ea08..1a019137ddf4 100644
--- a/drivers/gpu/drm/xe/xe_guc_capture.c
+++ b/drivers/gpu/drm/xe/xe_guc_capture.c
@@ -461,8 +461,14 @@ static void guc_capture_alloc_steered_lists(struct xe_guc *guc)
if (!list || g... |
ba7fd163422877ad5a5cf31306a38c07d3932b0c | Analyze and fix the following issue in the Linux kernel code: drm/xe: Set TTM device beneficial_order to 9 (2M) | Problem Details:
Set the TTM device beneficial_order to 9 (2M), which is the sweet
spot for Xe when attempting reclaim on system memory BOs, as it matches
the large GPU page size. This ensures reclaim is attempted at the most
effective order for the driver.
This fixes an issue where an order-10 (4M) allocation cannot ... | ```diff
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index d224861b6f6f..abe25aedeead 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -526,7 +526,8 @@ int xe_device_init_early(struct xe_device *xe)
err = ttm_device_init(&xe->ttm, &xe_ttm_funcs, xe-... |
92dc59ab2a09097cdf249e0288ff9b69261761c6 | Analyze and fix the following issue in the Linux kernel code: drm/xe: Fix wa_oob codegen recipe for external module builds | Problem Details:
When building with 'make M=drivers/gpu/drm/xe modules', kbuild invokes
scripts/Makefile.build with obj=., causing $(obj) to expand to '.'.
Make normalizes './xe_gen_wa_oob' to 'xe_gen_wa_oob' when constructing
the $^ automatic variable (target name normalization), so the recipe
command becomes just 'xe... | ```diff
diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
index 09661f079d03..8e7b146880f4 100644
--- a/drivers/gpu/drm/xe/Makefile
+++ b/drivers/gpu/drm/xe/Makefile
@@ -16,14 +16,14 @@ subdir-ccflags-y += -I$(obj) -I$(src)
hostprogs := xe_gen_wa_oob
generated_oob := $(obj)/generated/xe_wa_oob.c ... |
770031ec2312bfab307d05db5469f24fd297e758 | Analyze and fix the following issue in the Linux kernel code: drm/xe: fix job timeout recovery for unstarted jobs and kernel queues | Problem Details:
A job that GuC never scheduled (never started) indicates a GuC
scheduling failure; previously such jobs were silently errored out
instead of triggering a GT reset to recover. Trigger a GT reset and
resubmit them, but only when the queue was not already killed or banned:
an unstarted job on an already b... | ```diff
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index 4b247a3019d2..12a410458df6 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -157,6 +157,11 @@ static void set_exec_queue_banned(struct xe_exec_queue *q)
atomic_or(EXEC_QUEUE_ST... |
0b837315ca0adc317e5c8a9c7e484a0e29199b9b | Analyze and fix the following issue in the Linux kernel code: drm/xe: fix refcount leak in xe_range_fence_insert() | Problem Details:
xe_range_fence_insert() acquires a reference on fence via
dma_fence_get() and stores it in rfence->fence. It then calls
dma_fence_add_callback() and handles two cases: when the callback
is successfully registered (err == 0) the fence is transferred to
the tree for later cleanup; when the fence is alre... | ```diff
diff --git a/drivers/gpu/drm/xe/xe_range_fence.c b/drivers/gpu/drm/xe/xe_range_fence.c
index 372378e89e98..3d8fa194a7b0 100644
--- a/drivers/gpu/drm/xe/xe_range_fence.c
+++ b/drivers/gpu/drm/xe/xe_range_fence.c
@@ -77,6 +77,8 @@ int xe_range_fence_insert(struct xe_range_fence_tree *tree,
} else if (err == 0) ... |
f2d238408db2b963951f0f2ae70ff7f9e337b540 | Analyze and fix the following issue in the Linux kernel code: drm/xe: include all registered queues in TLB invalidation | Problem Details:
Context-based TLB invalidation currently selects only scheduling-active
exec queues via q->ops->active(). During rebind flows, queues may be
suspended (or transitioning through resume) while still owning valid
translations, causing them to be skipped from invalidation and leading
to missed TLB invalida... | ```diff
diff --git a/drivers/gpu/drm/xe/xe_guc_tlb_inval.c b/drivers/gpu/drm/xe/xe_guc_tlb_inval.c
index ced58f46f846..cf6d106e6036 100644
--- a/drivers/gpu/drm/xe/xe_guc_tlb_inval.c
+++ b/drivers/gpu/drm/xe/xe_guc_tlb_inval.c
@@ -255,9 +255,8 @@ static int send_tlb_inval_ctx_ppgtt(struct xe_tlb_inval *tlb_inval, u32 s... |
d46319bc8273c1018fa532a383eb515ee1b1de4b | Analyze and fix the following issue in the Linux kernel code: drm/xe/hw_error: Use HW_ERR prefix in log | Problem Details:
Hardware errors should be logged with HW_ERR prefix. Make them
consistent with existing logs.
Fixes: 01aab7e1c9d4 ("drm/xe/xe_hw_error: Add support for PVC SoC errors")
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
Link: https://patch.msgid.link/2026... | ```diff
diff --git a/drivers/gpu/drm/xe/xe_hw_error.c b/drivers/gpu/drm/xe/xe_hw_error.c
index 5135e8e4093f..4b72959b2276 100644
--- a/drivers/gpu/drm/xe/xe_hw_error.c
+++ b/drivers/gpu/drm/xe/xe_hw_error.c
@@ -223,9 +223,9 @@ static void log_hw_error(struct xe_tile *tile, const char *name,
struct xe_device *xe = til... |
042f1d5f20d63fb9b0e2fbba97648d16fe1a845d | Analyze and fix the following issue in the Linux kernel code: drm/xe/drm_ras: Add per node cleanup action | Problem Details:
cleanup_node_param() is not registered for previous node in case of counter
allocation failure, which results in stale memory of previous node that
isn't cleaned up on unwind. Add per node cleanup action which guarantees
cleanup on unwind and also simplifies the cleanup logic.
Fixes: b40db12b542f ("dr... | ```diff
diff --git a/drivers/gpu/drm/xe/xe_drm_ras.c b/drivers/gpu/drm/xe/xe_drm_ras.c
index c1d5ac198a7c..cd236f53699e 100644
--- a/drivers/gpu/drm/xe/xe_drm_ras.c
+++ b/drivers/gpu/drm/xe/xe_drm_ras.c
@@ -131,53 +131,47 @@ static int assign_node_params(struct xe_device *xe, struct drm_ras_node *node,
return 0;
}
... |
45fa032b68570a9ccd80328a857ac5872217be92 | Analyze and fix the following issue in the Linux kernel code: drm/xe/drm_ras: Make counter allocation drm managed | Problem Details:
cleanup_node_param() is not registered for previous node in case of counter
allocation failure, which results in stale memory of previous node that
isn't cleaned up on unwind. Fix this using drm managed allocation, which is
guaranteed to be cleaned up on unwind.
Fixes: b40db12b542f ("drm/xe/xe_drm_ras... | ```diff
diff --git a/drivers/gpu/drm/xe/xe_drm_ras.c b/drivers/gpu/drm/xe/xe_drm_ras.c
index c21c8b428de6..c1d5ac198a7c 100644
--- a/drivers/gpu/drm/xe/xe_drm_ras.c
+++ b/drivers/gpu/drm/xe/xe_drm_ras.c
@@ -80,7 +80,7 @@ static struct xe_drm_ras_counter *allocate_and_copy_counters(struct xe_device *x
struct xe_drm_ra... |
65280af331aa15eab7012bd7f07823be13754ba2 | Analyze and fix the following issue in the Linux kernel code: drm/xe/multi_queue: skip submit when primary queue is suspended | Problem Details:
Return early in submit path when the multi-queue primary exec
queue is suspended to avoid submitting while suspended.
v2: Remove idle_skip_suspend fix as that feature is being
reverted here https://patchwork.freedesktop.org/series/167262/
Fixes: bc5775c59258 ("drm/xe/multi_queue: Add GuC interface fo... | ```diff
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index 122a0983df18..4b247a3019d2 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -1151,9 +1151,12 @@ static void submit_exec_queue(struct xe_exec_queue *q, struct xe_sched_job *job)
... |
1141574cb85db5226042b3d903157f95bfc631b1 | Analyze and fix the following issue in the Linux kernel code: drm/xe: Clear pending_disable before signaling suspend fence | Problem Details:
In the schedule-disable done path for suspend, we
signal the suspend fence before clearing pending_disable.
That wakeup can let suspend_wait complete and resume be queued
immediately. The resume path may then reach enable_scheduling()
while pending_disable is still set and hit the
!exec_queue_pending_... | ```diff
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index d1ab66ca1856..122a0983df18 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -2791,8 +2791,8 @@ static void handle_sched_done(struct xe_guc *guc, struct xe_exec_queue *q,
xe_gt... |
65b1f95802f90fea0283f226317dc02dba494c81 | Analyze and fix the following issue in the Linux kernel code: Revert "drm/xe: Skip exec queue schedule toggle if queue is idle during suspend" | Problem Details:
This reverts commit 8533051ce92015e9cc6f75e0d52119b9d91610b6.
The idle-skip optimization bypasses GuC suspend, so the GPU may not
perform the context switch that flushes TLB entries for invalidated
userptr VMAs. In LR/preempt-fence VM mode, this can lead to missed TLB
invalidation and page faults duri... | ```diff
diff --git a/drivers/gpu/drm/xe/xe_exec_queue.h b/drivers/gpu/drm/xe/xe_exec_queue.h
index a82d99bd77bc..0225426c57b0 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue.h
+++ b/drivers/gpu/drm/xe/xe_exec_queue.h
@@ -162,21 +162,4 @@ int xe_exec_queue_contexts_hwsp_rebase(struct xe_exec_queue *q, void *scratch);
str... |
b4b15e4f12ad1dd83b69d453ef826553917eb8cb | Analyze and fix the following issue in the Linux kernel code: Revert "drm/xe/nvls: Define GuC firmware for NVL-S" | Problem Details:
This reverts commit 4e88de313ff4d1c67b644b1f39f9fb4089711b71.
The early GuC FW definition meant for our CI branch was accidentally
merged to the drm-xe-next branch instead. This GuC FW will never be
released to linux-firmware, so we do not want the definition to be
available in the mainline Linux code... | ```diff
diff --git a/drivers/gpu/drm/xe/xe_uc_fw.c b/drivers/gpu/drm/xe/xe_uc_fw.c
index df2aa196f6f9..3f08a3b54062 100644
--- a/drivers/gpu/drm/xe/xe_uc_fw.c
+++ b/drivers/gpu/drm/xe/xe_uc_fw.c
@@ -115,7 +115,6 @@ struct fw_blobs_by_type {
#define XE_GT_TYPE_ANY XE_GT_TYPE_UNINITIALIZED
#define XE_GUC_FIRMWARE_DEF... |
062499cc4813b5a3cbed5dd4fbe0177265858450 | Analyze and fix the following issue in the Linux kernel code: drm/i915/mtl+: Enable PPS before PLL | Problem Details:
Enabling PPS after a display port's PLL is enabled leads to PLL / DDI
BUF timeouts during system resuming after a long (> 45 mins) suspended
state, at least on some ARL and MTL laptops, either all or some of them
also containing an Nvidia GPU. Enabling PPS first and then the PLL fixes
the problem for a... | ```diff
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 205978c9feb6..6296635c4e79 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -2652,9 +2652,6 @@ static void mtl_ddi_pre_enable_dp(struct intel_atomic_state... |
31f077088e0faae6be8377741f356dea1b94ba46 | Analyze and fix the following issue in the Linux kernel code: drm/i915: clear CRTC color blob pointers after dropping refs | Problem Details:
intel_crtc_put_color_blobs() drops the CRTC color blob references, but
leaves the corresponding pointers unchanged.
This can matter in intel_crtc_prepare_cleared_state(), which frees the
old CRTC hw state before calling intel_dp_tunnel_atomic_clear_stream_bw().
The latter can fail while looking up the... | ```diff
diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c
index 0e4f0678c53c..9d0d47c79dd1 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic.c
@@ -288,6 +288,12 @@ static void intel_crtc_put_color_blobs(struct in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.