id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
e898c505b0ee4efb5b2dad9f494c94f74b478ab0
Analyze and fix the following issue in the Linux kernel code: perf kwork: Fix memory management of kwork_work
Problem Details: This commit addresses several memory management issues in builtin-kwork.c: 1. Implements a global cleanup function perf_kwork__exit to free all kwork_work and kwork_atom_page objects at the end of the command. 2. Ensures all 'name' fields in struct kwork_work are malloc-ed (or NULL) and properl...
```diff diff --git a/tools/perf/builtin-kwork.c b/tools/perf/builtin-kwork.c index a4604e152002..f793ea578515 100644 --- a/tools/perf/builtin-kwork.c +++ b/tools/perf/builtin-kwork.c @@ -323,8 +323,8 @@ static struct kwork_work *work_search(struct rb_root_cached *root, else if (cmp < 0) node = node->rb_right; ...
ca426c0f6e9cce1db51348cfc8048a42e39cfa9a
Analyze and fix the following issue in the Linux kernel code: perf kwork: Fix address sanitizer issues
Problem Details: There is a double free in the record array due to how parse_options will mutate the array. Fix by keeping an array that isn't mutated. Ensure kwork_usage is freed on all paths. Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@...
```diff diff --git a/tools/perf/builtin-kwork.c b/tools/perf/builtin-kwork.c index 59a54d11f7fa..a4604e152002 100644 --- a/tools/perf/builtin-kwork.c +++ b/tools/perf/builtin-kwork.c @@ -2258,7 +2258,7 @@ static void setup_event_list(struct perf_kwork *kwork, static int perf_kwork__record(struct perf_kwork *kwork, ...
fdec0a81cad5f14a7d3451a49acfa5adc898aa59
Analyze and fix the following issue in the Linux kernel code: perf build: Unconditionally set up libunwind feature build flags
Problem Details: A "make feature-dump" build does not specify LIBUNWIND=1 because it is run with the default configuration to detect system-wide capabilities. This sets NO_LIBUNWIND := 1, causing Makefile.config to skip setting LIBUNWIND_LIBS and FEATURE_CHECK_LDFLAGS-libunwind. Consequently, when Makefile.feature is ...
```diff diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index b56fa8419f7d..c531b9315609 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -79,42 +79,43 @@ ifeq ($(ARCH),s390) CFLAGS += -fPIC endif +# Unconditionally set up the libunwind feature build flags as a +# f...
8c63179d975f2029c948ecce622f72af616dbff7
Analyze and fix the following issue in the Linux kernel code: KVM: SVM: Only disable x2AVIC WRMSR interception for MSRs that are accelerated
Problem Details: When x2AVIC is enabled, disable WRMSR interception only for MSRs that are actually accelerated by hardware. Disabling interception for MSRs that aren't accelerated is functionally "fine", and in some cases a weird "win" for performance, but only for cases that should never be triggered by a well-behav...
```diff diff --git a/arch/x86/kvm/svm/avic.c b/arch/x86/kvm/svm/avic.c index 8e4926c7b8dc..724a45c2aa23 100644 --- a/arch/x86/kvm/svm/avic.c +++ b/arch/x86/kvm/svm/avic.c @@ -124,39 +124,6 @@ static void avic_set_x2apic_msr_interception(struct vcpu_svm *svm, { struct kvm_vcpu *vcpu = &svm->vcpu; u64 rd_regs; - - s...
7f4b7092d9a173a4271e28c0ed1fc235994e309b
Analyze and fix the following issue in the Linux kernel code: KVM: SVM: Disable x2AVIC RDMSR interception for MSRs KVM actually supports
Problem Details: When toggling x2AVIC on/off, use KVM's curated mask of x2APIC MSRs that can/should be passed through to the guest (or not) when 2AVIC is enabled. Using the effective list provided by the local APIC emulation fixes multiple (classes of) bugs, as the existing hand-coded list of MSRs is wrong on multiple ...
```diff diff --git a/arch/x86/kvm/svm/avic.c b/arch/x86/kvm/svm/avic.c index adf211860949..8e4926c7b8dc 100644 --- a/arch/x86/kvm/svm/avic.c +++ b/arch/x86/kvm/svm/avic.c @@ -122,6 +122,9 @@ static u32 x2avic_max_physical_id; static void avic_set_x2apic_msr_interception(struct vcpu_svm *svm, bool intercept)...
6ec863c1848167fdd7124717a24f0a2b99e160ba
Analyze and fix the following issue in the Linux kernel code: selftests: tls: use ASSERT_GE in test_mutliproc
Problem Details: In test_mutliproc(), when send() or recv() returns an error (e.g., -1), the test continues to execute the remaining code and fails repeatedly due to using EXPECT_GE. For example, if a TLS connection is broken and recv() returns -1, EXPECT_GE(res, 0) records a failure but does not stop the test. The te...
```diff diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c index 30a236b8e9f7..9b9a3cb2700d 100644 --- a/tools/testing/selftests/net/tls.c +++ b/tools/testing/selftests/net/tls.c @@ -1549,7 +1549,7 @@ test_mutliproc(struct __test_metadata *_metadata, struct _test_data_tls *self, res ...
7a978c2ac722d527852c0239ecc71108547c7a23
Analyze and fix the following issue in the Linux kernel code: perf stat: Make metric only column line up with header
Problem Details: Since some time the metric-only output columns are messed up and do not line up with the header, which makes it hard to read. I haven't bisected it, but presumably it was broken for some time. There were multiple problems: - The dummy pm invocation at the beginning did print a bogus field - The column...
```diff diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index 993f4c4b8f44..2b69d238858c 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -580,16 +580,13 @@ static void print_metricgroup_header_std(struct perf_stat_config *config, const char *metric...
aae9d8a5528b8ee9ff8dc5d3558b8a9f852a724a
Analyze and fix the following issue in the Linux kernel code: vsock: keep poll shutdown state consistent
Problem Details: vsock_poll() reads vsk->peer_shutdown before taking the socket lock to set EPOLLHUP and EPOLLRDHUP, then reads it again after taking the lock to report EOF readability. A shutdown packet can update peer_shutdown while poll is waiting for the lock, so one poll invocation can report EOF readability witho...
```diff diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 44037b066a5f..2ce1063d4a67 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -642,7 +642,7 @@ int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk) */ sock_reset_flag(sk, SOCK_DONE); sk->s...
c227f8aaf22cf5acc3a55a4fef1dd2bf110caebe
Analyze and fix the following issue in the Linux kernel code: net: mana: Expose hardware diagnostic info via debugfs
Problem Details: Add debugfs entries to expose hardware configuration and diagnostic information that aids in debugging driver initialization and runtime operations without adding noise to dmesg. The debugfs directory for each PCI device is named using pci_name() (the unique BDF address), and its creation and removal ...
```diff diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c index 3bc3fff55999..712a0881d720 100644 --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c @@ -227,6 +227,11 @@ static int mana_gd_query_max_res...
aa8963fdce667a42fb7f0bdd2909fadcab02f9a8
Analyze and fix the following issue in the Linux kernel code: tun: free page on build_skb failure in tun_xdp_one()
Problem Details: When build_skb() fails in tun_xdp_one(), the function sets ret to -ENOMEM and jumps to the out label, which returns without freeing the page that vhost_net_build_xdp() allocated for the frame. As with the short-frame rejection path, tun_sendmsg() discards the per-buffer error and still returns total_le...
```diff diff --git a/drivers/net/tun.c b/drivers/net/tun.c index f594360d66d6..9e7744eb57a3 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -2439,6 +2439,7 @@ static int tun_xdp_one(struct tun_struct *tun, build: skb = build_skb(xdp->data_hard_start, buflen); if (!skb) { + put_page(virt_to_head_page(xdp...
3bcf7aec6a9d16438f2cec29f5d7c8d5b8edf9b2
Analyze and fix the following issue in the Linux kernel code: tap: free page on error paths in tap_get_user_xdp()
Problem Details: tap_get_user_xdp() rejects a frame shorter than ETH_HLEN with -EINVAL, and returns -ENOMEM when build_skb() fails. Both paths jump to the err label without freeing the page that vhost_net_build_xdp() allocated for the frame. tap_sendmsg() discards the per-buffer return value and always returns 0, so vh...
```diff diff --git a/drivers/net/tap.c b/drivers/net/tap.c index a590e07ce0a9..fae115915c8e 100644 --- a/drivers/net/tap.c +++ b/drivers/net/tap.c @@ -1052,6 +1052,7 @@ static int tap_get_user_xdp(struct tap_queue *q, struct xdp_buff *xdp) int err, depth; if (unlikely(xdp->data_end - xdp->data < ETH_HLEN)) { + p...
bde2a04d9b6fd0e6442353416cf0de27d6925f0f
Analyze and fix the following issue in the Linux kernel code: selftests/tc-testing: Adapt idempotent qdisc notify callback tests to recent fq_codel changes
Problem Details: Commit 150061a20651 ("net/sched: fq_codel: local packets no longer count against memory limit") made fq_codel not account for local packets in the memory limit. Since tests a4bb, a4be, a4bf, a4c0, a4c1 were relying on these packets being accounted so that parent's qlen notify callback was executed, the...
```diff diff --git a/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json b/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json index 848696c373fc..3da9936e115d 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json +++ b/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.js...
dab48a7e74e6a394f3aa0461a2b1fb0c7b38fcb8
Analyze and fix the following issue in the Linux kernel code: Input: ims-pcu - fix usb_free_coherent() size in ims_pcu_buffers_free()
Problem Details: The input buffer size is pcu->max_in_size, but pcu->max_out_size is passed to usb_free_coherent(). Change size to match the allocation size. Fixes: 628329d52474 ("Input: add IMS Passenger Control Unit driver") Cc: stable@vger.kernel.org Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com> Link: h...
```diff diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c index 4c022a36dbe8..7a1cb9333f53 100644 --- a/drivers/input/misc/ims-pcu.c +++ b/drivers/input/misc/ims-pcu.c @@ -1624,7 +1624,7 @@ static void ims_pcu_buffers_free(struct ims_pcu *pcu) usb_kill_urb(pcu->urb_in); usb_free_urb(pcu->urb_...
3494dff89779b73a6c70481c982e0e96d336454a
Analyze and fix the following issue in the Linux kernel code: cpufreq: conservative: Simplify frequency limit handling
Problem Details: cs_dbs_update() performs explicit checks against policy->min/max before updating the target frequency. These checks are redundant as __cpufreq_driver_target() already clamps the requested frequency to the valid policy limits. Remove the unnecessary boundary checks and simplify the update logic. This ...
```diff diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index df01d33993d8..0b32ae28ec85 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -103,10 +103,6 @@ static unsigned int cs_dbs_update(struct cpufreq_policy *policy) i...
aa70232cc7431d517e0402d90c38e11b67414049
Analyze and fix the following issue in the Linux kernel code: cpufreq: Fix typo in comment
Problem Details: Replace "diver" with "driver" in the comment describing CPUFREQ_NEED_UPDATE_LIMITS. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com> Reviewed-by: Lifeng Zheng <zhenglifeng1@huawei.com> Link: https://patch.msgid.link/396f64411431ffbb5b4f07d...
```diff diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 2ab691828e48..4d4b4ed24b30 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -434,7 +434,7 @@ struct cpufreq_driver { /* * Set by drivers that need to update internal upper and lower boundaries along * with the target ...
ebc1a345bf1166b22035f0cfbf877b9d0e80ba4e
Analyze and fix the following issue in the Linux kernel code: soc: ti: knav_qmss_acc: Fix kernel-doc Return: tag
Problem Details: Fix knav_init_acc_range() use of 'Return ...' instead of 'Return:' kernel-doc comment, which produces a warning with W=2: knav_qmss_acc.c:473: No description found for return value of 'knav_init_acc_range' Tested-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Sai Sree Kartheek Adivi <s-adi...
```diff diff --git a/drivers/soc/ti/knav_qmss_acc.c b/drivers/soc/ti/knav_qmss_acc.c index 269b4e75ae40..1f8b5acdd462 100644 --- a/drivers/soc/ti/knav_qmss_acc.c +++ b/drivers/soc/ti/knav_qmss_acc.c @@ -466,7 +466,7 @@ static const struct knav_range_ops knav_acc_range_ops = { * @node: device node * @range: qmms r...
cb1a271a4f20faae9a10891bfae2b543778d2b4a
Analyze and fix the following issue in the Linux kernel code: soc: ti: knav_qmss: Fix __iomem annotations and __be32 type
Problem Details: Fix several address-space and type annotation issues reported by sparse: - Change pdsp->command from 'void __iomem *' to 'u32 __iomem *' to match the other union members (acc_command, qos_command); adjust the offset in knav_queue_load_pdsp() from +0x18 to +0x6 to preserve the 24-byte offset. - F...
```diff diff --git a/drivers/soc/ti/knav_qmss.h b/drivers/soc/ti/knav_qmss.h index 9325e8ce2e25..037dc1b36645 100644 --- a/drivers/soc/ti/knav_qmss.h +++ b/drivers/soc/ti/knav_qmss.h @@ -123,7 +123,7 @@ struct knav_pdsp_info { const char *name; struct knav_reg_pdsp_regs __iomem *regs; union { - void __iome...
7650590dbf12a3d4a3d302cd33ac31270e39c43c
Analyze and fix the following issue in the Linux kernel code: soc: ti: knav_qmss: Fix kernel-doc Return: tags
Problem Details: Fix functions that use inline 'Returns ...' instead of 'Return:' kernel-doc comments, producing warnings with W=2: knav_qmss_queue.c:524: No description found for return value of 'knav_queue_open' Tested-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Sai Sree Kartheek Adivi <s-adivi@ti.com...
```diff diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index 68c55134ad6c..7e3c05554254 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c @@ -517,7 +517,7 @@ static int knav_queue_flush(struct knav_queue *qh) * Subsequent attempts to open a s...
7db27a04fb8a33a7f9904961ee6f3c75f65d1118
Analyze and fix the following issue in the Linux kernel code: soc: ti: knav_qmss: Rename global kdev to knav_qdev to fix -Wshadow
Problem Details: Building with W=2 (clang, LLVM=1) produces 22 -Wshadow warnings in knav_qmss_queue.c because the file-scoped singleton 'kdev' is shadowed by a parameter of the same name in 21 internal functions and one local variable, e.g.: knav_qmss_queue.c:194:49: warning: declaration shadows a variable in the ...
```diff diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index c5669a371312..52a30abb2caf 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c @@ -25,7 +25,7 @@ #include "knav_qmss.h" -static struct knav_device *kdev; +static struct knav_device *knav_...
bcbdaa1086c25a8a5d48e04e1b82fdfb0682b681
Analyze and fix the following issue in the Linux kernel code: cpufreq: intel_pstate: Sync policy->cur during CPU offline
Problem Details: When a CPU goes offline with HWP disabled, intel_pstate_set_min_pstate() sets the MSR_IA32_PERF_CTL to minimum frequency to prevent SMT siblings from being restricted. However, the policy->cur value was not updated, leaving it at the previous value. When the CPU comes back online, governor->limits() c...
```diff diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 1f093e346430..0fbbdbd5765c 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2984,10 +2984,12 @@ static int intel_cpufreq_cpu_offline(struct cpufreq_policy *policy) * from getting to lower pe...
85524e651d20944399322d46fb97960337831d43
Analyze and fix the following issue in the Linux kernel code: cpufreq: Documentation: fix sampling_down_factor range
Problem Details: The ondemand governor implementation accepts sampling_down_factor values from 1 to 100000 via MAX_SAMPLING_DOWN_FACTOR, but the documentation in admin-guide/pm/cpufreq.rst still says the valid range is 1 to 100. Update the documentation to match the actual code. Fixes: 2a0e49279850 ("cpufreq: User/ad...
```diff diff --git a/Documentation/admin-guide/pm/cpufreq.rst b/Documentation/admin-guide/pm/cpufreq.rst index dbe6d23a5d67..fdca59c955dc 100644 --- a/Documentation/admin-guide/pm/cpufreq.rst +++ b/Documentation/admin-guide/pm/cpufreq.rst @@ -516,7 +516,7 @@ This governor exposes the following tunables: of those task...
40ef3edf151e184d021917a5c4c771cc0870844a
Analyze and fix the following issue in the Linux kernel code: vfio/pci: Use a private flag to prevent power state change with VFs
Problem Details: The current implementation uses pci_num_vf() while holding the memory_lock to prevent changing the power state of a PF when VFs are enabled. This creates a lockdep circular dependency warning because memory_lock is held during device probing. [ 286.997167] ============================================...
```diff diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c index 041243a84d81..a28f1e99362c 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c @@ -271,8 +271,11 @@ int vfio_pci_set_power_state(struct vfio_pci_core_device *vdev, pci_power_t stat int ret; ...
f4feb1e20058e407cb00f45aff47f5b7e19a6bbf
Analyze and fix the following issue in the Linux kernel code: tun: free page on short-frame rejection in tun_xdp_one()
Problem Details: tun_xdp_one() returns -EINVAL on a frame shorter than ETH_HLEN without freeing the page that vhost_net_build_xdp() allocated for it. tun_sendmsg() discards that -EINVAL and still returns total_len, so vhost_tx_batch() takes the success path and never frees the page; each short frame in a batch leaks on...
```diff diff --git a/drivers/net/tun.c b/drivers/net/tun.c index b183189f1853..f594360d66d6 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -2394,8 +2394,10 @@ static int tun_xdp_one(struct tun_struct *tun, bool skb_xdp = false; struct page *page; - if (unlikely(datasize < ETH_HLEN)) + if (unlikely(data...
89818517c2ac011c753d328e048e6bffdc31f9bf
Analyze and fix the following issue in the Linux kernel code: vfio/pci: Fix sparse warning in vfio_pci_core_get_iomap()
Problem Details: Use IOMEM_ERR_PTR() when returning a void __iomem * rather than ERR_PTR(). This fixes a sparse warning, "different address spaces". Fixes: 859dc0f6253b ("vfio/pci: Replace vfio_pci_core_setup_barmap() with vfio_pci_core_get_iomap()") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore...
```diff diff --git a/include/linux/vfio_pci_core.h b/include/linux/vfio_pci_core.h index 7accd0eac457..4fa129fc5c64 100644 --- a/include/linux/vfio_pci_core.h +++ b/include/linux/vfio_pci_core.h @@ -244,10 +244,10 @@ static inline void __iomem __must_check * vfio_pci_core_get_iomap(struct vfio_pci_core_device *vdev, u...
e2d57ceaa72d074273b42fbe0d03b74f87d8b583
Analyze and fix the following issue in the Linux kernel code: drm/intel/display: Add support for pipe background color (v4)
Problem Details: Gen9 platforms allow CRTC's to be programmed with a background/canvas color below the programmable planes. Let's expose this as a property to allow userspace to program a desired value. This patch is based on earlier work by Chandra Konduru and Matt Roper. Between 2018 and now, intel/display has chan...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c index 3bfe09d81a4c..7ef870cd9a16 100644 --- a/drivers/gpu/drm/i915/display/intel_color.c +++ b/drivers/gpu/drm/i915/display/intel_color.c @@ -1102,19 +1102,37 @@ static void skl_get_config(struct intel_crtc_stat...
2a3987540cab00c5b24a82ec6b4dc5d18e41e112
Analyze and fix the following issue in the Linux kernel code: KVM: selftests: Fix vcpu_get_stats_fd() ioctl name
Problem Details: vcpu_get_stats_fd() invokes KVM_GET_STATS_FD, but its assertion reports KVM_CHECK_EXTENSION if the ioctl fails. Use KVM_GET_STATS_FD in the assertion so failures point at the ioctl that actually failed. Fixes: 1b78d474ce4e ("KVM: selftests: Add logic to detect if ioctl() failed because VM was killed"...
```diff diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h index 2ecaaa0e9965..04a910164a29 100644 --- a/tools/testing/selftests/kvm/include/kvm_util.h +++ b/tools/testing/selftests/kvm/include/kvm_util.h @@ -876,7 +876,7 @@ static inline int vcpu_get_stats_fd(s...
e1a9d791fd66ab2431b9e6f6f835823809869047
Analyze and fix the following issue in the Linux kernel code: USB: serial: cypress_m8: fix memory corruption with small endpoint
Problem Details: Make sure that the interrupt-out endpoint max packet size is at least eight bytes to avoid user-controlled slab corruption or NULL-pointer dereference should a malicious device report a smaller size. Fixes: 3416eaa1f8f8 ("USB: cypress_m8: Packet format is separate from characteristic size") Cc: stable...
```diff diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index afff1a0f4298..0b8a4e9d7bc5 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c @@ -445,6 +445,14 @@ static int cypress_generic_port_probe(struct usb_serial_port *port) return -ENODEV; } + /...
f6982769910ecddabdb5b8b9afdab0bb8b6668ac
Analyze and fix the following issue in the Linux kernel code: block: avoid use-after-free in disk_free_zone_resources()
Problem Details: The function disk_update_zone_resources() may call disk_free_zone_resources() in case of error, and following this, blk_revalidate_disk_zones() will again calls disk_free_zone_resources() if disk_update_zone_resources() failed. If a zone worker thread is being used (which is the default for a rotationa...
```diff diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 42ef830054dc..6a221c180889 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -2001,8 +2001,10 @@ static void disk_set_zones_cond_array(struct gendisk *disk, u8 *zones_cond) void disk_free_zone_resources(struct gendisk *disk) { - if (disk->zone...
0da9ab6c4e12e66dbd2e8f54481662225a79b7f5
Analyze and fix the following issue in the Linux kernel code: drm/xe/rtp: Fully parse the ruleset
Problem Details: The function rule_matches() short-circuits evaluation of the implicit conjunctions (each substring of rules not containing OR) and the explicit disjunctions (implicit conjunctions joined by OR). In other words: - in a conjunction, once a rule evaluate to false, we skip to the next OR (if any) to...
```diff diff --git a/drivers/gpu/drm/xe/tests/xe_rtp_test.c b/drivers/gpu/drm/xe/tests/xe_rtp_test.c index dfb15d81d799..642f6e090ad0 100644 --- a/drivers/gpu/drm/xe/tests/xe_rtp_test.c +++ b/drivers/gpu/drm/xe/tests/xe_rtp_test.c @@ -209,8 +209,7 @@ static const struct rtp_rules_test_case rtp_rules_cases[] = { { ...
78de481c75c34623f450abf0f4604344f9396593
Analyze and fix the following issue in the Linux kernel code: drm/msm/mdss: correct UBWC programming sequences
Problem Details: The UBWC registers in the MDSS region are not dependent on the UBWC version (it is an invalid assumption we inherited from the vendor SDE driver). Instead they are dependent only on the MDSS core revision. Rework UBWC programming to follow MDSS revision and to use required (aka encoder) UBWC version i...
```diff diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c index 754ceef38717..19ab0ff80049 100644 --- a/drivers/gpu/drm/msm/msm_mdss.c +++ b/drivers/gpu/drm/msm/msm_mdss.c @@ -166,22 +166,19 @@ static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss) return 0; } -static void msm_md...
90918794a4e2c3b440f8fcf3847765a8b1d81b25
Analyze and fix the following issue in the Linux kernel code: signal: clear JOBCTL_PENDING_MASK for caller in zap_other_threads()
Problem Details: When a multi-threaded process receives a stop signal (e.g., SIGSTOP), do_signal_stop() sets JOBCTL_STOP_PENDING and JOBCTL_STOP_CONSUME on all threads and sets signal->group_stop_count to the number of threads. If one of the threads concurrently calls execve(), de_thread() invokes zap_other_threads() t...
```diff diff --git a/kernel/signal.c b/kernel/signal.c index 2d102e025883..9c2b32c4d755 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1338,6 +1338,7 @@ int zap_other_threads(struct task_struct *p) int count = 0; p->signal->group_stop_count = 0; + task_clear_jobctl_pending(p, JOBCTL_PENDING_MASK); for...
9c954499d43aefac01c5dfb57a82b13d2dcf4b94
Analyze and fix the following issue in the Linux kernel code: fuse: reject fuse_notify() pagecache ops on directories
Problem Details: The operations FUSE_NOTIFY_STORE and FUSE_NOTIFY_RETRIEVE allow the FUSE daemon to actively write/read pagecache contents. For directories with FOPEN_CACHE_DIR, the pagecache is used as kernel-internal cache storage, and userspace is not supposed to have direct access to this cache - in particular, fu...
```diff diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 08d364ed7d6c..c105aaf9ff5d 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1793,6 +1793,10 @@ static int fuse_notify_store(struct fuse_conn *fc, unsigned int size, inode = fuse_ilookup(fc, nodeid, NULL); if (!inode) goto out_up_killsb; + if (!S_ISREG(i...
4e3d1b2c48ca6c55f1e9ca7f8dccc76f120f276c
Analyze and fix the following issue in the Linux kernel code: fuse: limit FUSE_NOTIFY_RETRIEVE to uptodate folios
Problem Details: FUSE_NOTIFY_RETRIEVE must be limited to uptodate folios; !uptodate folios can contain uninitialized data. Since FUSE_NOTIFY_RETRIEVE is intended to only return data that is already in the page cache and not wait for data from the FUSE daemon, treat !uptodate folios as if they weren't present. This onl...
```diff diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 5dda7080f4a9..08d364ed7d6c 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1912,6 +1912,10 @@ static int fuse_retrieve(struct fuse_mount *fm, struct inode *inode, folio = filemap_get_folio(mapping, index); if (IS_ERR(folio)) break; + if (!folio_test...
654ddf855bebd8d45a6e707f5dc2344921f5e0cf
Analyze and fix the following issue in the Linux kernel code: platform/x86: bitland-mifs-wmi: add CONFIG_LEDS_CLASS dependency
Problem Details: The newly added driver requires the LED classdev support and causes a link failure when that is disabled: x86_64-linux-ld: vmlinux.o: in function `bitland_mifs_wmi_probe': bitland-mifs-wmi.c:(.text+0xede02a): undefined reference to `devm_led_classdev_register_ext' Fixes: dc1ec4fa86b2 ("platform/x86: ...
```diff diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 2ffa4ecf65b0..7a4956088300 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -118,6 +118,7 @@ config BITLAND_MIFS_WMI depends on ACPI_WMI depends on HWMON depends on INPUT + depends on LEDS_CLASS ...
70a03a385de2b8f0fa54dbc70bdc3ed176853d1c
Analyze and fix the following issue in the Linux kernel code: eventpoll: add missing kernel-doc for @ctx function parameters
Problem Details: Add the missing kernel-doc comments to prevent kernel-doc build warnings while building the documentation. WARNING: fs/eventpoll.c:1684 function parameter 'ctx' not described in 'reverse_path_check' WARNING: fs/eventpoll.c:2349 function parameter 'ctx' not described in 'ep_loop_check_proc' Fixes: e09...
```diff diff --git a/fs/eventpoll.c b/fs/eventpoll.c index a569e98d4a99..baa97d0edade 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1677,6 +1677,7 @@ static int reverse_path_check_proc(struct ep_ctl_ctx *ctx, * anchoring files with newly proposed links; make * sure t...
5404599c3292a12dfc6a3b604cebb5d51064f553
Analyze and fix the following issue in the Linux kernel code: ASoC: mediatek: mt8189: Fix probe resource cleanup
Problem Details: The MT8189 AFE probe assigns reserved memory with of_reserved_mem_device_init(), but only releases that assignment from .remove(). If probe fails after the reserved memory has been assigned, the assignment record is left behind. The probe path also uses pm_runtime_get_sync() without checking its retu...
```diff diff --git a/sound/soc/mediatek/mt8189/mt8189-afe-pcm.c b/sound/soc/mediatek/mt8189/mt8189-afe-pcm.c index 24b0c78815f6..77cf2b604f6c 100644 --- a/sound/soc/mediatek/mt8189/mt8189-afe-pcm.c +++ b/sound/soc/mediatek/mt8189/mt8189-afe-pcm.c @@ -2351,9 +2351,13 @@ static int mt8189_afe_runtime_resume(struct device...
49e05bb00f2e8168695f7af4d694c39e1423e8a2
Analyze and fix the following issue in the Linux kernel code: crypto: atmel-sha204a - fail on hwrng registration error in probe path
Problem Details: Commit 13909a0c8897 ("crypto: atmel-sha204a - provide the otp content") overwrote the hwrng registration return value when creating the sysfs group, which allowed atmel_sha204a_probe() to succeed even if devm_hwrng_register() failed. Return immediately when devm_hwrng_register() fails, and report both...
```diff diff --git a/drivers/crypto/atmel-sha204a.c b/drivers/crypto/atmel-sha204a.c index 37538b0fd7c2..12eb85b57380 100644 --- a/drivers/crypto/atmel-sha204a.c +++ b/drivers/crypto/atmel-sha204a.c @@ -183,12 +183,14 @@ static int atmel_sha204a_probe(struct i2c_client *client) i2c_priv->hwrng.quality = *quality; ...
083c9ab12c402efe9ed55c942ede92eb35f8bf2a
Analyze and fix the following issue in the Linux kernel code: crypto: omap-des - add COMPILE_TEST and fix CONFIG_OF=n build
Problem Details: CRYPTO_DEV_OMAP_DES only depends on ARCH_OMAP2PLUS, which is ARM-only and selects OF via ARM's USE_OF, making any non-OF code unreachable. Add COMPILE_TEST so the driver can be built with CONFIG_OF=n, making the non-OF code reachable. Fix the resulting non-OF build failures: - omap_des_irq() was def...
```diff diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index d23b58b81ca3..3449b3c9c6ad 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -316,7 +316,7 @@ config HW_RANDOM_PPC4XX config CRYPTO_DEV_OMAP tristate "Support for OMAP crypto HW accelerators" - depends on ARCH_OMAP2PLUS + ...
09e6b79b8ce388993aec9ac91b1cb2c181c27bd9
Analyze and fix the following issue in the Linux kernel code: crypto: eip93 - fix reset ring register definition
Problem Details: This patch fixes a descriptor ring reset. This causes a hang in the driver's unload/load sequence. Fixes: 9739f5f93b78 ("crypto: eip93 - Add Inside Secure SafeXcel EIP-93 crypto engine support") Suggested-by: Benjamin Larsson <benjamin.larsson@genexis.eu> Signed-off-by: Aleksander Jan Bajkowski <olek2...
```diff diff --git a/drivers/crypto/inside-secure/eip93/eip93-regs.h b/drivers/crypto/inside-secure/eip93/eip93-regs.h index 96285ca6fbbe..96d28c6651bd 100644 --- a/drivers/crypto/inside-secure/eip93/eip93-regs.h +++ b/drivers/crypto/inside-secure/eip93/eip93-regs.h @@ -103,7 +103,7 @@ #define EIP93_PE_TARGET_COMMAN...
3b626ba431c4501512ad07549310685e07fe4706
Analyze and fix the following issue in the Linux kernel code: X.509: Fix validation of ASN.1 certificate header
Problem Details: x509_load_certificate_list() seeks to enforce that a certificate starts with 0x30 0x82 (ASN.1 SEQUENCE tag followed by a length of more than 256 and less than 65535 bytes). But it only enforces that *either* of those two byte values are present, instead of checking for the *conjunction* of the two val...
```diff diff --git a/crypto/asymmetric_keys/x509_loader.c b/crypto/asymmetric_keys/x509_loader.c index a41741326998..0d516c77cc26 100644 --- a/crypto/asymmetric_keys/x509_loader.c +++ b/crypto/asymmetric_keys/x509_loader.c @@ -20,7 +20,7 @@ int x509_load_certificate_list(const u8 cert_list[], */ if (end - p < 4)...
57518500053987672050dc2f7bf8a774d5d52fd9
Analyze and fix the following issue in the Linux kernel code: crypto: qat - keep VFs enabled during reset
Problem Details: When a reset is triggered via sysfs, the PCI core invokes the reset_prepare() callback while holding pci_dev_lock(), which includes the PCI configuration space access semaphore. If reset_prepare() calls adf_dev_down(), the call chain adf_dev_stop() -> adf_disable_sriov() -> pci_disable_sriov() attempts...
```diff diff --git a/drivers/crypto/intel/qat/qat_common/adf_sriov.c b/drivers/crypto/intel/qat/qat_common/adf_sriov.c index 96939572109e..f2011300a929 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_sriov.c +++ b/drivers/crypto/intel/qat/qat_common/adf_sriov.c @@ -91,6 +91,10 @@ static int adf_enable_sriov(struct...
277281c10c63791067d24d421f7c43a15faa9096
Analyze and fix the following issue in the Linux kernel code: crypto: qat - fix VF2PF work teardown race in adf_disable_sriov()
Problem Details: The VF2PF interrupt handler queues PF-side response work that stores a raw pointer to per-VF state (struct adf_accel_vf_info). Currently, adf_disable_sriov() destroys per-VF mutexes and frees vf_info without stopping new VF2PF work or waiting for in-flight workers to complete. A concurrently scheduled ...
```diff diff --git a/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h b/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h index 03a4e9690208..d9b2a1cf474e 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h +++ b/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h @@ -480,6 +480,8 @@ s...
27b536a2ec8e2f85a0380c2d13c9ecbc7aaab406
Analyze and fix the following issue in the Linux kernel code: crypto: ecc - Fix carry overflow in vli multiplication
Problem Details: The carry flag calculation fails when r01.m_high is saturated (0xFFFFFFFFFFFFFFFF) and addition of lower bits overflows. The condition (r01.m_high < product.m_high) doesn't handle the case where r01.m_high == product.m_high and an additional carry exists from lower-bit overflow. When commit 3c4b23901...
```diff diff --git a/crypto/ecc.c b/crypto/ecc.c index 43b0def3a225..6eb4d97a5f0d 100644 --- a/crypto/ecc.c +++ b/crypto/ecc.c @@ -393,14 +393,26 @@ static uint128_t mul_64_64(u64 left, u64 right) return result; } -static uint128_t add_128_128(uint128_t a, uint128_t b) +/* Calculate addition with overflow checking...
d237230728c567297f2f98b425d63156ab2ed17f
Analyze and fix the following issue in the Linux kernel code: crypto: qat - remove unused character device and IOCTLs
Problem Details: The QAT driver exposes a character device (qat_adf_ctl) with IOCTLs for device configuration, start, stop, status query and enumeration. These IOCTLs are not part of any public uAPI header and have no known in-tree or out-of-tree users. Device lifecycle is already managed via sysfs. The ioctl interfac...
```diff diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst b/Documentation/userspace-api/ioctl/ioctl-number.rst index 331223761fff..29a08bc059dd 100644 --- a/Documentation/userspace-api/ioctl/ioctl-number.rst +++ b/Documentation/userspace-api/ioctl/ioctl-number.rst @@ -229,7 +229,6 @@ Code Seq# Include...
81e7c6befa36cecdcbf7244393bd67e8f8c59bf5
Analyze and fix the following issue in the Linux kernel code: of: dynamic: Fix overlayed devices not probing because of fw_devlink
Problem Details: When an overlay is applied, if the target device has already probed successfully and bound to a device, then some of the fw_devlink logic that ran when the device was probed needs to be rerun. This allows newly created dangling consumers of the overlayed device tree nodes to be moved to become consumer...
```diff diff --git a/drivers/base/core.c b/drivers/base/core.c index d49420e066de..3cb736c7fb31 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -235,6 +235,79 @@ static void __fw_devlink_pickup_dangling_consumers(struct fwnode_handle *fwnode, __fw_devlink_pickup_dangling_consumers(child, new_sup); } ...
aaf08c52df9a19148731d4a3cfd85d98455db901
Analyze and fix the following issue in the Linux kernel code: Revert "treewide: Fix probing of devices in DT overlays"
Problem Details: This reverts commit 1a50d9403fb90cbe4dea0ec9fd0351d2ecbd8924. While the commit fixed fw_devlink overlay handling for one case, it broke it for another case. So revert it and redo the fix in a separate patch. Fixes: 1a50d9403fb9 ("treewide: Fix probing of devices in DT overlays") Reported-by: Herve Co...
```diff diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c index f735e0462c55..87070155b057 100644 --- a/drivers/bus/imx-weim.c +++ b/drivers/bus/imx-weim.c @@ -327,12 +327,6 @@ static int of_weim_notify(struct notifier_block *nb, unsigned long action, "Failed to setup timing for '%pOF'\n", rd->dn); ...
1137838865bfc9a7cd5869c1dc5c22aa45ec12c8
Analyze and fix the following issue in the Linux kernel code: driver core: Use mod_delayed_work to prevent lost deferred probe work
Problem Details: The deferred_probe_timeout_work may be permanently and unexpectedly canceled when deferred_probe_extend_timeout() executes concurrently. Starting with deferred_probe_timeout_work pending, the problem can occur after the following sequence: CPU0 CPU1 deferred_probe_ext...
```diff diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 5799a60fd058..172a02a438a2 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -323,12 +323,10 @@ void deferred_probe_extend_timeout(void) * If the work hasn't been queued yet or if the work expired, don't * start a new one. */ - if (cancel...
9582485a65eacfd7245ec7f0a9d7e2c34749d669
Analyze and fix the following issue in the Linux kernel code: device property: fix fwnode reference leak in fwnode_graph_get_endpoint_by_id()
Problem Details: When called with FWNODE_GRAPH_ENDPOINT_NEXT, the function walks every endpoint under the requested port and, for any endpoint whose ID is greater than or equal to the requested one, may store a fwnode reference in best_ep via fwnode_handle_get(). If a later iteration finds an exact-ID match, the functi...
```diff diff --git a/drivers/base/property.c b/drivers/base/property.c index 8e0148a37fff..e08eadd66f4f 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -1277,8 +1277,10 @@ fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode, if (fwnode_ep.port != port) continue; - if (fwno...
0fdde3f2aeadcf8d090ee3edee0aad73fb91f690
Analyze and fix the following issue in the Linux kernel code: kernfs: fix suspicious RCU usage in kernfs_put()
Problem Details: Commit 741c10b096bc ("kernfs: Use RCU to access kernfs_node::name.") converted the WARN_ONCE() in kernfs_put() to read kn->name and parent->name via rcu_dereference(), but kernfs_put() has callers that hold neither kernfs_rwsem nor the RCU read lock. The inode eviction path driven by memory reclaim is ...
```diff diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index 4f9ade82b08a..e88b71607f1e 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c @@ -597,10 +597,13 @@ void kernfs_put(struct kernfs_node *kn) */ parent = kernfs_parent(kn); - WARN_ONCE(atomic_read(&kn->active) != KN_DEACTIVATED_BIAS, - "kernfs_put: %s...
a68a29a1cc3ae6c129acdf945964dea16c8a49dc
Analyze and fix the following issue in the Linux kernel code: scripts/sbom: add JSON-LD serialization
Problem Details: Add infrastructure to serialize an SPDX graph as a JSON-LD document. NamespaceMaps in the SPDX document are converted to custom prefixes in the @context field of the JSON-LD output. The SBOM tool uses NamespaceMaps solely to shorten SPDX IDs, avoiding repetition of full namespace URIs by using short p...
```diff diff --git a/Makefile b/Makefile index 4c6133af5549..2443d4c82454 100644 --- a/Makefile +++ b/Makefile @@ -2212,7 +2212,8 @@ quiet_cmd_sbom = GEN $(sbom_targets) --src-tree $(abspath $(srctree)) \ --obj-tree $(abspath $(objtree)) \ --roots-fi...
5c3091e23f8fc2bdb6d85ca23b6097f05f3f0467
Analyze and fix the following issue in the Linux kernel code: spi: aspeed: Fix missing __iomem annotation in output transfer path
Problem Details: The dst parameter of aspeed_spi_user_transfer_tx() is an MMIO address obtained from chip->ahb_base, but it was typed as void * instead of void __iomem *. This caused a sparse warning report. Fix the parameter type to void __iomem * and drop the now-unnecessary cast at the call site. Reported-by: kern...
```diff diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c index c21323e07d3c..808659a1f460 100644 --- a/drivers/spi/spi-aspeed-smc.c +++ b/drivers/spi/spi-aspeed-smc.c @@ -891,7 +891,7 @@ static int aspeed_spi_user_unprepare_msg(struct spi_controller *ctlr, static void aspeed_spi_user_transfer_t...
18014147d3ee7831dce53fe65d7fc8d428b02552
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_tables: fix dst corruption in same register operation
Problem Details: For lshift and rshift, the shift operations are performed in a loop over 32-bit words. The loop calculates the shifted value and write it to dst, and then immediately reads from src to calculate the carry for the next iteration. Because src and dst could point to the same memory location, the carry is ...
```diff diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index cff7b773e972..9d844354c4d9 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h @@ -180,6 +180,13 @@ static inline u64 nft_reg_load64(const u32 *sreg) return get_unaligned((u64 *)sreg); ...
f81b0c2d281faa93e4c2b7247047922aaf3e4ba6
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_fib_ipv6: handle routes via external nexthop
Problem Details: fib6_info has a union: union { struct list_head fib6_siblings; struct list_head nh_list; }; Old-style multipath (ip -6 route add ... nexthop ... nexthop ...) uses fib6_siblings. External nexthop (ip -6 route add ... nhid N) uses nh_list, linked into &nh->f6i_list. nft_fib6_i...
```diff diff --git a/net/ipv6/netfilter/nft_fib_ipv6.c b/net/ipv6/netfilter/nft_fib_ipv6.c index 5e192a446ec8..c0a0075e2590 100644 --- a/net/ipv6/netfilter/nft_fib_ipv6.c +++ b/net/ipv6/netfilter/nft_fib_ipv6.c @@ -160,16 +160,32 @@ static bool nft_fib6_info_nh_dev_match(const struct net_device *nh_dev, l3mdev...
1d001b0a6182b0d2f41a8d687f7522b6f1e94280
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_fib_ipv6: walk fib6_siblings under RCU
Problem Details: nft_fib6_info_nh_uses_dev() runs from nft_fib6_eval() in softirq under rcu_read_lock(). fib6_siblings is modified by writers that hold tb6_lock but do not wait for RCU readers, so the sibling walk should use list_for_each_entry_rcu(): it adds READ_ONCE() on the ->next pointer and lets CONFIG_PROVE_RCU...
```diff diff --git a/net/ipv6/netfilter/nft_fib_ipv6.c b/net/ipv6/netfilter/nft_fib_ipv6.c index 8b2dba88ee96..5e192a446ec8 100644 --- a/net/ipv6/netfilter/nft_fib_ipv6.c +++ b/net/ipv6/netfilter/nft_fib_ipv6.c @@ -170,7 +170,7 @@ static bool nft_fib6_info_nh_uses_dev(struct fib6_info *rt, if (nft_fib6_info_nh_dev_ma...
f438d1786d657d57790c5d138d6db3fc9fdac392
Analyze and fix the following issue in the Linux kernel code: netfilter: ebtables: fix OOB read in compat_mtw_from_user
Problem Details: Luxiao Xu says: The function compat_mtw_from_user() converts ebtables extensions from 32-bit user structures to kernel native structures. However, it lacks proper validation of the user-supplied match_size/target_size. When certain extensions are processed, the kernel-side translation logic may ...
```diff diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index b9f4daac09af..8a6a069329d2 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c @@ -1956,6 +1956,25 @@ enum compat_mwt { EBT_COMPAT_TARGET, }; +static bool match_size_ok(const struct xt_match ...
c376f07e16c02239ed44cabb97145d03f65b4d15
Analyze and fix the following issue in the Linux kernel code: netfilter: xt_cpu: prefer raw_smp_processor_id
Problem Details: With PREEMPT_RCU we get splat: BUG: using smp_processor_id() in preemptible [..] caller is cpu_mt+0x53/0xd0 net/netfilter/xt_cpu.c:37 CPU: 1 .. Comm: syz.3.1377 #0 PREEMPT(full) Call Trace: <TASK> dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 check_preemption_disabled+0xd3/0xe0 lib/smp_processor_i...
```diff diff --git a/net/netfilter/xt_cpu.c b/net/netfilter/xt_cpu.c index 3bdc302a0f91..9cb259902a58 100644 --- a/net/netfilter/xt_cpu.c +++ b/net/netfilter/xt_cpu.c @@ -34,7 +34,7 @@ static bool cpu_mt(const struct sk_buff *skb, struct xt_action_param *par) { const struct xt_cpu_info *info = par->matchinfo; - re...
47980b6dbf83961eec1c1363ea986e9c06ff8054
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_conntrack_gre: fix gre keymap list corruption
Problem Details: Quoting reporter: A race between GRE keymap insertion and destruction can corrupt the kernel list or use a freed object. `nf_ct_gre_keymap_add()` publishes a new keymap pointer before the embedded `list_head` is linked, while `nf_ct_gre_keymap_destroy()` can concurrently delete and free that ...
```diff diff --git a/include/linux/netfilter/nf_conntrack_proto_gre.h b/include/linux/netfilter/nf_conntrack_proto_gre.h index 9ee7014400e8..ad5563f0f864 100644 --- a/include/linux/netfilter/nf_conntrack_proto_gre.h +++ b/include/linux/netfilter/nf_conntrack_proto_gre.h @@ -18,9 +18,10 @@ struct nf_ct_gre_keymap { st...
92170e6afe927ab2792a3f71902845789c8e31b1
Analyze and fix the following issue in the Linux kernel code: netfilter: synproxy: refresh tcphdr after skb_ensure_writable
Problem Details: synproxy_tstamp_adjust() rewrites the TCP timestamp option in place and then patches the TCP checksum via inet_proto_csum_replace4() on the caller-supplied tcphdr pointer. Both ipv4_synproxy_hook() and ipv6_synproxy_hook() obtain that pointer with skb_header_pointer() before calling in, so it may eith...
```diff diff --git a/net/netfilter/nf_synproxy_core.c b/net/netfilter/nf_synproxy_core.c index 57f57e2fc80a..036c8586f49b 100644 --- a/net/netfilter/nf_synproxy_core.c +++ b/net/netfilter/nf_synproxy_core.c @@ -200,6 +200,8 @@ synproxy_tstamp_adjust(struct sk_buff *skb, unsigned int protoff, if (skb_ensure_writable(s...
bed6e04be8e6b9133d8b16d5a42d0e0ce674fa9a
Analyze and fix the following issue in the Linux kernel code: netfilter: conntrack: tcp: do not force CLOSE on invalid-seq RST without direction check
Problem Details: An unintended behavior in the TCP conntrack state machine allows a connection to be forced into the CLOSE state using an RST packet with an invalid sequence number. Specifically, after a SYN packet is observed, an RST with an invalid SEQ can transition the conntrack entry to TCP_CONNTRACK_CLOSE, regar...
```diff diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c index b67426c2189b..e99ab1e88e9f 100644 --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c @@ -1221,7 +1221,8 @@ int nf_conntrack_tcp_packet(struct nf_conn *ct, new_state = old...
215c90ee656114f5e8c32408228d97082f8e0eef
Analyze and fix the following issue in the Linux kernel code: device property: set fwnode->secondary to NULL in fwnode_init()
Problem Details: If a firmware node is allocated on the stack (for instance: temporary software node whose life-time we control) or on the heap - but using a non-zeroing allocation function - and initialized using fwnode_init(), its secondary pointer will contain uninitalized memory which likely will be neither NULL no...
```diff diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h index 80b38fbf2121..31df7608737e 100644 --- a/include/linux/fwnode.h +++ b/include/linux/fwnode.h @@ -208,6 +208,7 @@ struct fwnode_operations { static inline void fwnode_init(struct fwnode_handle *fwnode, const struct fwnode_operations *o...
988c918b812eef5623d44cf758857f28ee050570
Analyze and fix the following issue in the Linux kernel code: minix: release the sb buffer_head when setting the v3 block size fails
Problem Details: At this point the superblock is already read, so jump to the label that releases the buffer_head for it. Fixes: d893fc670546 ("minix: handle set_blocksize failures") Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20260518130330.529085-...
```diff diff --git a/fs/minix/inode.c b/fs/minix/inode.c index 03a69b13950d..c30cc590698d 100644 --- a/fs/minix/inode.c +++ b/fs/minix/inode.c @@ -293,7 +293,7 @@ static int minix_fill_super(struct super_block *s, struct fs_context *fc) sbi->s_version = MINIX_V3; sbi->s_mount_state = MINIX_VALID_FS; if (!sb_se...
36770417153644bc88281c7284730ef1d14d8d3c
Analyze and fix the following issue in the Linux kernel code: misc: rp1: Send IACK on IRQ activate to fix kdump/kexec
Problem Details: After a kexec/kdump reboot, the macb Ethernet controller fails to receive any packets, causing DHCP to hang indefinitely and the network interface to be unusable despite link being up. The root cause is that RP1's level-triggered MSI-X interrupt sources (such as macb on hwirq 6) may have their interna...
```diff diff --git a/drivers/misc/rp1/rp1_pci.c b/drivers/misc/rp1/rp1_pci.c index d210da84c30a..81685e3f3296 100644 --- a/drivers/misc/rp1/rp1_pci.c +++ b/drivers/misc/rp1/rp1_pci.c @@ -143,6 +143,7 @@ static int rp1_irq_activate(struct irq_domain *d, struct irq_data *irqd, struct rp1_dev *rp1 = d->host_data; ms...
2eae90a457baa0048a96ed38ad93090ee38c8b2f
Analyze and fix the following issue in the Linux kernel code: gpib: cb7210: Fix region leak when request_irq fails
Problem Details: When request_irq() fails, the region allocated by request_region() is not released. Fix this by adding an error handling path with proper goto labels to release the region. Fixes: e9dc69956d4d ("staging: gpib: Add Computer Boards GPIB driver") Closes: https://lore.kernel.org/oe-kbuild-all/202605160620...
```diff diff --git a/drivers/gpib/cb7210/cb7210.c b/drivers/gpib/cb7210/cb7210.c index 6dd8637c5964..673b5bfe2e7d 100644 --- a/drivers/gpib/cb7210/cb7210.c +++ b/drivers/gpib/cb7210/cb7210.c @@ -1049,7 +1049,8 @@ static int cb_isa_attach(struct gpib_board *board, const struct gpib_board_confi if (!request_region(conf...
ef15ccbb3e8640a723c42ad90eaf81d66ae02017
Analyze and fix the following issue in the Linux kernel code: parport: Fix race between port and client registration
Problem Details: The parport subsystem registers port devices before they are fully initialised, resulting in a race condition where client drivers such as lp can attach to ports that are not completely initialised or even being torn down. When the port and client drivers are built as modules and loaded around the sam...
```diff diff --git a/drivers/parport/share.c b/drivers/parport/share.c index ba5292828703..eb0977ca1605 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -214,10 +214,14 @@ static void get_lowlevel_driver(void) static int port_check(struct device *dev, void *dev_drv) { struct parport_driver *drv...
f74c8696f14149d5e43cc28b015326a759c48f00
Analyze and fix the following issue in the Linux kernel code: uio: uio_pci_generic_sva: fix double free of devm_kzalloc() memory
Problem Details: uio_pci_sva allocates struct uio_pci_sva_dev with devm_kzalloc() in probe(), but then calls kfree(udev) both on the probe() error path (label out_free) and again in remove(). Because devm_kzalloc() allocations are devres-managed and are freed automatically when the device is detached (including after ...
```diff diff --git a/drivers/uio/uio_pci_generic_sva.c b/drivers/uio/uio_pci_generic_sva.c index 4a46acd994a8..d05ef77f7e32 100644 --- a/drivers/uio/uio_pci_generic_sva.c +++ b/drivers/uio/uio_pci_generic_sva.c @@ -129,15 +129,13 @@ static int probe(struct pci_dev *pdev, const struct pci_device_id *id) ret = devm_uio...
c2ff4764e03e7a8d758352f4aceb8fe1be6ac971
Analyze and fix the following issue in the Linux kernel code: arm64: tlb: Flush walk cache when unsharing PMD tables
Problem Details: When huge_pmd_unshare() is called to unshare a PMD table, the tlb_unshare_pmd_ptdesc() function sets tlb->unshared_tables=true but the aarch64 tlb_flush() only checked tlb->freed_tables to determine whether to use TLBF_NONE (vae1is, invalidates walk cache) or TLBF_NOWALKCACHE (vale1is, leaf-only). Thi...
```diff diff --git a/arch/arm64/include/asm/tlb.h b/arch/arm64/include/asm/tlb.h index 10869d7731b8..751bd57bc3ba 100644 --- a/arch/arm64/include/asm/tlb.h +++ b/arch/arm64/include/asm/tlb.h @@ -53,7 +53,8 @@ static inline int tlb_get_level(struct mmu_gather *tlb) static inline void tlb_flush(struct mmu_gather *tlb) ...
31c1d19ead2c26a63859a2757d8b786765ba9cdd
Analyze and fix the following issue in the Linux kernel code: writeback: use a per-sb counter to drain inode wb switches at umount
Problem Details: Tracking in-flight inode wb switches with a single global counter (isw_nr_in_flight) plus a synchronize_rcu() based wait in cgroup_writeback_umount() forces every umount to take a global hit whenever any other superblock on the system has wb switches in flight, even if the superblock being unmounted ha...
```diff diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 325a30cc35bf..900ad7818bd4 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -497,6 +497,23 @@ skip_switch: return switched; } +static inline void cgroup_writeback_pin(struct super_block *sb) +{ + atomic_inc(&sb->s_isw_nr_in_flight); +} + +st...
e90a6d668e26e00a72df2d09c173b563468f09c9
Analyze and fix the following issue in the Linux kernel code: writeback: drop now-unnecessary rcu_barrier() in cgroup_writeback_umount()
Problem Details: Commit e1b849cfa6b6 ("writeback: Avoid contention on wb->list_lock when switching inodes") replaced the queue_rcu_work() based scheduling of inode wb switches with a plain queue_work(). Since then no switcher goes through call_rcu(), so rcu_barrier() in cgroup_writeback_umount() has no callbacks of it...
```diff diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 6766de9f9d75..325a30cc35bf 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -1248,11 +1248,6 @@ void cgroup_writeback_umount(struct super_block *sb) * will then drain it. */ synchronize_rcu(); - /* - * Use rcu_barrier() to wait for ...
cba38ec4cbd3a7b8b942a8d52531a05be8a9ff0d
Analyze and fix the following issue in the Linux kernel code: writeback: fix race between cgroup_writeback_umount() and inode_switch_wbs()
Problem Details: When a container exits, the following BUG_ON() is occasionally triggered: ================================================================== VFS: Busy inodes after unmount of sdb (ext4) ------------[ cut here ]------------ kernel BUG at fs/super.c:695! CPU: 3 PID: 6 Comm: containerd-shim Tainted: ...
```diff diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index a65694cbfe68..6766de9f9d75 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -660,12 +660,19 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id) atomic_inc(&isw_nr_in_flight); - /* find and pin the new wb */ + /* + * Paired ...
f6d8fea9e3953151a4adb4f603503dc3dc9c69da
Analyze and fix the following issue in the Linux kernel code: rust_binder: Avoid holding lock when dropping delivered_death
Problem Details: In 6c37bebd8c926, we switched to looping over the list and dropping each individual node, ostensibly without the lock held in the loop body. If the kernel were using Rust Edition 2024, the comment would be accurate, and the lock would not be held across the drop. However, the kernel is currently using...
```diff diff --git a/drivers/android/binder/process.rs b/drivers/android/binder/process.rs index 820cbd541435..96b8440ceac6 100644 --- a/drivers/android/binder/process.rs +++ b/drivers/android/binder/process.rs @@ -1402,7 +1402,12 @@ impl Process { // Clear delivered_deaths list. // // Scope ...
4c19719eb8b8df08c5bec7c499f73ddaea6f09fc
Analyze and fix the following issue in the Linux kernel code: rust_binder: avoid calling pending_oneway_finished() on TF_UPDATE_TXN
Problem Details: When an outdated transaction is removed from `oneway_todo` due to `TF_UPDATE_TXN`, its `Allocation` is dropped. The current implementation of `Allocation::drop` calls `pending_oneway_finished()`, assuming the transaction was executed. This leads to premature execution of the next queued one-way transac...
```diff diff --git a/drivers/android/binder/allocation.rs b/drivers/android/binder/allocation.rs index 0cab959e4b7e..b7b05e72970a 100644 --- a/drivers/android/binder/allocation.rs +++ b/drivers/android/binder/allocation.rs @@ -157,6 +157,14 @@ impl Allocation { self.get_or_init_info().target_node = Some(target...
7cac59d08a73cb866ec51a483a6f3fe0f531947c
Analyze and fix the following issue in the Linux kernel code: serial: zs: Convert to use a platform device
Problem Details: Prevent a crash from happening as the first serial port is initialised: Console: switching to mono frame buffer device 160x64 fb0: PMAG-AA frame buffer device at tc0 DECstation Z85C30 serial driver version 0.10 CPU 0 Unable to handle kernel paging request at virtual address 0000002c, epc == 80...
```diff diff --git a/arch/mips/dec/platform.c b/arch/mips/dec/platform.c index fdecc91ee22a..723ce16cbfc0 100644 --- a/arch/mips/dec/platform.c +++ b/arch/mips/dec/platform.c @@ -13,6 +13,7 @@ #include <asm/bootinfo.h> #include <asm/dec/interrupts.h> +#include <asm/dec/ioasic_addrs.h> #include <asm/dec/kn01.h> #i...
5d7a49d60b8fda66da60e240fd7315232fa1754f
Analyze and fix the following issue in the Linux kernel code: serial: dz: Convert to use a platform device
Problem Details: Prevent a crash from happening as the first serial port is initialised: Console: switching to colour frame buffer device 160x64 tgafb: SFB+ detected, rev=0x02 fb0: Digital ZLX-E1 frame buffer device at 0x1e000000 DECstation DZ serial driver version 1.04 CPU 0 Unable to handle kernel paging r...
```diff diff --git a/arch/mips/dec/platform.c b/arch/mips/dec/platform.c index c4fcb8c58e01..fdecc91ee22a 100644 --- a/arch/mips/dec/platform.c +++ b/arch/mips/dec/platform.c @@ -10,6 +10,13 @@ #include <linux/mc146818rtc.h> #include <linux/platform_device.h> +#include <asm/bootinfo.h> + +#include <asm/dec/interrup...
8572955630f30948837088aa98bcbe0532d1ceac
Analyze and fix the following issue in the Linux kernel code: serial: zs: Switch to using channel reset
Problem Details: Switch the driver to using the channel reset rather than hardware reset, simplifying handling by removing an interference between channels that causes the other channel to become uninitialised afterwards. There is little difference between the two kinds of reset in terms of register settings that resu...
```diff diff --git a/drivers/tty/serial/zs.c b/drivers/tty/serial/zs.c index bb10cd8aa7dc..71cab10a33c3 100644 --- a/drivers/tty/serial/zs.c +++ b/drivers/tty/serial/zs.c @@ -832,21 +832,22 @@ static void zs_shutdown(struct uart_port *uport) static void zs_reset(struct zs_port *zport) { + struct zs_port *zport_a = ...
6c05cf72e13314ce9b770b5951695dc5a2152920
Analyze and fix the following issue in the Linux kernel code: serial: zs: Fix bootconsole handover lockup
Problem Details: Calling zs_reset() in the course of setting up the serial device causes line parameters to be reset and the transmitter disabled. We've been lucky in that no message is usually produced to the kernel log between this call and the later call to uart_set_options() in the course of console setup done by ...
```diff diff --git a/drivers/tty/serial/zs.c b/drivers/tty/serial/zs.c index 31e12645f66b..bb10cd8aa7dc 100644 --- a/drivers/tty/serial/zs.c +++ b/drivers/tty/serial/zs.c @@ -105,18 +105,24 @@ struct zs_parms { static struct zs_scc zs_sccs[ZS_NUM_SCCS]; +/* + * Set parameters in WR5, WR12, WR13 such as not to inte...
7f127b2208e5e2b817243cad41fe4211a6d5a7a3
Analyze and fix the following issue in the Linux kernel code: serial: dz: Fix bootconsole handover lockup
Problem Details: Calling dz_reset() in the course of setting up the serial device causes line parameters to be reset and the transmitter disabled. We've been lucky in that no message is usually produced to the kernel log between this call and the later call to uart_set_options() in the course of console setup done by ...
```diff diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c index d14a40e8cc0a..03f4fc9248b8 100644 --- a/drivers/tty/serial/dz.c +++ b/drivers/tty/serial/dz.c @@ -571,6 +571,18 @@ static void dz_reset(struct dz_port *dport) while (dz_in(dport, DZ_CSR) & DZ_CLR); iob(); + /* + * Set parameters across ...
ca904f4b42355287bc5ce8b7550ebe909cda4c2c
Analyze and fix the following issue in the Linux kernel code: serial: dz: Fix bootconsole message clobbering at chip reset
Problem Details: In the DZ interface as implemented by the DC7085 gate array the serial transmitters are double buffered, meaning that at the time a transmitter is ready to accept the next character there is one in the transmit shift register still being sent to the line. Issuing a master clear at this time causes thi...
```diff diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c index e53c54353c3e..d14a40e8cc0a 100644 --- a/drivers/tty/serial/dz.c +++ b/drivers/tty/serial/dz.c @@ -542,10 +542,31 @@ static int dz_encode_baud_rate(unsigned int baud) static void dz_reset(struct dz_port *dport) { struct dz_mux *mux = dport-...
2e211723953f7740e54b53f3d3a0d5e351a5e223
Analyze and fix the following issue in the Linux kernel code: serial: 8250_dw: dispatch SysRq character in dw8250_handle_irq()
Problem Details: dw8250_handle_irq() calls serial8250_handle_irq_locked() with the port lock held via guard(uart_port_lock_irqsave). The guard destructor is plain uart_port_unlock_irqrestore(), so a SysRq character captured into port->sysrq_ch by uart_prepare_sysrq_char() is dropped without ever being dispatched to han...
```diff diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 94beadb4024d..2af0c4d0ad82 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -427,7 +427,7 @@ static int dw8250_handle_irq(struct uart_port *p) unsigned int quirks = d->pdata->quirk...
71f42b2149a1307a97165b409493665579462ea0
Analyze and fix the following issue in the Linux kernel code: serial: 8250: dispatch SysRq character in serial8250_handle_irq()
Problem Details: serial8250_handle_irq() captures a SysRq character into port->sysrq_ch inside serial8250_handle_irq_locked() via uart_prepare_sysrq_char() (reached from serial8250_read_char()). Dispatch of that captured character to handle_sysrq() is expected to happen at port-unlock time, through uart_unlock_and_chec...
```diff diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index af78cc02f38e..c66ba714caa5 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1784,7 +1784,10 @@ static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir) } /...
a3bb136bff5e6a5e48cdd813246c9c4686feaaa9
Analyze and fix the following issue in the Linux kernel code: tty: serial: samsung: Remove redundant port lock acquisition in rx helpers
Problem Details: Sashiko identified a deadlock when the console flow is engaged [1]. When console flow control is enabled (UPF_CONS_FLOW), s3c24xx_serial_stop_tx() calls s3c24xx_serial_rx_enable() and s3c24xx_serial_start_tx() calls s3c24xx_serial_rx_disable(). The serial core framework invokes the .stop_tx() and .st...
```diff diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index e27806bf2cf3..17cd5bb100b1 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -245,12 +245,9 @@ static bool s3c24xx_serial_txempty_nofifo(const struct uart_port *port) static void s3c24xx...
ea66be25f0e934f49d24cd0c5845d13cdba3520b
Analyze and fix the following issue in the Linux kernel code: serial: altera_jtaguart: handle uart_add_one_port() failures
Problem Details: altera_jtaguart_probe() maps the register window before registering the UART port, but it ignores failures from uart_add_one_port(). If port registration fails, probe still returns success and the mapping remains live until a later remove path that is not part of probe failure cleanup. Return the uart...
```diff diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c index d47a62d1c9f7..20f079fe11d8 100644 --- a/drivers/tty/serial/altera_jtaguart.c +++ b/drivers/tty/serial/altera_jtaguart.c @@ -379,6 +379,7 @@ static int altera_jtaguart_probe(struct platform_device *pdev) struct resou...
0c6bf45e5a345cc3b9ffbeaf9083ecac3c2293eb
Analyze and fix the following issue in the Linux kernel code: serial: 8250: fix possible ISR soft lockup
Problem Details: There are rare cases in which the host gets stuck in the ISR because it is flooded with messages during the startup phase. The reason for the soft lockup in the ISR is the missing FIFO error IRQ (FIFOE) handling. Not handling it and reporting IRQ_HANDLED triggers the IRQ immediately again. Fix this b...
```diff diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index ef245114105b..141229b9bc17 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1799,6 +1799,13 @@ void serial8250_handle_irq_locked(struct uart_port *port, unsigned int iir) ...
578b269e2f5c6d990d3970a11ef43606f80dc5f8
Analyze and fix the following issue in the Linux kernel code: serial: qcom-geni: trace: Add tracepoint support for Qualcomm GENI serial
Problem Details: Add tracepoint support to the Qualcomm GENI serial driver to provide runtime visibility into driver behavior without requiring invasive debug patches. The trace events cover UART termios configuration, clock setup, modem control state, interrupt status, and TX/RX data, making it easier to diagnose com...
```diff diff --git a/include/trace/events/qcom_geni_serial.h b/include/trace/events/qcom_geni_serial.h new file mode 100644 index 000000000000..417ec01f9fc8 --- /dev/null +++ b/include/trace/events/qcom_geni_serial.h @@ -0,0 +1,164 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM qc...
10fc708b4de7f86002d2d735a2dbf3b5b7f65692
Analyze and fix the following issue in the Linux kernel code: serial: 8250_dw: unregister 8250 port if clk_notifier_register() fails
Problem Details: dw8250_probe() registers the 8250 port via serial8250_register_8250_port() and then, if the device has a clock, registers a clock notifier. If clk_notifier_register() fails, probe returns the error but leaves the 8250 port registered. The matching serial8250_unregister_port() lives in dw8250_remove(), ...
```diff diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 55e40c10f46a..2d30a164eeae 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -839,8 +839,10 @@ static int dw8250_probe(struct platform_device *pdev) */ if (data->clk) { err = ...
f33862ec3e8849ad7c0a3dd46719083b13ade248
Analyze and fix the following issue in the Linux kernel code: drm/i915/color: Fix HDR pre-CSC LUT programming loop
Problem Details: The integer lut programming loop never executes completely due to incorrect condition (i++ > 130). Fix to properly program 129th+ entries for values > 1.0. Cc: <stable@vger.kernel.org> #v6.19 Fixes: 82caa1c8813f ("drm/i915/color: Program Pre-CSC registers") Signed-off-by: Pranay Samala <pranay.samala...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c index 2d318e922671..3bfe09d81a4c 100644 --- a/drivers/gpu/drm/i915/display/intel_color.c +++ b/drivers/gpu/drm/i915/display/intel_color.c @@ -3976,7 +3976,7 @@ xelpd_program_plane_pre_csc_lut(struct intel_dsb *d...
f18643843bc622e24dd6c3c704273c1f411b1b7a
Analyze and fix the following issue in the Linux kernel code: serial: max310x: fix compile errors if CONFIG_SPI_MASTER is disabled
Problem Details: Since commit 20ffe4b3330a8 ("serial: max310x: allow driver to be built with SPI or I2C"), if I2C is enabled and SPI_MASTER is disabled, we have these compile errors: drivers/tty/serial/max310x.c: In function 'max310x_uart_init': drivers/tty/serial/max310x.c: error: 'max310x_spi_driver' undeclared....
```diff diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index f834e5d292fd..4accbfa75074 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -321,7 +321,7 @@ config SERIAL_MAX3100 config SERIAL_MAX310X tristate "MAX310X support" - depends on SPI_MASTER || I2C + depends ...
52c9780404963fea7300a7517ef1290439a1e08b
Analyze and fix the following issue in the Linux kernel code: usb: dwc2: remove WARN in dwc2_hcd_save_data_toggle
Problem Details: The WARN() in dwc2_hcd_save_data_toggle() was introduced in commit 62943b7dfa35 ("usb: dwc2: host: fix the data toggle error in full speed descriptor dma"), it looks like the WARN() is to ensure proper usage of dwc2_hcd_save_data_toggle(): either qtd is provided for control eps or qh is provided for no...
```diff diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c index 5c7538d498dd..f380275ac696 100644 --- a/drivers/usb/dwc2/hcd_intr.c +++ b/drivers/usb/dwc2/hcd_intr.c @@ -515,18 +515,20 @@ void dwc2_hcd_save_data_toggle(struct dwc2_hsotg *hsotg, u32 pid = (hctsiz & TSIZ_SC_MC_PID_MASK) >> TSIZ_SC_...
3643ea101fd7d01187f34b71fd5a5e3a608f1ab9
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: pmi632: move vdd-vbus-supply to connector nodes
Problem Details: Instead of specifying the VBUS supply as powering on the Type-C block in the PMIC, follow the standard schema and use vbus-supply property of the usb-c connector itself. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Revi...
```diff diff --git a/arch/arm64/boot/dts/qcom/pmi632.dtsi b/arch/arm64/boot/dts/qcom/pmi632.dtsi index 8c899d148e46..b0ed35094a98 100644 --- a/arch/arm64/boot/dts/qcom/pmi632.dtsi +++ b/arch/arm64/boot/dts/qcom/pmi632.dtsi @@ -69,7 +69,6 @@ "attach-detach", "legacy-cable-detect", "try-snk-src-de...
b5817fa4026c83818c2f6c0659158d8bf5bb59c3
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: pm8150b: move vdd-vbus-supply to connector nodes
Problem Details: Instead of specifying the VBUS supply as powering on the Type-C block in the PMIC, follow the standard schema and use vbus-supply property of the usb-c connector itself. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Revi...
```diff diff --git a/arch/arm64/boot/dts/qcom/pm8150b.dtsi b/arch/arm64/boot/dts/qcom/pm8150b.dtsi index 3f7b0b6a1d10..b83be4b6cb1c 100644 --- a/arch/arm64/boot/dts/qcom/pm8150b.dtsi +++ b/arch/arm64/boot/dts/qcom/pm8150b.dtsi @@ -95,7 +95,6 @@ "msg-tx-discarded", "msg-rx-discarded", "fr-swap"; ...
8eb14b34ba3a2631413336656e91149b987cb089
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: pm7250b: move vdd-vbus-supply to connector nodes
Problem Details: Instead of specifying the VBUS supply as powering on the Type-C block in the PMIC, follow the standard schema and use vbus-supply property of the usb-c connector itself. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Revi...
```diff diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi b/arch/arm64/boot/dts/qcom/pm7250b.dtsi index 0761e6b5fd8d..43cab07126c5 100644 --- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi +++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi @@ -86,7 +86,6 @@ "msg-tx-discarded", "msg-rx-discarded", "fr-swap"; ...
f28560fc0275372b2198fa3f7ab162c3f1db002a
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: pm4125: move vdd-vbus-supply to connector nodes
Problem Details: Instead of specifying the VBUS supply as powering on the Type-C block in the PMIC, follow the standard schema and use vbus-supply property of the usb-c connector itself. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Revi...
```diff diff --git a/arch/arm64/boot/dts/qcom/pm4125.dtsi b/arch/arm64/boot/dts/qcom/pm4125.dtsi index cf8c822e80ce..542e8fe030da 100644 --- a/arch/arm64/boot/dts/qcom/pm4125.dtsi +++ b/arch/arm64/boot/dts/qcom/pm4125.dtsi @@ -61,7 +61,6 @@ "attach-detach", "legacy-cable-detect", "try-snk-src-de...
506927b6bf291c521e931f946e0e0c384baf347d
Analyze and fix the following issue in the Linux kernel code: usb: typec: tcpm: qcom: prefer VBUS supply from the connector node
Problem Details: Current way of specifying VBUS supply (via the device's vdd-vbus-supply property) is not ideal. In the end, VBUS is supplied to the USB-C connector rather than the Type-C block in the PMIC. Follow the standard way of specifying it (via the connector node) and fallback to the old property if there is no...
```diff diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c index 8051eaa46991..429bd42a0e62 100644 --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c @@ -9,6 +9,7 @@ #include <linux/kernel.h...
fe2195b019f622258d43d926ba9f10894e4eee09
Analyze and fix the following issue in the Linux kernel code: dt-bindings: usb: qcom,pmic-typec: deprecate device-specific VBUS
Problem Details: The Qualcomm PMIC Type-C devices historically provided their own way of specifying the VBUS regulator, via the device's vdd-vbus-supply node. This is not ideal as the VBUS is supplied to the connector and not to the Type-C block in the PMIC. Deprecate this property in favour of the standard way of spec...
```diff diff --git a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml index 975032ba6004..ba790c4488b7 100644 --- a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml @@ -79,7 ...
11b5c101e2fd206104b05bc92554d356989423a8
Analyze and fix the following issue in the Linux kernel code: usb: host: max3421: Reject hub port requests for non-existent ports
Problem Details: The `max3421_hub_control()` function handles USB hub class requests to the virtual root hub. The `GetPortStatus` case correctly rejects requests with `index != 1`, since the virtual root hub has only a single port. However, the `ClearPortFeature` and `SetPortFeature` cases lack the same check. Fix thi...
```diff diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c index 3d6b351dcb1a..73e76d0e6973 100644 --- a/drivers/usb/host/max3421-hcd.c +++ b/drivers/usb/host/max3421-hcd.c @@ -1685,6 +1685,8 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index, case ClearHubFeature...
cff06b03b530ae1fe8a13e93a7848f2130e00fb4
Analyze and fix the following issue in the Linux kernel code: usb: host: max3421: Fix shift-out-of-bounds in max3421_hub_control()
Problem Details: The `max3421_hub_control()` function handles USB hub class requests to the virtual root hub. In the `default` branches of both the `ClearPortFeature` and `SetPortFeature` switch statements, it modifies `max3421_hcd->port_status` by left shifting 1 by the request's `value` parameter. However, it does no...
```diff diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c index 0e17c988d36a..3d6b351dcb1a 100644 --- a/drivers/usb/host/max3421-hcd.c +++ b/drivers/usb/host/max3421-hcd.c @@ -1694,6 +1694,8 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index, !pdata->vbus_ac...
8c22256bbafad3dc5fdbe9f684d045b67ff06a68
Analyze and fix the following issue in the Linux kernel code: usb: typec: ucsi: split connector lock classes
Problem Details: Lockdep detects a possible recursive locking scenario during ucsi init: [ 5.418616] ============================================ [ 5.418634] WARNING: possible recursive locking detected [ 5.418706] -------------------------------------------- [ 5.418725] kworker/4:1/82 is trying to acquire...
```diff diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 5b7ad9e99cb9..43da7512dea0 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -1642,6 +1642,7 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con) INIT_WORK(&con->work, uc...
7fd6fb1fe40b992b2c39c3f586624ad93ee66c22
Analyze and fix the following issue in the Linux kernel code: dt-bindings: usb: ci-hdrc-usb2: allow up to 3 clocks for qcom,ci-hdrc
Problem Details: Some Qualcomm SoCs such as apq8064 and msm8960 require a third "fs" clock in addition to "iface" and "core", needed to propagate resets through the controller and wrapper logic. Later SoCs such as msm8974 dropped this requirement and only use two clocks. Note that the existing apq8064 and msm8960 DTS ...
```diff diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml index 691d6cf02c27..a4575a413f42 100644 --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml @@ -45,11 +45,11 @@ p...
e663be4218d32d5d58374f8bed5bdfe3d2161932
Analyze and fix the following issue in the Linux kernel code: usb: cdns3: plat: fix leaked role switch on core role initialization failure
Problem Details: Calling usb_role_switch_unregister if core role initialization failure. Fixes: e4d7362dc9cd ("usb: cdns3: Add USBSSP platform driver support") Reported-by: sashiko-bot <sashiko-bot@kernel.org> Closes: https://lore.kernel.org/linux-devicetree/agKaEePSFknhDBg2@nchen-desktop/T/#m21e1d9c1574eb127ce03c0c2a...
```diff diff --git a/drivers/usb/cdns3/cdns3-plat.c b/drivers/usb/cdns3/cdns3-plat.c index 3fe3109a3688..91159910fe95 100644 --- a/drivers/usb/cdns3/cdns3-plat.c +++ b/drivers/usb/cdns3/cdns3-plat.c @@ -167,7 +167,7 @@ static int cdns3_plat_probe(struct platform_device *pdev) cdns->host_init = cdns3_plat_host_init; ...
c708d07ce70655d20350487ac2e2bc2a1f4f5038
Analyze and fix the following issue in the Linux kernel code: usb: typec: intel_pmc_mux: Zero initialize num_ports in pmc_usb_probe()
Problem Details: Clang warns (or errors with CONFIG_WERROR=y / W=e): drivers/usb/typec/mux/intel_pmc_mux.c:740:3: error: variable 'num_ports' is uninitialized when used here [-Werror,-Wuninitialized] 740 | num_ports++; | ^~~~~~~~~ This should have been initialized to zero...
```diff diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c index e22b070a140f..219a32da1348 100644 --- a/drivers/usb/typec/mux/intel_pmc_mux.c +++ b/drivers/usb/typec/mux/intel_pmc_mux.c @@ -732,7 +732,7 @@ static int pmc_usb_probe(struct platform_device *pdev) { struct fwnode...
105644154a60c8ec0c7b3e0758bd18c9a243a3b4
Analyze and fix the following issue in the Linux kernel code: usbip: vhci_hcd: reduce CONFIG_USBIP_VHCI_NR_HCS upper bound to 32
Problem Details: Each VHCI HC instance registers two USB buses (one HS, one SS). USB_MAXBUS in drivers/usb/core/hcd.c is hard-coded to 64, giving an effective maximum of 32 VHCI HC instances (32 * 2 = 64 buses). The Kconfig range for USBIP_VHCI_NR_HCS currently allows up to 128, which will cause probe failures for any...
```diff diff --git a/drivers/usb/usbip/Kconfig b/drivers/usb/usbip/Kconfig index b9f94e2e278d..50945b6fae1a 100644 --- a/drivers/usb/usbip/Kconfig +++ b/drivers/usb/usbip/Kconfig @@ -40,7 +40,7 @@ config USBIP_VHCI_HC_PORTS config USBIP_VHCI_NR_HCS int "Number of USB/IP virtual host controllers" - range 1 128 + ra...