id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
2e016da1cbbd013368095270c040e065678c38f7
Analyze and fix the following issue in the Linux kernel code: x86/nmi: Simplify unknown NMI panic handling
Problem Details: The unknown_nmi_panic variable is used to control whether the kernel should panic on unknown NMIs. There is a sysctl entry under: /proc/sys/kernel/unknown_nmi_panic which can be used to change the behavior at runtime. However, it seems that in some places, the option unnecessarily depends on CONFI...
```diff diff --git a/arch/x86/include/asm/nmi.h b/arch/x86/include/asm/nmi.h index f677382093f3..9cf96cce02fc 100644 --- a/arch/x86/include/asm/nmi.h +++ b/arch/x86/include/asm/nmi.h @@ -14,10 +14,10 @@ extern void release_perfctr_nmi(unsigned int); extern int reserve_evntsel_nmi(unsigned int); extern void release_ev...
395cc80051f8da267b27496a4029dd931a198855
Analyze and fix the following issue in the Linux kernel code: drm/virtio: Fix missed dmabuf unpinning in error path of prepare_fb()
Problem Details: Correct error handling in prepare_fb() to fix leaking resources when error happens. Fixes: 4a696a2ee646 ("drm/virtio: Add prepare and cleanup routines for imported dmabuf obj") Cc: <stable@vger.kernel.org> # v6.14+ Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Signed-off-by: Dmitry Osipenko <d...
```diff diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index 42aa554eca9f..26abe3d1b122 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -322,12 +322,6 @@ static int virtio_gpu_plane_prepare_fb(struct drm_plane *plane, r...
7cf6dd467e87664f5b3f4ca7be324569464edf0b
Analyze and fix the following issue in the Linux kernel code: drm/virtio: Don't attach GEM to a non-created context in gem_object_open()
Problem Details: The vfpriv->ctx_id is always initialized to a non-zero value. Check whether context was created before attaching GEM to this context ID. This left unnoticed previously because host silently skips attachment if context doesn't exist, still we shouldn't do that for consistency. Fixes: 086b9f27f0ab ("drm...
```diff diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index 5aab588fc400..3d6aa26fdb53 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -115,13 +115,14 @@ int virtio_gpu_gem_object_open(struct drm_gem_object *obj, if (!vgdev->ha...
fcfd94d6967a98e88b834c9fd81e73c5f04d83dc
Analyze and fix the following issue in the Linux kernel code: io_uring/zcrx: return early from io_zcrx_recv_skb if readlen is 0
Problem Details: When readlen is set for a recvzc request, tcp_read_sock() will call io_zcrx_recv_skb() one final time with len == desc->count == 0. This is caused by the !desc->count check happening too late. The offset + 1 != skb->len happens earlier and causes the while loop to continue. Fix this in io_zcrx_recv_sk...
```diff diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index 9c95b5b6ec4e..80d4a6f71d29 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -818,6 +818,14 @@ io_zcrx_recv_skb(read_descriptor_t *desc, struct sk_buff *skb, int ret = 0; len = min_t(size_t, len, desc->count); + /* + * __tcp_read_sock() always call...
7d6c63c3191427a69ffd1383146df01f695d6195
Analyze and fix the following issue in the Linux kernel code: cgroup: rstat: call cgroup_rstat_updated_list with cgroup_rstat_lock
Problem Details: The commit 093c8812de2d ("cgroup: rstat: Cleanup flushing functions and locking") during cleanup accidentally changed the code to call cgroup_rstat_updated_list() without cgroup_rstat_lock which is required. Fix it. Fixes: 093c8812de2d ("cgroup: rstat: Cleanup flushing functions and locking") Reported...
```diff diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c index 4bb587d5d34f..b2239156b7de 100644 --- a/kernel/cgroup/rstat.c +++ b/kernel/cgroup/rstat.c @@ -318,10 +318,11 @@ __bpf_kfunc void cgroup_rstat_flush(struct cgroup *cgrp) might_sleep(); for_each_possible_cpu(cpu) { - struct cgroup *pos = cgro...
9e4e249018d208678888bdf22f6b652728106528
Analyze and fix the following issue in the Linux kernel code: cpufreq: Reference count policy in cpufreq_update_limits()
Problem Details: Since acpi_processor_notify() can be called before registering a cpufreq driver or even in cases when a cpufreq driver is not registered at all, cpufreq_update_limits() needs to check if a cpufreq driver is present and prevent it from being unregistered. For this purpose, make it call cpufreq_cpu_get(...
```diff diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 0cf5a320bb5e..3841c9da6cac 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2809,6 +2809,12 @@ EXPORT_SYMBOL(cpufreq_update_policy); */ void cpufreq_update_limits(unsigned int cpu) { + struct cpufreq_policy *p...
acfcaf90db1fa833236d9f8249b6099cf638e5d1
Analyze and fix the following issue in the Linux kernel code: smccc: kvm_guest: Align with DISCOVER_IMPL_CPUS ABI
Problem Details: The ABI of the hypercall requires that R2 and R3 are 0. Explicitly pass 0 for these parameters. Cc: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Fixes: 86edf6bdcf05 ("smccc/kvm_guest: Enable errata based on implementation CPUs") Reviewed-by: Shameer Kolothum <shameerali.kolothum.thodi@huawe...
```diff diff --git a/drivers/firmware/smccc/kvm_guest.c b/drivers/firmware/smccc/kvm_guest.c index 5767aed25cdc..ac2d3cf8a776 100644 --- a/drivers/firmware/smccc/kvm_guest.c +++ b/drivers/firmware/smccc/kvm_guest.c @@ -95,7 +95,7 @@ void __init kvm_arm_target_impl_cpu_init(void) for (i = 0; i < max_cpus; i++) { ...
93d34608fd162f725172e780b1c60cc93a920719
Analyze and fix the following issue in the Linux kernel code: ASoC: imx-card: Add NULL check in imx_card_probe()
Problem Details: devm_kasprintf() returns NULL when memory allocation fails. Currently, imx_card_probe() does not check for this case, which results in a NULL pointer dereference. Add NULL check after devm_kasprintf() to prevent this issue. Fixes: aa736700f42f ("ASoC: imx-card: Add imx-card machine driver") Signed-of...
```diff diff --git a/sound/soc/fsl/imx-card.c b/sound/soc/fsl/imx-card.c index 905294682996..3686d468506b 100644 --- a/sound/soc/fsl/imx-card.c +++ b/sound/soc/fsl/imx-card.c @@ -772,6 +772,8 @@ static int imx_card_probe(struct platform_device *pdev) data->dapm_routes[i].sink = devm_kasprintf(&pdev->dev, GFP...
288ff0d10beb069355036355d5f7612579dc869c
Analyze and fix the following issue in the Linux kernel code: nvme-pci: skip nvme_write_sq_db on empty rqlist
Problem Details: nvme_submit_cmds() should check the rqlist before calling nvme_write_sq_db(); if the list is empty, it must return immediately. Fixes: beadf0088501 ("nvme-pci: reverse request order in nvme_queue_rqs") Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Signed-off-by: Keith Busch <kbusch@kernel.org...
```diff diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 2883d17ee1eb..b178d52eac1b 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -986,6 +986,9 @@ static void nvme_submit_cmds(struct nvme_queue *nvmeq, struct rq_list *rqlist) { struct request *req; + if (rq_list_empty(rq...
32c928142c4f2db5f9c11aa1fcc4de49d3f27fcd
Analyze and fix the following issue in the Linux kernel code: nvme-multipath: change the NVME_MULTIPATH config option
Problem Details: Fix up the NVME_MULTIPATH config description so that it accurately describes what it does. Signed-off-by: John Meneghini <jmeneghi@redhat.com> Tested-by: John Meneghini <jmeneghi@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
```diff diff --git a/drivers/nvme/host/Kconfig b/drivers/nvme/host/Kconfig index 10e453b2436e..d47dfa80fb95 100644 --- a/drivers/nvme/host/Kconfig +++ b/drivers/nvme/host/Kconfig @@ -18,10 +18,15 @@ config NVME_MULTIPATH bool "NVMe multipath support" depends on NVME_CORE help - This option enables support for ...
eada75467fca0b016b9b22212637c07216135c20
Analyze and fix the following issue in the Linux kernel code: nvme/ioctl: don't warn on vectorized uring_cmd with fixed buffer
Problem Details: The vectorized io_uring NVMe passthru opcodes don't yet support fixed buffers. But since userspace can trigger this condition based on the io_uring SQE parameters, it shouldn't cause a kernel warning. Signed-off-by: Caleb Sander Mateos <csander@purestorage.com> Reviewed-by: Jens Axboe <axboe@kernel.dk...
```diff diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c index ecf136489044..f81748096841 100644 --- a/drivers/nvme/host/ioctl.c +++ b/drivers/nvme/host/ioctl.c @@ -142,7 +142,7 @@ static int nvme_map_user_request(struct request *req, u64 ubuffer, struct iov_iter iter; /* fixedbufs is only for...
ed9c594d495deb676825489032cee0a03ce29bf9
Analyze and fix the following issue in the Linux kernel code: drm/panel: Add new helpers for refcounted panel allocatons
Problem Details: Introduce reference counted allocations for panels to avoid use-after-free. The patch adds the macro devm_drm_bridge_alloc() to allocate a new refcounted panel. Followed the documentation for drmm_encoder_alloc() and devm_drm_dev_alloc and other similar implementations for this purpose. Reviewed-by: M...
```diff diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index c627e42a7ce7..bdeab5710ee3 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -355,6 +355,31 @@ struct drm_panel *of_drm_find_panel(const struct device_node *np) } EXPORT_SYMBOL(of_drm_find_panel); +void ...
d33d729afcc8ad2148d99f9bc499b33fd0c0d73b
Analyze and fix the following issue in the Linux kernel code: s390/vfio-ap: Fix no AP queue sharing allowed message written to kernel log
Problem Details: An erroneous message is written to the kernel log when either of the following actions are taken by a user: 1. Assign an adapter or domain to a vfio_ap mediated device via its sysfs assign_adapter or assign_domain attributes that would result in one or more AP queues being assigned that are alre...
```diff diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c index bc8669b5c304..766557547f83 100644 --- a/drivers/s390/crypto/vfio_ap_ops.c +++ b/drivers/s390/crypto/vfio_ap_ops.c @@ -873,48 +873,66 @@ static void vfio_ap_mdev_remove(struct mdev_device *mdev) vfio_put_device(&matrix_mde...
65931bbc5177f8192a48a0aa5bdb9b95b9f6e87f
Analyze and fix the following issue in the Linux kernel code: drm/format-helper: Optimize 32-to-8-bpp conversion
Problem Details: For ease of implementation, existing line-conversion functions for 8-bit formats write each pixel individually. Optimize the performance by writing multiple pixels in a single 32-bit store. v2: - simplify address calculation (Jani) - fix typo in commit message (Jocelyn) Signed-off-by: Thomas Zimmerma...
```diff diff --git a/drivers/gpu/drm/drm_format_helper.c b/drivers/gpu/drm/drm_format_helper.c index 5098a00803d2..fc7347caf600 100644 --- a/drivers/gpu/drm/drm_format_helper.c +++ b/drivers/gpu/drm/drm_format_helper.c @@ -253,10 +253,29 @@ static __always_inline void drm_fb_xfrm_line_32to8(void *dbuf, const void *sbuf...
3f31a017ddbca3812247dd6332c21686caf864de
Analyze and fix the following issue in the Linux kernel code: drm/format-helper: Optimize 32-to-16-bpp conversion
Problem Details: For ease of implementation, existing line-conversion functions for 16-bit formats write each pixel individually. Optimize the performance by writing multiple pixels in single 64-bit and 32-bit stores. v2: - simplify address calculation (Jani) - fix typo in commit message (Jocelyn) Signed-off-by: Thom...
```diff diff --git a/drivers/gpu/drm/drm_format_helper.c b/drivers/gpu/drm/drm_format_helper.c index daf5a6d4f283..5098a00803d2 100644 --- a/drivers/gpu/drm/drm_format_helper.c +++ b/drivers/gpu/drm/drm_format_helper.c @@ -265,10 +265,45 @@ static __always_inline void drm_fb_xfrm_line_32to16(void *dbuf, const void *sbu...
1eb4d744fb86199f0f6da9463d83ed3eec2f61bf
Analyze and fix the following issue in the Linux kernel code: drm/cirrus-qemu: Stricter mode validation
Problem Details: Implement strict checking of a display mode's minimum scanline pitch in cirrus_mode_config_mode_valid(). Sort out all modes that possibly overflow the maximum pitch. The current validation only tests against a display mode's minimum requirements for video memory. Only atomic_check later tests against ...
```diff diff --git a/drivers/gpu/drm/tiny/cirrus-qemu.c b/drivers/gpu/drm/tiny/cirrus-qemu.c index a00d3b7ded6c..0306433ec117 100644 --- a/drivers/gpu/drm/tiny/cirrus-qemu.c +++ b/drivers/gpu/drm/tiny/cirrus-qemu.c @@ -613,9 +613,17 @@ static enum drm_mode_status cirrus_mode_config_mode_valid(struct drm_device *dev ...
4bfb389a0136a13f0802eeb5e97a0e76d88f77ae
Analyze and fix the following issue in the Linux kernel code: drm/cirrus-qemu: Fix pitch programming
Problem Details: Do not set CR1B[6] when programming the pitch. The bit effects VGA text mode and is not interpreted by qemu. [1] It has no affect on the scanline pitch. The scanline bit that is set into CR1B[6] belongs into CR13[7], which the driver sets up correctly. This bug goes back to the driver's initial commi...
```diff diff --git a/drivers/gpu/drm/tiny/cirrus-qemu.c b/drivers/gpu/drm/tiny/cirrus-qemu.c index 52ec1e4ea9e5..a00d3b7ded6c 100644 --- a/drivers/gpu/drm/tiny/cirrus-qemu.c +++ b/drivers/gpu/drm/tiny/cirrus-qemu.c @@ -318,7 +318,6 @@ static void cirrus_pitch_set(struct cirrus_device *cirrus, unsigned int pitch) /* E...
c28f31deeacda307acfee2f18c0ad904e5123aac
Analyze and fix the following issue in the Linux kernel code: arm64: Don't call NULL in do_compat_alignment_fixup()
Problem Details: do_alignment_t32_to_handler() only fixes up alignment faults for specific instructions; it returns NULL otherwise (e.g. LDREX). When that's the case, signal to the caller that it needs to proceed with the regular alignment fault handling (i.e. SIGBUS). Without this patch, the kernel panics: Unable t...
```diff diff --git a/arch/arm64/kernel/compat_alignment.c b/arch/arm64/kernel/compat_alignment.c index deff21bfa680..b68e1d328d4c 100644 --- a/arch/arm64/kernel/compat_alignment.c +++ b/arch/arm64/kernel/compat_alignment.c @@ -368,6 +368,8 @@ int do_compat_alignment_fixup(unsigned long addr, struct pt_regs *regs) re...
9462e74c5c983cce34019bfb27f734552bebe59f
Analyze and fix the following issue in the Linux kernel code: platform/x86: ISST: Correct command storage data length
Problem Details: After resume/online turbo limit ratio (TRL) is restored partially if the admin explicitly changed TRL from user space. A hash table is used to store SST mail box and MSR settings when modified to restore those settings after resume or online. This uses a struct isst_cmd field "data" to store these set...
```diff diff --git a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c index dbcd3087aaa4..31239a93dd71 100644 --- a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c +++ b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c @@ -8...
2b9f84e7dc863afd63357b867cea246aeedda036
Analyze and fix the following issue in the Linux kernel code: platform/x86: thinkpad_acpi: disable ACPI fan access for T495* and E560
Problem Details: T495, T495s, and E560 laptops have the FANG+FANW ACPI methods (therefore fang_handle and fanw_handle are not NULL) but they do not actually work, which results in a "No such device or address" error. The DSDT table code for the FANG+FANW methods doesn't seem to do anything special regarding the fan bei...
```diff diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index a17efb68664c..5790095c175e 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -8794,6 +8794,7 @@ static const struct attribute_group fan_driver_attr_group = { #define TPAC...
7b98c1c8e2ab79122f9d00697a6df0ddee6999de
Analyze and fix the following issue in the Linux kernel code: platform/x86: thinkpad_acpi: Fix NULL pointer dereferences while probing
Problem Details: Some subdrivers make use of the global reference tpacpi_pdev during initialization, which is called from the platform driver's probe. However, after the commit 38b9ab80db31 ("platform/x86: thinkpad_acpi: Move subdriver initialization to tpacpi_pdriver's probe.") this variable is only properly initializ...
```diff diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 0384cf311878..a17efb68664c 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -367,6 +367,7 @@ static struct { u32 beep_needs_two_args:1; u32 mixer_no_level_control:1; ...
7170130e4c72ce0caa0cb42a1627c635cc262821
Analyze and fix the following issue in the Linux kernel code: x86/mm/init: Handle the special case of device private pages in add_pages(), to not increase max_pfn and trigger dma_addressing_limited() bounce buffers
Problem Details: As Bert Karwatzki reported, the following recent commit causes a performance regression on AMD iGPU and dGPU systems: 7ffb791423c7 ("x86/kaslr: Reduce KASLR entropy on most x86 systems") It exposed a bug with nokaslr and zone device interaction. The root cause of the bug is that, the GPU driver re...
```diff diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 519aa53114fa..821a0b53b21c 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -959,9 +959,18 @@ int add_pages(int nid, unsigned long start_pfn, unsigned long nr_pages, ret = __add_pages(nid, start_pfn, nr_pages, params); WARN_ON...
7c977393b8277ed319e92e4b598b26598c9d30c0
Analyze and fix the following issue in the Linux kernel code: objtool/loongarch: Add unwind hints in prepare_frametrace()
Problem Details: If 'regs' points to a local stack variable, prepare_frametrace() stores all registers to the stack. This confuses objtool as it expects them to be restored from the stack later. The stores don't affect stack tracing, so use unwind hints to hide them from objtool. Fixes the following warnings: arc...
```diff diff --git a/arch/loongarch/include/asm/stacktrace.h b/arch/loongarch/include/asm/stacktrace.h index f23adb15f418..fc8b64773794 100644 --- a/arch/loongarch/include/asm/stacktrace.h +++ b/arch/loongarch/include/asm/stacktrace.h @@ -8,6 +8,7 @@ #include <asm/asm.h> #include <asm/ptrace.h> #include <asm/loongar...
4f8207469094bd04aad952258ceb9ff4c77b6bfa
Analyze and fix the following issue in the Linux kernel code: drm/i915/gvt: fix unterminated-string-initialization warning
Problem Details: Initializing const char opregion_signature[16] = OPREGION_SIGNATURE (which is "IntelGraphicsMem") drops the NUL termination of the string. This is intentional, but the compiler doesn't know this. Switch to initializing header->signature directly from the string litaral, with sizeof destination rather ...
```diff diff --git a/drivers/gpu/drm/i915/gvt/opregion.c b/drivers/gpu/drm/i915/gvt/opregion.c index 509f9ccae3a9..dbad4d853d3a 100644 --- a/drivers/gpu/drm/i915/gvt/opregion.c +++ b/drivers/gpu/drm/i915/gvt/opregion.c @@ -222,7 +222,6 @@ int intel_vgpu_init_opregion(struct intel_vgpu *vgpu) u8 *buf; struct opregio...
6309a5c43b0dc629851f25b2e5ef8beff61d08e5
Analyze and fix the following issue in the Linux kernel code: rcu-tasks: Always inline rcu_irq_work_resched()
Problem Details: Thanks to CONFIG_DEBUG_SECTION_MISMATCH, empty functions can be generated out of line. rcu_irq_work_resched() can be called from noinstr code, so make sure it's always inlined. Fixes: 564506495ca9 ("rcu/context-tracking: Move deferred nocb resched to context tracking") Reported-by: Randy Dunlap <rdun...
```diff diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index f8159f8a7d73..120536f4c6eb 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -132,7 +132,7 @@ static inline void rcu_sysrq_end(void) { } #if defined(CONFIG_NO_HZ_FULL) && (!defined(CONFIG_GENERIC_ENTRY) || !defined(CON...
9ac50f7311dc8b39e355582f14c1e82da47a8196
Analyze and fix the following issue in the Linux kernel code: context_tracking: Always inline ct_{nmi,irq}_{enter,exit}()
Problem Details: Thanks to CONFIG_DEBUG_SECTION_MISMATCH, empty functions can be generated out of line. These can be called from noinstr code, so make sure they're always inlined. Fixes the following warnings: vmlinux.o: warning: objtool: irqentry_nmi_enter+0xa2: call to ct_nmi_enter() leaves .noinstr.text section...
```diff diff --git a/include/linux/context_tracking_irq.h b/include/linux/context_tracking_irq.h index c50b5670c4a5..197916ee91a4 100644 --- a/include/linux/context_tracking_irq.h +++ b/include/linux/context_tracking_irq.h @@ -10,12 +10,12 @@ void ct_irq_exit_irqson(void); void ct_nmi_enter(void); void ct_nmi_exit(vo...
6ee928185aeb0ff085c73ae2ee163d436eba8352
Analyze and fix the following issue in the Linux kernel code: riscv: Add norvc after .option arch in runtime const
Problem Details: .option arch clobbers .option norvc. Prevent gas from emitting compressed instructions in the runtime const alternative blocks by setting .option norvc after .option arch. This issue starts appearing on gcc 15, which adds zca to the march. Reported by: Klara Modin <klarasmodin@gmail.com> Signed-off-by...
```diff diff --git a/arch/riscv/include/asm/runtime-const.h b/arch/riscv/include/asm/runtime-const.h index c07d049fdd5d..451fd76b8811 100644 --- a/arch/riscv/include/asm/runtime-const.h +++ b/arch/riscv/include/asm/runtime-const.h @@ -56,6 +56,7 @@ #define RISCV_RUNTIME_CONST_64_ZBA \ ".option push\n\t" \ "...
09f37f2d7b21ff35b8b533f9ab8cfad2fe8f72f6
Analyze and fix the following issue in the Linux kernel code: sched/smt: Always inline sched_smt_active()
Problem Details: sched_smt_active() can be called from noinstr code, so it should always be inlined. The CONFIG_SCHED_SMT version already has __always_inline. Do the same for its !CONFIG_SCHED_SMT counterpart. Fixes the following warning: vmlinux.o: error: objtool: intel_idle_ibrs+0x13: call to sched_smt_active() ...
```diff diff --git a/include/linux/sched/smt.h b/include/linux/sched/smt.h index fb1e295e7e63..166b19af956f 100644 --- a/include/linux/sched/smt.h +++ b/include/linux/sched/smt.h @@ -12,7 +12,7 @@ static __always_inline bool sched_smt_active(void) return static_branch_likely(&sched_smt_present); } #else -static inl...
e77956e4e5c11218e60a1fe8cdbccd02476f2e56
Analyze and fix the following issue in the Linux kernel code: objtool: Fix verbose disassembly if CROSS_COMPILE isn't set
Problem Details: In verbose mode, when printing the disassembly of affected functions, if CROSS_COMPILE isn't set, the objdump command string gets prefixed with "(null)". Somehow this worked before. Maybe some versions of glibc return an empty string instead of NULL. Fix it regardless. [ jpoimboe: Rewrite commit lo...
```diff diff --git a/tools/objtool/check.c b/tools/objtool/check.c index ff83be1aab1d..4a1f6c3169b3 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -4523,6 +4523,8 @@ static void disas_funcs(const char *funcs) char *cmd; cross_compile = getenv("CROSS_COMPILE"); + if (!cross_compile) + cross_com...
3f7023171df43641a8a8a1c9a12124501e589010
Analyze and fix the following issue in the Linux kernel code: riscv/purgatory: 4B align purgatory_start
Problem Details: When a crashkernel is launched on RISC-V, the entry to purgatory is done by trapping via the stvec CSR. From riscv_kexec_norelocate(): | ... | /* | * Switch to physical addressing | * This will also trigger a jump to CSR_STVEC | * which in this case is the address of the new | * ...
```diff diff --git a/arch/riscv/purgatory/entry.S b/arch/riscv/purgatory/entry.S index 0e6ca6d5ae4b..c5db2f072c34 100644 --- a/arch/riscv/purgatory/entry.S +++ b/arch/riscv/purgatory/entry.S @@ -12,6 +12,7 @@ .text +.align 2 SYM_CODE_START(purgatory_start) lla sp, .Lstack ```
188d90f817e13b66e03e110eb6f82e8f5f0d654b
Analyze and fix the following issue in the Linux kernel code: objtool: Append "()" to function name in "unexpected end of section" warning
Problem Details: Append with "()" to clarify it's a function. Before: vmlinux.o: warning: objtool: cdns_mrvl_xspi_setup_clock: unexpected end of section .text.cdns_mrvl_xspi_setup_clock After: vmlinux.o: warning: objtool: cdns_mrvl_xspi_setup_clock(): unexpected end of section .text.cdns_mrvl_xspi_setup_clock ...
```diff diff --git a/tools/objtool/check.c b/tools/objtool/check.c index e6c4eefe295b..bd0c78bfe90c 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -3761,7 +3761,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, return 0; WARN("%s%sunexpected end of section %s"...
28093cfef5dd62f4cbd537f2bdf6f0bf85309c45
Analyze and fix the following issue in the Linux kernel code: riscv/kexec_file: Handle R_RISCV_64 in purgatory relocator
Problem Details: Commit 58ff537109ac ("riscv: Omit optimized string routines when using KASAN") introduced calls to EXPORT_SYMBOL() in assembly string routines, which result in R_RISCV_64 relocations against .export_symbol section. As these rountines are reused by RISC-V purgatory and our relocator doesn't recognize th...
```diff diff --git a/arch/riscv/kernel/elf_kexec.c b/arch/riscv/kernel/elf_kexec.c index 3c37661801f9..e783a72d051f 100644 --- a/arch/riscv/kernel/elf_kexec.c +++ b/arch/riscv/kernel/elf_kexec.c @@ -468,6 +468,9 @@ int arch_kexec_apply_relocations_add(struct purgatory_info *pi, case R_RISCV_ALIGN: case R_RISCV_RE...
0d7597749f5a3ac67851d3836635d084df15fb66
Analyze and fix the following issue in the Linux kernel code: objtool: Ignore end-of-section jumps for KCOV/GCOV
Problem Details: When KCOV or GCOV is enabled, dead code can be left behind, in which case objtool silences unreachable and undefined behavior (fallthrough) warnings. Fallthrough warnings, and their variant "end of section" warnings, were silenced with the following commit: 6b023c784204 ("objtool: Silence more KCOV...
```diff diff --git a/tools/objtool/check.c b/tools/objtool/check.c index fff9d7a2947a..e6c4eefe295b 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1488,6 +1488,8 @@ static int add_jump_destinations(struct objtool_file *file) int ret; for_each_insn(file, insn) { + struct symbol *func = insn_fu...
55c78035a1a8dfb05f1472018ce2a651701adb7d
Analyze and fix the following issue in the Linux kernel code: objtool: Silence more KCOV warnings, part 2
Problem Details: Similar to GCOV, KCOV can leave behind dead code and undefined behavior. Warnings related to those should be ignored. The previous commit: 6b023c784204 ("objtool: Silence more KCOV warnings") ... only did so for CONFIG_CGOV_KERNEL. Also do it for CONFIG_KCOV, but for real this time. Fixes the fo...
```diff diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index b93597420daf..4d543054f723 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -275,7 +275,7 @@ objtool-args-$(CONFIG_MITIGATION_SLS) += --sls objtool-args-$(CONFIG_STACK_VALIDATION) += --stackval objtool-args-$(CONFIG_HAVE_STATIC_...
79ba5c1c7767a539f42c6f6db46961b0bec2bc03
Analyze and fix the following issue in the Linux kernel code: selftests: riscv: fix v_exec_initval_nolibc.c
Problem Details: Vector registers are zero initialized by the kernel. Stop accepting "all ones" as a clean value. Note that this was not working as expected given that value == 0xff can be assumed to be always false by the compiler as value's range is [-128, 127]. Both GCC (-Wtype-limits) and clang (-Wtautological-co...
```diff diff --git a/tools/testing/selftests/riscv/vector/v_exec_initval_nolibc.c b/tools/testing/selftests/riscv/vector/v_exec_initval_nolibc.c index 35c0812e32de..4dde05e45a04 100644 --- a/tools/testing/selftests/riscv/vector/v_exec_initval_nolibc.c +++ b/tools/testing/selftests/riscv/vector/v_exec_initval_nolibc.c @...
83d78ac677b9fdd8ea763507c6fe02d6bf415f3a
Analyze and fix the following issue in the Linux kernel code: riscv: Fix hugetlb retrieval of number of ptes in case of !present pte
Problem Details: Ryan sent a fix [1] for arm64 that applies to riscv too: in some hugetlb functions, we must not use the pte value to get the size of a mapping because the pte may not be present. So use the already present size parameter for huge_pte_clear() and the newly introduced size parameter for huge_ptep_get_an...
```diff diff --git a/arch/riscv/mm/hugetlbpage.c b/arch/riscv/mm/hugetlbpage.c index b4a78a4b35cf..375dd96bb4a0 100644 --- a/arch/riscv/mm/hugetlbpage.c +++ b/arch/riscv/mm/hugetlbpage.c @@ -148,22 +148,25 @@ unsigned long hugetlb_mask_last_page(struct hstate *h) static pte_t get_clear_contig(struct mm_struct *mm, ...
4236ac9fe5b8b42756070d4abfb76fed718e87c2
Analyze and fix the following issue in the Linux kernel code: cifs: Fix querying and creating MF symlinks over SMB1
Problem Details: Old SMB1 servers without CAP_NT_SMBS do not support CIFS_open() function and instead SMBLegacyOpen() needs to be used. This logic is already handled in cifs_open_file() function, which is server->ops->open callback function. So for querying and creating MF symlinks use open callback function instead o...
```diff diff --git a/fs/smb/client/link.c b/fs/smb/client/link.c index a88253668286..769752ad2c5c 100644 --- a/fs/smb/client/link.c +++ b/fs/smb/client/link.c @@ -258,7 +258,7 @@ cifs_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon, struct cifs_open_parms oparms; struct cifs_io_parms io_parms = {0}; int...
6aa9f1c9cd09c1c39a35da4fe5f43446ec18ce1e
Analyze and fix the following issue in the Linux kernel code: cifs: Fix access_flags_to_smbopen_mode
Problem Details: When converting access_flags to SMBOPEN mode, check for all possible access flags, not only GENERIC_READ and GENERIC_WRITE flags. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
```diff diff --git a/fs/smb/client/cifssmb.c b/fs/smb/client/cifssmb.c index 29dcb88392e5..60cb264a01e5 100644 --- a/fs/smb/client/cifssmb.c +++ b/fs/smb/client/cifssmb.c @@ -1041,15 +1041,31 @@ static __u16 convert_disposition(int disposition) static int access_flags_to_smbopen_mode(const int access_flags) { - int ...
e94e882a6d69525c07589222cf3a6ff57ad12b5b
Analyze and fix the following issue in the Linux kernel code: cifs: Fix negotiate retry functionality
Problem Details: SMB negotiate retry functionality in cifs_negotiate() is currently broken and does not work when doing socket reconnect. Caller of this function, which is cifs_negotiate_protocol() requires that tcpStatus after successful execution of negotiate callback stay in CifsInNegotiate. But if the CIFSSMBNegoti...
```diff diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index 69274d6ed2e1..f298e86a3c1f 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -4202,11 +4202,13 @@ int cifs_negotiate_protocol(const unsigned int xid, struct cifs_ses *ses, struct TCP_Server_Info *server) { + bool in_r...
665e18794804f8b42b6ae5d436a154342f62e288
Analyze and fix the following issue in the Linux kernel code: cifs: Improve handling of NetBIOS packets
Problem Details: Now all NetBIOS session logic is handled in ip_rfc1001_connect() function, so cleanup is_smb_response() function which contains generic handling of incoming SMB packets. Note that function is_smb_response() is not used directly or indirectly (e.g. over cifs_demultiplex_thread() by ip_rfc1001_connect() ...
```diff diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h index 9b0c142c832c..07c4688ec4c9 100644 --- a/fs/smb/client/cifsglob.h +++ b/fs/smb/client/cifsglob.h @@ -715,6 +715,7 @@ struct TCP_Server_Info { __u64 conn_id; /* connection identifier (useful for debugging) */ int srv_count; /* reference co...
b1a37df6ba2f13be341130b9fe10649ef6a42e9a
Analyze and fix the following issue in the Linux kernel code: cifs: Add a new xattr system.smb3_ntsd_owner for getting or setting owner
Problem Details: Changing owner is controlled by DACL permission WRITE_OWNER. Changing DACL itself is controlled by DACL permisssion WRITE_DAC. Owner of the file has implicit WRITE_DAC permission even when it is not explicitly granted for owner by DACL. Reading DACL or owner is controlled only by one permission READ_C...
```diff diff --git a/fs/smb/client/xattr.c b/fs/smb/client/xattr.c index 95b8269851f3..b88fa04f5792 100644 --- a/fs/smb/client/xattr.c +++ b/fs/smb/client/xattr.c @@ -32,6 +32,7 @@ */ #define SMB3_XATTR_CIFS_ACL "system.smb3_acl" /* DACL only */ #define SMB3_XATTR_CIFS_NTSD_SACL "system.smb3_ntsd_sacl" /* SACL only...
bf782ada459efde8fe9a488cf30a40d32caf787f
Analyze and fix the following issue in the Linux kernel code: cifs: Add a new xattr system.smb3_ntsd_sacl for getting or setting SACLs
Problem Details: Access to SACL part of SMB security descriptor is granted by SACL privilege which by default is accessible only for local administrator. But it can be granted to any other user by local GPO or AD. SACL access is not granted by DACL permissions and therefore is it possible that some user would not have ...
```diff diff --git a/fs/smb/client/xattr.c b/fs/smb/client/xattr.c index 7d49f38f01f3..95b8269851f3 100644 --- a/fs/smb/client/xattr.c +++ b/fs/smb/client/xattr.c @@ -31,6 +31,7 @@ * secure, replaced by SMB2 (then even more highly secure SMB3) many years ago */ #define SMB3_XATTR_CIFS_ACL "system.smb3_acl" /* DACL...
f1350c2c74e62afbc77048ed35718f42b3baba91
Analyze and fix the following issue in the Linux kernel code: bcachefs: fix ref leak in btree_node_read_all_replicas
Problem Details: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/btree_io.c b/fs/bcachefs/btree_io.c index 1d94a2bf706d..871f3f46a0c2 100644 --- a/fs/bcachefs/btree_io.c +++ b/fs/bcachefs/btree_io.c @@ -1609,6 +1609,7 @@ static void btree_node_read_all_replicas_endio(struct bio *bio) struct bch_dev *ca = bch2_dev_have_ref(c, rb->pick.ptr.dev); ...
bf21e29d78cd2c2371023953d9c82dfef82ebb36
Analyze and fix the following issue in the Linux kernel code: ksmbd: validate zero num_subauth before sub_auth is accessed
Problem Details: Access psid->sub_auth[psid->num_subauth - 1] without checking if num_subauth is non-zero leads to an out-of-bounds read. This patch adds a validation step to ensure num_subauth != 0 before sub_auth is accessed. Cc: stable@vger.kernel.org Signed-off-by: Norbert Szetei <norbert@doyensec.com> Acked-by: N...
```diff diff --git a/fs/smb/server/smbacl.c b/fs/smb/server/smbacl.c index 2693ea2d67aa..5aa7a66334d9 100644 --- a/fs/smb/server/smbacl.c +++ b/fs/smb/server/smbacl.c @@ -270,6 +270,11 @@ static int sid_to_id(struct mnt_idmap *idmap, return -EIO; } + if (psid->num_subauth == 0) { + pr_err("%s: zero subauthoriti...
beff0bc9d69bc8e733f9bca28e2d3df5b3e10e42
Analyze and fix the following issue in the Linux kernel code: ksmbd: fix overflow in dacloffset bounds check
Problem Details: The dacloffset field was originally typed as int and used in an unchecked addition, which could overflow and bypass the existing bounds check in both smb_check_perm_dacl() and smb_inherit_dacl(). This could result in out-of-bounds memory access and a kernel crash when dereferencing the DACL pointer. ...
```diff diff --git a/fs/smb/server/smbacl.c b/fs/smb/server/smbacl.c index 49b128698670..2693ea2d67aa 100644 --- a/fs/smb/server/smbacl.c +++ b/fs/smb/server/smbacl.c @@ -1026,7 +1026,9 @@ int smb_inherit_dacl(struct ksmbd_conn *conn, struct dentry *parent = path->dentry->d_parent; struct mnt_idmap *idmap = mnt_idm...
fa4cdb8cbca7d6cb6aa13e4d8d83d1103f6345db
Analyze and fix the following issue in the Linux kernel code: ksmbd: fix session use-after-free in multichannel connection
Problem Details: There is a race condition between session setup and ksmbd_sessions_deregister. The session can be freed before the connection is added to channel list of session. This patch check reference count of session before freeing it. Cc: stable@vger.kernel.org Reported-by: Sean Heelan <seanheelan@gmail.com> S...
```diff diff --git a/fs/smb/server/auth.c b/fs/smb/server/auth.c index 00b31cf86462..83caa3849749 100644 --- a/fs/smb/server/auth.c +++ b/fs/smb/server/auth.c @@ -1016,9 +1016,9 @@ static int ksmbd_get_encryption_key(struct ksmbd_work *work, __u64 ses_id, ses_enc_key = enc ? sess->smb3encryptionkey : sess->smb3d...
2510859475d7f46ed7940db0853f3342bf1b65ee
Analyze and fix the following issue in the Linux kernel code: cifs: fix integer overflow in match_server()
Problem Details: The echo_interval is not limited in any way during mounting, which makes it possible to write a large number to it. This can cause an overflow when multiplying ctx->echo_interval by HZ in match_server(). Add constraints for echo_interval to smb3_fs_context_parse_param(). Found by Linux Verification C...
```diff diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index bdb762d398af..9c3ded0cf006 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -1383,6 +1383,11 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, ctx->closetimeo = HZ * result.uint_32; break; ...
f278b6d5bb465c7fd66f3d103812947e55b376ed
Analyze and fix the following issue in the Linux kernel code: Revert "tcp: avoid atomic operations on sk->sk_rmem_alloc"
Problem Details: This reverts commit 0de2a5c4b824da2205658ebebb99a55c43cdf60f. I forgot that a TCP socket could receive messages in its error queue. sock_queue_err_skb() can be called without socket lock being held, and changes sk->sk_rmem_alloc. The fact that skbs in error queue are limited by sk->sk_rcvbuf means t...
```diff diff --git a/include/net/tcp.h b/include/net/tcp.h index df04dc09c519..4450c384ef17 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -779,7 +779,6 @@ static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) /* tcp.c */ void tcp_get_info(struct sock *, struct tcp_info *); -void tcp_...
dd07df9ff3d148aee87fcbab99ff14f0727752f4
Analyze and fix the following issue in the Linux kernel code: bnxt_en: bring back rtnl lock in bnxt_shutdown
Problem Details: Taehee reports missing rtnl from bnxt_shutdown path: inetdev_event (./include/linux/inetdevice.h:256 net/ipv4/devinet.c:1585) notifier_call_chain (kernel/notifier.c:85) __dev_close_many (net/core/dev.c:1732 (discriminator 3)) kernel/locking/mutex.c:713 kernel/locking/mutex.c:732) dev_close_many (net/c...
```diff diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 934ba9425857..1a70605fad38 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -16698,6 +16698,7 @@ static void bnxt_shutdown(struct pci_dev *pdev) if ...
9e3267cf02c240065fddfbe1a58cdb99d0b00531
Analyze and fix the following issue in the Linux kernel code: eth: gve: add missing netdev locks on reset and shutdown paths
Problem Details: All the misc entry points end up calling into either gve_open() or gve_close(), they take rtnl_lock today but since the recent instance locking changes should also take the instance lock. Found by code inspection and untested. Fixes: cae03e5bdd9e ("net: hold netdev instance lock during queue operatio...
```diff diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c index cb2f9978f45e..f9a73c956861 100644 --- a/drivers/net/ethernet/google/gve/gve_main.c +++ b/drivers/net/ethernet/google/gve/gve_main.c @@ -2077,7 +2077,9 @@ static void gve_handle_reset(struct gve_priv *priv)...
b44a4c28228fc50b0af05b5d15b44c2172f112a0
Analyze and fix the following issue in the Linux kernel code: selftests: mptcp: ignore mptcp_diag binary
Problem Details: A new binary is now generated by the MPTCP selftests: mptcp_diag. Like the other binaries from this directory, there is no need to track this in Git, it should then be ignored. Fixes: 00f5e338cf7e ("selftests: mptcp: Add a tool to get specific msk_info") Reviewed-by: Mat Martineau <martineau@kernel.o...
```diff diff --git a/tools/testing/selftests/net/mptcp/.gitignore b/tools/testing/selftests/net/mptcp/.gitignore index 49daae73c41e..833279fb34e2 100644 --- a/tools/testing/selftests/net/mptcp/.gitignore +++ b/tools/testing/selftests/net/mptcp/.gitignore @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only mptcp_c...
c183165f87a486d5879f782c05a23c179c3794ab
Analyze and fix the following issue in the Linux kernel code: selftests: mptcp: close fd_in before returning in main_loop
Problem Details: The file descriptor 'fd_in' is opened when cfg_input is configured, but not closed in main_loop(), this patch fixes it. Fixes: 05be5e273c84 ("selftests: mptcp: add disconnect tests") Cc: stable@vger.kernel.org Co-developed-by: Cong Liu <liucong2@kylinos.cn> Signed-off-by: Cong Liu <liucong2@kylinos.cn...
```diff diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c index 893dc36b12f6..c83a8b47bbdf 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -1299,7 +1299,7 @@ again: ret = copyfd...
7335d4ac812917c16e04958775826d12d481c92d
Analyze and fix the following issue in the Linux kernel code: selftests: mptcp: fix incorrect fd checks in main_loop
Problem Details: Fix a bug where the code was checking the wrong file descriptors when opening the input files. The code was checking 'fd' instead of 'fd_in', which could lead to incorrect error handling. Fixes: 05be5e273c84 ("selftests: mptcp: add disconnect tests") Cc: stable@vger.kernel.org Fixes: ca7ae8916043 ("se...
```diff diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c index d240d02fa443..893dc36b12f6 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -1270,7 +1270,7 @@ int main_loop(void) ...
443041deb5ef6a1289a99ed95015ec7442f141dc
Analyze and fix the following issue in the Linux kernel code: mptcp: fix NULL pointer in can_accept_new_subflow
Problem Details: When testing valkey benchmark tool with MPTCP, the kernel panics in 'mptcp_can_accept_new_subflow' because subflow_req->msk is NULL. Call trace: mptcp_can_accept_new_subflow (./net/mptcp/subflow.c:63 (discriminator 4)) (P) subflow_syn_recv_sock (./net/mptcp/subflow.c:854) tcp_check_req (./net/i...
```diff diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index efe8d86496db..409bd415ef1d 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -754,8 +754,6 @@ static bool subflow_hmac_valid(const struct request_sock *req, subflow_req = mptcp_subflow_rsk(req); msk = subflow_req->msk; - if (!msk) - ...
323d6db6dc7decb06f2545efb9496259ddacd4f4
Analyze and fix the following issue in the Linux kernel code: octeontx2-af: Free NIX_AF_INT_VEC_GEN irq
Problem Details: Due to the incorrect initial vector number in rvu_nix_unregister_interrupts(), NIX_AF_INT_VEC_GEN is not geeting free. Fix the vector number to include NIX_AF_INT_VEC_GEN irq. Fixes: 5ed66306eab6 ("octeontx2-af: Add devlink health reporters for NIX") Signed-off-by: Geetha sowjanya <gakula@marvell.com>...
```diff diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c index dab4deca893f..27c3a2daaaa9 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c @@ -207,7 +207,7 @@ s...
0fdba88a211508984eb5df62008c29688692b134
Analyze and fix the following issue in the Linux kernel code: octeontx2-af: Fix mbox INTR handler when num VFs > 64
Problem Details: When number of RVU VFs > 64, the vfs value passed to "rvu_queue_work" function is incorrect. Due to which mbox workqueue entries for VFs 0 to 63 never gets added to workqueue. Fixes: 9bdc47a6e328 ("octeontx2-af: Mbox communication support btw AF and it's VFs") Signed-off-by: Geetha sowjanya <gakula@ma...
```diff diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c index cd0d7b7774f1..6575c422635b 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c @@ -2634,7 +2634,7 @@ static irqreturn_t rvu_mbox_int...
42f342387841891bbbd15e25d33eb510a0cf7a9a
Analyze and fix the following issue in the Linux kernel code: net: fix use-after-free in the netdev_nl_sock_priv_destroy()
Problem Details: In the netdev_nl_sock_priv_destroy(), an instance lock is acquired before calling net_devmem_unbind_dmabuf(), then releasing an instance lock(netdev_unlock(binding->dev)). However, a binding is freed in the net_devmem_unbind_dmabuf(). So using a binding after net_devmem_unbind_dmabuf() occurs UAF. To f...
```diff diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c index fd1cfa9707dc..3afeaa8c5dc5 100644 --- a/net/core/netdev-genl.c +++ b/net/core/netdev-genl.c @@ -951,12 +951,14 @@ void netdev_nl_sock_priv_destroy(struct netdev_nl_sock *priv) { struct net_devmem_dmabuf_binding *binding; struct net_devmem_d...
7220e8f4d4eec0b2f682eef45e2d36c092738413
Analyze and fix the following issue in the Linux kernel code: net: lapbether: use netdev_lockdep_set_classes() helper
Problem Details: drivers/net/wan/lapbether.c uses stacked devices. Like similar drivers, it must use netdev_lockdep_set_classes() to avoid LOCKDEP splats. This is similar to commit 9bfc9d65a1dc ("hamradio: use netdev_lockdep_set_classes() helper") Fixes: 7e4d784f5810 ("net: hold netdev instance lock during rtnetlink ...
```diff diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index 56326f38fe8a..995a7207bdf8 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c @@ -39,6 +39,7 @@ #include <linux/lapb.h> #include <linux/init.h> +#include <net/netdev_lock.h> #include <net/x25device.h> st...
f62a5d39368e34a966c8df63e1f05eed7fe9c5de
Analyze and fix the following issue in the Linux kernel code: cgroup/cpuset: Remove remote_partition_check() & make update_cpumasks_hier() handle remote partition
Problem Details: Currently, changes in exclusive CPUs are being handled in remote_partition_check() by disabling conflicting remote partitions. However, that may lead to results unexpected by the users. Fix this problem by removing remote_partition_check() and making update_cpumasks_hier() handle changes in descendant ...
```diff diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index e457b4b1db5d..0ab63f5974ba 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -86,7 +86,6 @@ static struct list_head remote_children; * A flag to force sched domain rebuild at the end of an operation. * It can be set in * ...
8bf450f3aec3d1bbd725d179502c64b8992588e4
Analyze and fix the following issue in the Linux kernel code: cgroup/cpuset: Fix error handling in remote_partition_disable()
Problem Details: When remote_partition_disable() is called to disable a remote partition, it always sets the partition to an invalid partition state. It should only do so if an error code (prs_err) has been set. Correct that and add proper error code in places where remote_partition_disable() is called due to error. F...
```diff diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 2c49d80f2a01..e457b4b1db5d 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -1406,6 +1406,7 @@ static int remote_partition_enable(struct cpuset *cs, int new_prs, list_add(&cs->remote_sibling, &remote_children); spin_unlock...
668e041662e92ab3ebcb9eb606d3ec01884546ab
Analyze and fix the following issue in the Linux kernel code: cgroup/cpuset: Fix incorrect isolated_cpus update in update_parent_effective_cpumask()
Problem Details: Before commit f0af1bfc27b5 ("cgroup/cpuset: Relax constraints to partition & cpus changes"), a cpuset partition cannot be enabled if not all the requested CPUs can be granted from the parent cpuset. After that commit, a cpuset partition can be created even if the requested exclusive CPUs contain CPUs n...
```diff diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 39c1fc643d77..2c49d80f2a01 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -1679,9 +1679,9 @@ static int update_parent_effective_cpumask(struct cpuset *cs, int cmd, if (nocpu) return PERR_NOCPUS; - cpumask_copy(tmp-...
65f2a3b2323edde7c5de3a44e67fec00873b4217
Analyze and fix the following issue in the Linux kernel code: btrfs: remove folio order ASSERT()s in super block writeback path
Problem Details: [BUG] There is a syzbot report that the ASSERT() inside write_dev_supers() got triggered: assertion failed: folio_order(folio) == 0, in fs/btrfs/disk-io.c:3858 ------------[ cut here ]------------ kernel BUG at fs/btrfs/disk-io.c:3858! Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI CPU: 0 U...
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 1a916716cefe..d0da9988ea48 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3853,7 +3853,6 @@ static int write_dev_supers(struct btrfs_device *device, atomic_inc(&device->sb_write_errors); continue; } - ASSERT(folio_order(folio) ...
dc08c58696f8555e4a802f1f23c894a330d80ab7
Analyze and fix the following issue in the Linux kernel code: btrfs: correctly escape subvol in btrfs_show_options()
Problem Details: Currently, displaying the btrfs subvol mount option doesn't escape ','. This makes parsing /proc/self/mounts and /proc/self/mountinfo ambiguous for subvolume names that contain commas. The text after the comma could be mistaken for another option (think "subvol=foo,ro", where ro is actually part of the...
```diff diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 40709e2a44fc..7121d8c7a318 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1139,8 +1139,7 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry) subvol_name = btrfs_get_subvol_name_from_objectid(info, btrfs_root_id(BTRF...
8e587ab43cb92a9e57f99ea8d6c069ee65863707
Analyze and fix the following issue in the Linux kernel code: btrfs: ioctl: don't free iov when btrfs_encoded_read() returns -EAGAIN
Problem Details: Fix a bug in encoded read that mistakenly frees the iov in case btrfs_encoded_read() returns -EAGAIN assuming the structure will be reused. This can happen when when receiving requests concurrently, the io_uring subsystem does not reset the data, and the last free will happen in btrfs_uring_read_finis...
```diff diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index a13d81bb56a0..63aeacc54945 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -4902,6 +4902,8 @@ static int btrfs_uring_encoded_read(struct io_uring_cmd *cmd, unsigned int issue ret = btrfs_encoded_read(&kiocb, &data->iter, &data->args, &cached_sta...
88fd03cf51a7d67dac976ecce079ccfc79376966
Analyze and fix the following issue in the Linux kernel code: wifi: ath11k: support non-WoWLAN mode suspend as well
Problem Details: Previously commit 166a490f59ac ("wifi: ath11k: support hibernation") was reverted due to [1], so currently we only support WoWLAN mode suspend. This works well in scenarios where WLAN power is sustained during suspend, however breaks in those where power is cut off. This change basically brings the re...
```diff diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c index eedba3766ba2..511f5f91da0f 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -413,7 +413,7 @@ static int ath11k_ahb_power_up(struct ath11k_base *ab) return ret; } ...
662cc5b92c327e94587a959d7ed75862eda4b059
Analyze and fix the following issue in the Linux kernel code: wifi: ath11k: refactor ath11k_core_suspend/_resume()
Problem Details: Due to [1] we currently put WLAN target into WoWLAN mode regardless of machine models. In upcoming patches we will support another mode, and finally which mode is chosen depends on the exact machine model. To prepare for such change, refactor the actual WoWLAN stuff in ath11k_core_suspend() into a new...
```diff diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c index 39922383f28c..e9077b1c4c52 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -1034,14 +1034,10 @@ static int ath11k_core_continue_suspend_resume(struct ath11k_base...
ce8669a27016354dfa8bf3c954255cb9f3583bae
Analyze and fix the following issue in the Linux kernel code: wifi: ath11k: determine PM policy based on machine model
Problem Details: To handle the Lenovo unexpected wakeup issue [1], previously we revert commit 166a490f59ac ("wifi: ath11k: support hibernation"). So currently WLAN target is put into WoWLAN mode during suspend. This is a temporary solution as it does not work on machines where WLAN power is cut off. The thought here ...
```diff diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c index 3d39ff85ba94..f3a29f5d2381 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -907,6 +907,52 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { }, };...
de399658588931506e1b3f4cc63cb3c9134a692e
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix null ptr deref in bch2_write_endio()
Problem Details: This was previously hard to hit since it requires racing with device removal, but splitting up io_ref uncovered it. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/io_write.c b/fs/bcachefs/io_write.c index 07b55839768e..0503ac1952cd 100644 --- a/fs/bcachefs/io_write.c +++ b/fs/bcachefs/io_write.c @@ -697,12 +697,19 @@ static void bch2_write_endio(struct bio *bio) bch2_account_io_completion(ca, BCH_MEMBER_ERROR_write, wbio->submit_time, !...
7f10fde38f0ac242760e36394e731d25f27e6063
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix field spanning write warning
Problem Details: Struct with embedded VLA... memcpy: detected field-spanning write (size 8) of single field "&gc->r.e" at fs/bcachefs/ec.c:465 (size 3) WARNING: CPU: 1 PID: 936 at fs/bcachefs/ec.c:465 bch2_trigger_stripe+0x706/0x730 Modules linked in: CPU: 1 UID: 0 PID: 936 Comm: mount.bcachefs Not tainted 6.14.0-rc6-...
```diff diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 0903311cc71e..297adb996751 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -707,7 +707,7 @@ err: struct disk_accounting_pos acc; memset(&acc, 0, sizeof(acc)); acc.type = BCH_DISK_ACCOUNTING_replicas; - memcpy(&acc.repli...
f540876f4eea82295f3af72f786aae51b7378fb2
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix striping behaviour
Problem Details: For striping across devices, we maintain "clocks", and we advance them by the inverse of "how much free space this device has left", so that we round robin biased in favor of devices with more free space. This code was originally trying to do EWMA-ish stuff when originally written, ~10 years ago, and ...
```diff diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c index da0d72928b5b..1a25a8a4ae09 100644 --- a/fs/bcachefs/alloc_foreground.c +++ b/fs/bcachefs/alloc_foreground.c @@ -606,8 +606,7 @@ struct open_bucket *bch2_bucket_alloc(struct bch_fs *c, struct bch_dev *ca, static int __dev_stripe_...
1e7857b28020ba57ca7fdafae7ac855ba326c697
Analyze and fix the following issue in the Linux kernel code: x86: don't re-generate cpufeaturemasks.h so eagerly
Problem Details: It turns out the code to generate the x86 cpufeaturemasks.h header was way too aggressive, and would re-generate it whenever the timestamp on the kernel config file changed. Now, the regular 'make *config' tools are fairly careful to not rewrite the kernel config file unless the contents change, but o...
```diff diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 0fc7e8fd1a2e..27efe2dc2aa8 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -277,12 +277,11 @@ cpufeaturemasks.hdr := arch/x86/include/generated/asm/cpufeaturemasks.h cpufeaturemasks.awk := $(srctree)/arch/x86/tools/cpufeaturemasks.awk cpufeatu...
95c18b7ccdd1b2e6704651b66565339ada318ba2
Analyze and fix the following issue in the Linux kernel code: riscv: Add norvc after .option arch in runtime const
Problem Details: .option arch clobbers .option norvc. Prevent gas from emitting compressed instructions in the runtime const alternative blocks by setting .option norvc after .option arch. This issue starts appearing on gcc 15, which adds zca to the march. Reported by: Klara Modin <klarasmodin@gmail.com> Signed-off-by...
```diff diff --git a/arch/riscv/include/asm/runtime-const.h b/arch/riscv/include/asm/runtime-const.h index ea2e49c7149c..1ba0985a7ffe 100644 --- a/arch/riscv/include/asm/runtime-const.h +++ b/arch/riscv/include/asm/runtime-const.h @@ -56,6 +56,7 @@ #define RISCV_RUNTIME_CONST_64_ZBA \ ".option push\n\t" \ "...
61672806b579dd5a150a042ec9383be2bbc2ae7e
Analyze and fix the following issue in the Linux kernel code: drm/xe: Invalidate L3 read-only cachelines for geometry streams too
Problem Details: Historically, the Vertex Fetcher unit has not been an L3 client. That meant that, when a buffer containing vertex data was written to, it was necessary to issue a PIPE_CONTROL::VF Cache Invalidate to invalidate any VF L2 cachelines associated with that buffer, so the new value would be properly read f...
```diff diff --git a/drivers/gpu/drm/xe/instructions/xe_gpu_commands.h b/drivers/gpu/drm/xe/instructions/xe_gpu_commands.h index a255946b6f77..8cfcd3360896 100644 --- a/drivers/gpu/drm/xe/instructions/xe_gpu_commands.h +++ b/drivers/gpu/drm/xe/instructions/xe_gpu_commands.h @@ -41,6 +41,7 @@ #define GFX_OP_PIPE_CONT...
7ba0847fa1c22e7801cebfe5f7b75aee4fae317e
Analyze and fix the following issue in the Linux kernel code: spi: cadence: Fix out-of-bounds array access in cdns_mrvl_xspi_setup_clock()
Problem Details: If requested_clk > 128, cdns_mrvl_xspi_setup_clock() iterates over the entire cdns_mrvl_xspi_clk_div_list array without breaking out early, causing 'i' to go beyond the array bounds. Fix that by stopping the loop when it gets to the last entry, clamping the clock to the minimum 6.25 MHz. Fixes the fo...
```diff diff --git a/drivers/spi/spi-cadence-xspi.c b/drivers/spi/spi-cadence-xspi.c index aed98ab14334..6dcba0e0ddaa 100644 --- a/drivers/spi/spi-cadence-xspi.c +++ b/drivers/spi/spi-cadence-xspi.c @@ -432,7 +432,7 @@ static bool cdns_mrvl_xspi_setup_clock(struct cdns_xspi_dev *cdns_xspi, u32 clk_reg; bool update_...
3f2bdccbccdcb53b0d316474eafff2e3462a51ad
Analyze and fix the following issue in the Linux kernel code: drm/xe: Restore EIO errno return when GuC PC start fails
Problem Details: Commit b4b05e53b550 ("drm/xe/guc_pc: Retry and wait longer for GuC PC start"), leads to the following Smatch static checker warning: drivers/gpu/drm/xe/xe_guc_pc.c:1073 xe_guc_pc_start() warn: missing error code here? '_dev_err()' failed. 'ret' = '0' Fixes: b4b05e53b550 ("drm/xe/guc_p...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c index 85215313976c..43b1192ba61c 100644 --- a/drivers/gpu/drm/xe/xe_guc_pc.c +++ b/drivers/gpu/drm/xe/xe_guc_pc.c @@ -1070,6 +1070,7 @@ int xe_guc_pc_start(struct xe_guc_pc *pc) if (wait_for_pc_state(pc, SLPC_GLOBAL_STATE_RUNNING, ...
1ebd4944266e86a7ce274f197847f5a6399651e8
Analyze and fix the following issue in the Linux kernel code: ASoC: codecs: rt5665: Fix some error handling paths in rt5665_probe()
Problem Details: Should an error occur after a successful regulator_bulk_enable() call, regulator_bulk_disable() should be called, as already done in the remove function. Instead of adding an error handling path in the probe, switch from devm_regulator_bulk_get() to devm_regulator_bulk_get_enable() and simplify the re...
```diff diff --git a/sound/soc/codecs/rt5665.c b/sound/soc/codecs/rt5665.c index e0d1991cffdb..bcb6d7c6f301 100644 --- a/sound/soc/codecs/rt5665.c +++ b/sound/soc/codecs/rt5665.c @@ -31,9 +31,7 @@ #include "rl6231.h" #include "rt5665.h" -#define RT5665_NUM_SUPPLIES 3 - -static const char *rt5665_supply_names[RT5665...
930af58421acf971a2f377c07d4cc74f5f520066
Analyze and fix the following issue in the Linux kernel code: drm/i915/dram: Consolidate logging of DRAM type
Problem Details: Instead of logging the dram type in the per version/platform function, do it in the generic one. This fixes a few discrepancies depending on the platform: - There was no DRAM type logging for graphics version 12 and above - For graphics version 11, it would log the DRAM type in skl_get_dram_in...
```diff diff --git a/drivers/gpu/drm/i915/soc/intel_dram.c b/drivers/gpu/drm/i915/soc/intel_dram.c index 39d8520ee621..eee5c4f45a43 100644 --- a/drivers/gpu/drm/i915/soc/intel_dram.c +++ b/drivers/gpu/drm/i915/soc/intel_dram.c @@ -450,8 +450,6 @@ skl_get_dram_info(struct drm_i915_private *i915) int ret; dram_info...
ebca08fef88febdb0a898cefa7c99b9e25b3a984
Analyze and fix the following issue in the Linux kernel code: ACPI: video: Handle fetching EDID as ACPI_TYPE_PACKAGE
Problem Details: The _DDC method should return a buffer, or an integer in case of an error. But some Lenovo laptops incorrectly return EDID as buffer in ACPI package. Calling _DDC generates this ACPI Warning: ACPI Warning: \_SB.PCI0.GP17.VGA.LCD._DDC: Return type mismatch - \ found Package, expected Integer/Buffer (20...
```diff diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c index efdadc74e3f4..103f29661576 100644 --- a/drivers/acpi/acpi_video.c +++ b/drivers/acpi/acpi_video.c @@ -649,6 +649,13 @@ acpi_video_device_EDID(struct acpi_video_device *device, void **edid, int length obj = buffer.pointer; + /* + * S...
bee964bd14ae951c7b6eb59b4421e1ccd9edb69b
Analyze and fix the following issue in the Linux kernel code: drm/i915/display: Fix htmldocs build
Problem Details: Fixes a wrong documentation block indentation: Documentation/gpu/i915:141: ./drivers/gpu/drm/i915/display/intel_hotplug.c:1080: ERROR: Unexpected indentation. Documentation/gpu/i915:141: ./drivers/gpu/drm/i915/display/intel_hotplug.c:1082: WARNING: Block quote ends without a blank line; unexpected uni...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c index dce9cde03d70..6885e5a09079 100644 --- a/drivers/gpu/drm/i915/display/intel_hotplug.c +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c @@ -1075,6 +1075,7 @@ static bool unblock_hpd_pin(struct intel_di...
a93dad6f4e6a04a5943f6ee5686585f24abf7063
Analyze and fix the following issue in the Linux kernel code: ASoC: q6apm-dai: make use of q6apm_get_hw_pointer
Problem Details: With the existing code, the buffer position is only reset in pointer callback, which leaves the possiblity of it going over the size of buffer size and reporting incorrect position to userspace. Without this patch, its possible to see errors like: snd-x1e80100 sound: invalid position: pcmC0D0p:0, pos ...
```diff diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-dai.c index 237c4c8ce9c9..2cd522108221 100644 --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -64,7 +64,6 @@ struct q6apm_dai_rtd { phys_addr_t phys; unsigned int pcm_size; unsigned int pcm_count; -...
5d01ed9b9939b4c726be74db291a982bc984c584
Analyze and fix the following issue in the Linux kernel code: ASoC: qdsp6: q6apm-dai: fix capture pipeline overruns.
Problem Details: Period sizes less than 6k for capture path triggers overruns in the dsp capture pipeline. Change the period size and number of periods to value which DSP is happy with. Fixes: 9b4fe0f1cd79 ("ASoC: qdsp6: audioreach: add q6apm-dai support") Cc: stable@vger.kernel.org Signed-off-by: Srinivas Kandagatla...
```diff diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-dai.c index d2952d4ac646..237c4c8ce9c9 100644 --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -24,8 +24,8 @@ #define PLAYBACK_MIN_PERIOD_SIZE 128 #define CAPTURE_MIN_NUM_PERIODS 2 #define CAPTURE_MAX_...
3107019501842c27334554ba9d6583b1f200f61f
Analyze and fix the following issue in the Linux kernel code: ASoC: qdsp6: q6apm-dai: set 10 ms period and buffer alignment.
Problem Details: DSP expects the periods to be aligned to fragment sizes, currently setting up to hw constriants on periods bytes is not going to work correctly as we can endup with periods sizes aligned to 32 bytes however not aligned to fragment size. Update the constriants to use fragment size, and also set at step...
```diff diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-dai.c index 9d8e8e37c6de..d2952d4ac646 100644 --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -394,13 +394,14 @@ static int q6apm_dai_open(struct snd_soc_component *component, } } - ret = snd_pcm_h...
0badb5432fd525a00db5630c459b635e9d47f445
Analyze and fix the following issue in the Linux kernel code: ASoC: q6apm: add q6apm_get_hw_pointer helper
Problem Details: Implement an helper function in q6apm to be able to read the current hardware pointer for both read and write buffers. This should help q6apm-dai to get the hardware pointer consistently without it doing manual calculation, which could go wrong in some race conditions. Fixes: 9b4fe0f1cd79 ("ASoC: qds...
```diff diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index 11e252a70f69..b4ffa0f0b188 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -494,6 +494,19 @@ int q6apm_read(struct q6apm_graph *graph) } EXPORT_SYMBOL_GPL(q6apm_read); +int q6apm_get_hw_pointer(str...
3d4a4411aa8bbc3653ff22a1ff0432eb93d22ae0
Analyze and fix the following issue in the Linux kernel code: ASoC: q6apm-dai: schedule all available frames to avoid dsp under-runs
Problem Details: With the existing code, we are only setting up one period at a time, in a ping-pong buffer style. This triggers lot of underruns in the dsp leading to jitter noise during audio playback. Fix this by scheduling all available periods, this will ensure that the dsp has enough buffer feed and ultimatley f...
```diff diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-dai.c index c9404b5934c7..9d8e8e37c6de 100644 --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -70,6 +70,7 @@ struct q6apm_dai_rtd { unsigned int bytes_received; unsigned int copied_total; uint16_t b...
c4eac403519512aef12250cb93ebfdd0966d76f9
Analyze and fix the following issue in the Linux kernel code: drm/xe: Don't print error about hwconfig when using execlists
Problem Details: This error message is only applicable for platforms using GuC submission - to warn the user if the GuC they are using or the platform they are running doesn't have this information to provide to userspace about the platform. When forcing execlist submission, which is something only used for debug, the ...
```diff diff --git a/drivers/gpu/drm/xe/xe_gt_mcr.c b/drivers/gpu/drm/xe/xe_gt_mcr.c index 605aad3554e7..d4d9730f0d2c 100644 --- a/drivers/gpu/drm/xe/xe_gt_mcr.c +++ b/drivers/gpu/drm/xe/xe_gt_mcr.c @@ -345,7 +345,8 @@ fallback: * Some older platforms don't have tables or don't have complete tables. * Newer platf...
487a0710f87e7fa1f260a1b2213b77f0496cea43
Analyze and fix the following issue in the Linux kernel code: io_uring: make zcrx depend on CONFIG_IO_URING
Problem Details: Reflect in the kconfig that zcrx requires io_uring compiled. Fixes: 6f377873cb239 ("io_uring/zcrx: add interface queue and refill queue") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/8047135a344e79dbd04ee36a7a69cc260aabc2ca.1743356260.git.asml.silence@gmail.co...
```diff diff --git a/io_uring/Kconfig b/io_uring/Kconfig index 9e2a4beba1ef..4b949c42c0bf 100644 --- a/io_uring/Kconfig +++ b/io_uring/Kconfig @@ -5,6 +5,7 @@ config IO_URING_ZCRX def_bool y + depends on IO_URING depends on PAGE_POOL depends on INET depends on NET_RX_BUSY_POLL ```
f28a71bc979392234cc110cd1e6787fb5b432116
Analyze and fix the following issue in the Linux kernel code: Documentation: ublk: remove dead footnote
Problem Details: A previous commit removed the use of this footnote, delete it. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Fixes: 3fdf2ec7da1c ("Documentation: ublk: Drop Stefan Hajnoczi's message footnote") Signed-off-by: Jens Axboe <axboe@kernel.dk>
```diff diff --git a/Documentation/block/ublk.rst b/Documentation/block/ublk.rst index 74c57488dc9a..854f823b46c2 100644 --- a/Documentation/block/ublk.rst +++ b/Documentation/block/ublk.rst @@ -349,5 +349,3 @@ References .. [#userspace_nbdublk] https://gitlab.com/rwmjones/libnbd/-/tree/nbdublk .. [#userspace_readm...
1dfe2a220e9cd85861a853b00d8620222b960c1f
Analyze and fix the following issue in the Linux kernel code: fuse: fix uring race condition for null dereference of fc
Problem Details: There is a race condition leading to a kernel crash from a null dereference when attemping to access fc->lock in fuse_uring_create_queue(). fc may be NULL in the case where another thread is creating the uring in fuse_uring_create() and has set fc->ring but has not yet set ring->fc when fuse_uring_crea...
```diff diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index 03062ee69b70..e11786e92250 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -235,11 +235,11 @@ static struct fuse_ring *fuse_uring_create(struct fuse_conn *fc) init_waitqueue_head(&ring->stop_waitq); - fc->ring = ring; ring->nr_qu...
0f6439f61a6e2ddc92b98362c6d1afc210f56a90
Analyze and fix the following issue in the Linux kernel code: fuse: add kernel-enforced timeout option for requests
Problem Details: There are situations where fuse servers can become unresponsive or stuck, for example if the server is deadlocked. Currently, there's no good way to detect if a server is stuck and needs to be killed manually. This commit adds an option for enforcing a timeout (in seconds) for requests where if the ti...
```diff diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 2645cd8accfd..f48afffcb2a5 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -32,6 +32,103 @@ MODULE_ALIAS("devname:fuse"); static struct kmem_cache *fuse_req_cachep; +/* Frequency (in seconds) of request timeout checks, if opted into */ +#define FUSE_TIMEOU...
09098e62e4be8f0755e58d6078aaf27cbd9a3a8d
Analyze and fix the following issue in the Linux kernel code: fuse: {io-uring} Fix a possible req cancellation race
Problem Details: task-A (application) might be in request_wait_answer and try to remove the request when it has FR_PENDING set. task-B (a fuse-server io-uring task) might handle this request with FUSE_IO_URING_CMD_COMMIT_AND_FETCH, when fetching the next request and accessed the req from the pending list in fuse_uring...
```diff diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 2c3a4d09e500..2645cd8accfd 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -407,6 +407,24 @@ static int queue_interrupt(struct fuse_req *req) return 0; } +bool fuse_remove_pending_req(struct fuse_req *req, spinlock_t *lock) +{ + spin_lock(lock); + if (test...
4f1eaabb4b66a1f7473f584e14e15b2ac19dfaf3
Analyze and fix the following issue in the Linux kernel code: net: phy: broadcom: Correct BCM5221 PHY model detection
Problem Details: Correct detect condition is applied to the entire 5221 family of PHYs. Fixes: 3abbd0699b67 ("net: phy: broadcom: add support for BCM5221 phy") Signed-off-by: Jim Liu <jim.t90615@gmail.com> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Reviewed-by: Florian Fainelli <florian.faine...
```diff diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c index 13e43fee1906..9b1de54fd483 100644 --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c @@ -859,7 +859,7 @@ static int brcm_fet_config_init(struct phy_device *phydev) return reg; /* Unmask events we are interested in a...
d893da85e06edf54737bb80648bb58ba8fd56d9f
Analyze and fix the following issue in the Linux kernel code: accel/ivpu: Fix PM related deadlocks in MS IOCTLs
Problem Details: Prevent runtime resume/suspend while MS IOCTLs are in progress. Failed suspend will call ivpu_ms_cleanup() that would try to acquire file_priv->ms_lock, which is already held by the IOCTLs. Fixes: cdfad4db7756 ("accel/ivpu: Add NPU profiling support") Cc: stable@vger.kernel.org # v6.11+ Signed-off-by:...
```diff diff --git a/drivers/accel/ivpu/ivpu_debugfs.c b/drivers/accel/ivpu/ivpu_debugfs.c index 8180b95ed69d..093a2e93b0b3 100644 --- a/drivers/accel/ivpu/ivpu_debugfs.c +++ b/drivers/accel/ivpu/ivpu_debugfs.c @@ -331,7 +331,7 @@ ivpu_force_recovery_fn(struct file *file, const char __user *user_buf, size_t si retur...
9a6f56762d23a1f3af15e67901493c927caaf882
Analyze and fix the following issue in the Linux kernel code: accel/ivpu: Fix deadlock in ivpu_ms_cleanup()
Problem Details: Fix deadlock in ivpu_ms_cleanup() by preventing runtime resume after file_priv->ms_lock is acquired. During a failure in runtime resume, a cold boot is executed, which calls ivpu_ms_cleanup_all(). This function calls ivpu_ms_cleanup() that acquires file_priv->ms_lock and causes the deadlock. Fixes: c...
```diff diff --git a/drivers/accel/ivpu/ivpu_ms.c b/drivers/accel/ivpu/ivpu_ms.c index ffe7b10f8a76..eb485cf15ad6 100644 --- a/drivers/accel/ivpu/ivpu_ms.c +++ b/drivers/accel/ivpu/ivpu_ms.c @@ -4,6 +4,7 @@ */ #include <drm/drm_file.h> +#include <linux/pm_runtime.h> #include "ivpu_drv.h" #include "ivpu_gem.h" ...
6b4568b675b14cf890c0c21779773c3e08e80ce5
Analyze and fix the following issue in the Linux kernel code: accel/ivpu: Fix warning in ivpu_ipc_send_receive_internal()
Problem Details: Warn if device is suspended only when runtime PM is enabled. Runtime PM is disabled during reset/recovery and it is not an error to use ivpu_ipc_send_receive_internal() in such cases. Fixes: 5eaa49741119 ("accel/ivpu: Prevent recovery invocation during probe and resume") Cc: stable@vger.kernel.org # v...
```diff diff --git a/drivers/accel/ivpu/ivpu_ipc.c b/drivers/accel/ivpu/ivpu_ipc.c index 01ebf88fe6ef..5daaf07fc1a7 100644 --- a/drivers/accel/ivpu/ivpu_ipc.c +++ b/drivers/accel/ivpu/ivpu_ipc.c @@ -302,7 +302,8 @@ ivpu_ipc_send_receive_internal(struct ivpu_device *vdev, struct vpu_jsm_msg *req struct ivpu_ipc_consum...
9e9b893404d43894d69a18dd2fc8fcf1c36abb7e
Analyze and fix the following issue in the Linux kernel code: ACPI: processor: idle: Return an error if both P_LVL{2,3} idle states are invalid
Problem Details: Prior to commit 496121c02127 ("ACPI: processor: idle: Allow probing on platforms with one ACPI C-state"), the acpi_idle driver wouldn't load on systems without a valid C-State at least as deep as C2. The behavior was desirable for guests on hypervisors such as VMWare ESXi, which by default don't have ...
```diff diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 586cc7d1d8aa..b181f7fc2090 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -268,6 +268,10 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) ACPI_CX_DESC_LEN, "ACPI P_...
7d783d9074cb1d54179ca03df514fe4b0bbae5ab
Analyze and fix the following issue in the Linux kernel code: ASoC: SOF: hda/ptl: Move mic privacy change notification sending to a work
Problem Details: IPC message cannot be sent from the irq thread directly as the message will not receive the reply (interrupts are disabled) and it will time out - the reply is going to be received right after the we leave the irq thread. This is a different case compared to the delayed IPC messages due to DSP busy sta...
```diff diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c index ccf8eefdca70..f64e8a6a9a33 100644 --- a/sound/soc/sof/intel/hda-dsp.c +++ b/sound/soc/sof/intel/hda-dsp.c @@ -991,6 +991,10 @@ int hda_dsp_runtime_suspend(struct snd_sof_dev *sdev) if (!sdev->dspless_mode_selected) { /* cancel...
a3c3c66670cee11eb13aa43905904bf29cb92d32
Analyze and fix the following issue in the Linux kernel code: perf/core: Fix child_total_time_enabled accounting bug at task exit
Problem Details: The perf events code fails to account for total_time_enabled of inactive events. Here is a failure case for accounting total_time_enabled for CPU PMU events: sudo ./perf stat -vvv -e armv8_pmuv3_0/event=0x08/ -e armv8_pmuv3_1/event=0x08/ -- stress-ng --pthread=2 -t 2s ... armv8_pmuv3_0/event=0...
```diff diff --git a/kernel/events/core.c b/kernel/events/core.c index 0bb21659e252..128db74e9eab 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -2451,6 +2451,7 @@ ctx_time_update_event(struct perf_event_context *ctx, struct perf_event *event) #define DETACH_GROUP 0x01UL #define DETACH_CHILD 0x02UL ...
807c2743035446cf0484772a76e1c35ce27fd8e3
Analyze and fix the following issue in the Linux kernel code: s390/pci: Fix dev.dma_range_map missing sentinel element
Problem Details: The fixed commit sets up dev.dma_range_map but missed that this is supposed to be an array of struct bus_dma_region with a sentinel element with the size field set to 0 at the end. This would lead to overruns in e.g. dma_range_map_min(). It could also result in wrong translations instead of DMA_MAPPING...
```diff diff --git a/arch/s390/pci/pci_bus.c b/arch/s390/pci/pci_bus.c index 4d45edb026f2..81bdb54ad5e3 100644 --- a/arch/s390/pci/pci_bus.c +++ b/arch/s390/pci/pci_bus.c @@ -287,23 +287,21 @@ static struct zpci_bus *zpci_bus_alloc(int topo, bool topo_is_tid) static void pci_dma_range_setup(struct pci_dev *pdev) { ...
991a20173a1fbafd9fc0df0c7e17bb62d44a4deb
Analyze and fix the following issue in the Linux kernel code: s390: Fix linker error when -no-pie option is unavailable
Problem Details: The kernel build may fail if the linker does not support -no-pie option, as it always included in LDFLAGS_vmlinux. Error log: s390-linux-ld: unable to disambiguate: -no-pie (did you mean --no-pie ?) Although the GNU linker defaults to -no-pie, the ability to explicitly specify this option was introdu...
```diff diff --git a/arch/s390/Makefile b/arch/s390/Makefile index 5fae311203c2..fd3b70d9aab1 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile @@ -15,7 +15,7 @@ KBUILD_CFLAGS_MODULE += -fPIC KBUILD_AFLAGS += -m64 KBUILD_CFLAGS += -m64 KBUILD_CFLAGS += -fPIC -LDFLAGS_vmlinux := -no-pie --emit-relocs --discard...
8691abd3afaadd816a298503ec1a759df1305d2e
Analyze and fix the following issue in the Linux kernel code: s390/pci: Fix zpci_bus_is_isolated_vf() for non-VFs
Problem Details: For non-VFs, zpci_bus_is_isolated_vf() should return false because they aren't VFs. While zpci_iov_find_parent_pf() specifically checks if a function is a VF, it then simply returns that there is no parent. The simplistic check for a parent then leads to these functions being confused with isolated VFs...
```diff diff --git a/arch/s390/pci/pci_bus.c b/arch/s390/pci/pci_bus.c index 0e725039861f..4d45edb026f2 100644 --- a/arch/s390/pci/pci_bus.c +++ b/arch/s390/pci/pci_bus.c @@ -360,6 +360,9 @@ static bool zpci_bus_is_isolated_vf(struct zpci_bus *zbus, struct zpci_dev *zdev { struct pci_dev *pdev; + if (!zdev->vfn) +...