id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
f86fb94011aeb3b26337fc22204ca726aeb8bc24
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_tables: revert do not remove elements if set backend implements .abort
Problem Details: nf_tables_abort_release() path calls nft_set_elem_destroy() for NFT_MSG_NEWSETELEM which releases the element, however, a reference to the element still remains in the working copy. Fixes: ebd032fa8818 ("netfilter: nf_tables: do not remove elements if set backend implements .abort") Signed-off-by: Pab...
```diff diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 7b77ff5985f6..29c651804cb2 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -10345,10 +10345,7 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action) break; } t...
d111692a59c1470ae530cbb39bcf0346c950ecc7
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_set_rbtree: .deactivate fails if element has expired
Problem Details: This allows to remove an expired element which is not possible in other existing set backends, this is more noticeable if gc-interval is high so expired elements remain in the tree. On-demand gc also does not help in this case, because this is delete element path. Return NULL if element has expired. F...
```diff diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c index 2660ceab3759..e34662f4a71e 100644 --- a/net/netfilter/nft_set_rbtree.c +++ b/net/netfilter/nft_set_rbtree.c @@ -568,6 +568,8 @@ static void *nft_rbtree_deactivate(const struct net *net, nft_rbtree_interval_end(this)) { ...
2e2d9c7d4d37d74873583d7b0c94eac8b6869486
Analyze and fix the following issue in the Linux kernel code: selftests: netfilter: Run nft_audit.sh in its own netns
Problem Details: Don't mess with the host's firewall ruleset. Since audit logging is not per-netns, add an initial delay of a second so other selftests' netns cleanups have a chance to finish. Fixes: e8dbde59ca3f ("selftests: netfilter: Test nf_tables audit logging") Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off...
```diff diff --git a/tools/testing/selftests/netfilter/nft_audit.sh b/tools/testing/selftests/netfilter/nft_audit.sh index e94a80859bbd..99ed5bd6e840 100755 --- a/tools/testing/selftests/netfilter/nft_audit.sh +++ b/tools/testing/selftests/netfilter/nft_audit.sh @@ -11,6 +11,12 @@ nft --version >/dev/null 2>&1 || { e...
d5921c460e543228d100daf67dac7a03dfaaa40a
Analyze and fix the following issue in the Linux kernel code: ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init()
Problem Details: acpi_agdi_init() in acpi_arm_init() will register a SDEI event, so it needs the SDEI subsystem to be initialized (which is done in acpi_ghes_init()) before the AGDI driver probing. In commit fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific initialisation into acpi_arm_init()"), the acpi_agdi_ini...
```diff diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index f41dda2d3493..a4aa53b7e2bb 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -1410,10 +1410,10 @@ static int __init acpi_init(void) acpi_init_ffh(); pci_mmcfg_late_init(); - acpi_arm_init(); acpi_viot_early_init(); acpi_hest_init(); ...
0c21a18d5d6c6a73d098fb9b4701572370942df9
Analyze and fix the following issue in the Linux kernel code: ACPI: irq: Fix incorrect return value in acpi_register_gsi()
Problem Details: acpi_register_gsi() should return a negative value in case of failure. Currently, it returns the return value from irq_create_fwspec_mapping(). However, irq_create_fwspec_mapping() returns 0 for failure. Fix the issue by returning -EINVAL if irq_create_fwspec_mapping() returns zero. Fixes: d44fa3d460...
```diff diff --git a/drivers/acpi/irq.c b/drivers/acpi/irq.c index c2c786eb95ab..1687483ff319 100644 --- a/drivers/acpi/irq.c +++ b/drivers/acpi/irq.c @@ -57,6 +57,7 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity) { struct irq_fwspec fwspec; + unsigned int irq; fwspec.fw...
f1cdb599ce0ef909343d6c8e7d372defbaa382b9
Analyze and fix the following issue in the Linux kernel code: drm/i915: Prevent potential null-ptr-deref in engine_init_common
Problem Details: If measure_breadcrumb_dw() returns an error and bce isn't created, this commit ensures that intel_engine_destroy_pinned_context() is not called with a NULL bce. v2: Fix the subject s/UAF/null-ptr-deref(Jani) Fixes: b35274993680 ("drm/i915: Create a kernel context for GGTT updates") Cc: Oak Zeng <oak....
```diff diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c index 179d9546865b..4a11219e560e 100644 --- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c +++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c @@ -1491,7 +1491,8 @@ static int engine_init_common(struct intel_engine_cs *e...
2915240eddba96b37de4c7e9a3d0ac6f9548454b
Analyze and fix the following issue in the Linux kernel code: neighbor: tracing: Move pin6 inside CONFIG_IPV6=y section
Problem Details: When CONFIG_IPV6=n, and building with W=1: In file included from include/trace/define_trace.h:102, from include/trace/events/neigh.h:255, from net/core/net-traces.c:51: include/trace/events/neigh.h: In function ‘trace_event_raw_event_neigh_create’: include/trace/events/neigh....
```diff diff --git a/include/trace/events/neigh.h b/include/trace/events/neigh.h index 5eaa1fa99171..833143d0992e 100644 --- a/include/trace/events/neigh.h +++ b/include/trace/events/neigh.h @@ -39,7 +39,6 @@ TRACE_EVENT(neigh_create, ), TP_fast_assign( - struct in6_addr *pin6; __be32 *p32; __entry->fami...
c4eee56e14fe001e1cff54f0b438a5e2d0dd7454
Analyze and fix the following issue in the Linux kernel code: net: skb_find_text: Ignore patterns extending past 'to'
Problem Details: Assume that caller's 'to' offset really represents an upper boundary for the pattern search, so patterns extending past this offset are to be rejected. The old behaviour also was kind of inconsistent when it comes to fragmentation (or otherwise non-linear skbs): If the pattern started in between 'to' ...
```diff diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 0401f40973a5..975c9a6ffb4a 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -4267,6 +4267,7 @@ static void skb_ts_finish(struct ts_config *conf, struct ts_state *state) unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, un...
1db34aa58d80988f5ee99d2fd9d8f7489c3b0681
Analyze and fix the following issue in the Linux kernel code: Revert "net: wwan: iosm: enable runtime pm support for 7560"
Problem Details: Runtime power management support breaks Intel LTE modem where dmesg dump showes timeout errors: ``` [ 72.027442] iosm 0000:01:00.0: msg timeout [ 72.531638] iosm 0000:01:00.0: msg timeout [ 73.035414] iosm 0000:01:00.0: msg timeout [ 73.540359] iosm 0000:01:00.0: msg timeout ``` Furthermore, ...
```diff diff --git a/drivers/net/wwan/iosm/iosm_ipc_imem.c b/drivers/net/wwan/iosm/iosm_ipc_imem.c index 635301d677e1..829515a601b3 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_imem.c +++ b/drivers/net/wwan/iosm/iosm_ipc_imem.c @@ -4,7 +4,6 @@ */ #include <linux/delay.h> -#include <linux/pm_runtime.h> #include "...
f9bc9bbe8afdf83412728f0b464979a72a3b9ec2
Analyze and fix the following issue in the Linux kernel code: powerpc/qspinlock: Fix stale propagated yield_cpu
Problem Details: yield_cpu is a sample of a preempted lock holder that gets propagated back through the queue. Queued waiters use this to yield to the preempted lock holder without continually sampling the lock word (which would defeat the purpose of MCS queueing by bouncing the cache line). The problem is that yield_...
```diff diff --git a/arch/powerpc/lib/qspinlock.c b/arch/powerpc/lib/qspinlock.c index 253620979d0c..6dd2f46bd3ef 100644 --- a/arch/powerpc/lib/qspinlock.c +++ b/arch/powerpc/lib/qspinlock.c @@ -406,6 +406,9 @@ static __always_inline bool yield_to_prev(struct qspinlock *lock, struct qnode * if ((yield_count & 1) == 0...
851354cbd12bb9500909733c3d4054306f61df87
Analyze and fix the following issue in the Linux kernel code: clocksource/drivers/arm_arch_timer: limit XGene-1 workaround
Problem Details: The AppliedMicro XGene-1 CPU has an erratum where the timer condition would only consider TVAL, not CVAL. We currently apply a workaround when seeing the PartNum field of MIDR_EL1 being 0x000, under the assumption that this would match only the XGene-1 CPU model. However even the Ampere eMAG (aka XGene...
```diff diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h index 5f6f84837a49..818ea1c83b50 100644 --- a/arch/arm64/include/asm/cputype.h +++ b/arch/arm64/include/asm/cputype.h @@ -85,7 +85,8 @@ #define ARM_CPU_PART_NEOVERSE_N2 0xD49 #define ARM_CPU_PART_CORTEX_A78C 0xD4B -#define APM_...
a5b92be2482e5f9ef30be4e4cda12ed484381493
Analyze and fix the following issue in the Linux kernel code: platform/x86: asus-wmi: Only map brightness codes when using asus-wmi backlight control
Problem Details: Older Asus laptops change the backlight level themselves and then send WMI events with different codes for different backlight levels. The asus-wmi.c code maps the entire range of codes reported on brightness down keypresses to an internal ASUS_WMI_BRN_DOWN code: define NOTIFY_BRNUP_MIN ...
```diff diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 9f8cea5f9615..19bfd30861aa 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -3826,7 +3826,6 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus) { unsigned int key_v...
48016737a9af47328dd321df4dd3479ed5e2041d
Analyze and fix the following issue in the Linux kernel code: media: platform: cadence: select MIPI_DPHY dependency
Problem Details: The driver uses MIPI DPHY helper routines from the PHY core. Make sure we select the relevant config for compilation. Fixes: a91d06f46bf7 ("media: cadence: csi2rx: Configure DPHY using link freq") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202310170258...
```diff diff --git a/drivers/media/platform/cadence/Kconfig b/drivers/media/platform/cadence/Kconfig index 480325d053de..1aa608c00dbc 100644 --- a/drivers/media/platform/cadence/Kconfig +++ b/drivers/media/platform/cadence/Kconfig @@ -8,6 +8,8 @@ config VIDEO_CADENCE_CSI2RX select MEDIA_CONTROLLER select VIDEO_V4L2...
99b6d9685c33ee38f9fea00e3ea9191da93133c9
Analyze and fix the following issue in the Linux kernel code: media: MAINTAINERS: Fix path for J721E CSI2RX bindings
Problem Details: Fix the path of the devicetree bindings. The path was changed during review but MAINTAINERS file was not updated. Fixes: b4a3d877dc92 ("media: ti: Add CSI2RX support for J721E") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202310130411.c66pTXjG-lkp@intel...
```diff diff --git a/MAINTAINERS b/MAINTAINERS index 3b47e0b56859..f3e6dbbbbccb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21599,7 +21599,7 @@ TI J721E CSI2RX DRIVER M: Jai Luthra <j-luthra@ti.com> L: linux-media@vger.kernel.org S: Maintained -F: Documentation/devicetree/bindings/media/ti,j721e-csi2rx.yaml +F: D...
265f3ed077036f053981f5eea0b5b43e7c5b39ff
Analyze and fix the following issue in the Linux kernel code: workqueue: Provide one lock class key per work_on_cpu() callsite
Problem Details: All callers of work_on_cpu() share the same lock class key for all the functions queued. As a result the workqueue related locking scenario for a function A may be spuriously accounted as an inversion against the locking scenario of function B such as in the following model: long A(void *arg) { mu...
```diff diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 1c1d06804d45..24b1e5070f4d 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -274,18 +274,16 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } * to generate better code. */ #ifde...
1e2dd572d2b773b5b8882aae66e5f0328d562aa9
Analyze and fix the following issue in the Linux kernel code: x86/boot: Use __pa_nodebug() in mk_early_pgtbl_32()
Problem Details: Use the existing macro instead of undefining and redefining __pa(). No functional change. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20231017211722.051625827@linutronix.de
```diff diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c index bf678d6f4359..8fe0dd38fff0 100644 --- a/arch/x86/kernel/head32.c +++ b/arch/x86/kernel/head32.c @@ -73,25 +73,21 @@ void __init mk_early_pgtbl_32(void); void __init __no_stack_protector mk_early_pgtbl_32(void) { -#ifdef __pa -#undef __pa...
1d30162f35c7a73fc2f8cdcdcdbd690bedb99d1a
Analyze and fix the following issue in the Linux kernel code: net: pktgen: Fix interface flags printing
Problem Details: Device flags are displayed incorrectly: 1) The comparison (i == F_FLOW_SEQ) is always false, because F_FLOW_SEQ is equal to (1 << FLOW_SEQ_SHIFT) == 2048, and the maximum value of the 'i' variable is (NR_PKT_FLAG - 1) == 17. It should be compared with FLOW_SEQ_SHIFT. 2) Similarly to the F_IPSEC flag. ...
```diff diff --git a/net/core/pktgen.c b/net/core/pktgen.c index f56b8d697014..4d1696677c48 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -669,19 +669,19 @@ static int pktgen_if_show(struct seq_file *seq, void *v) seq_puts(seq, " Flags: "); for (i = 0; i < NR_PKT_FLAGS; i++) { - if (i == F_FLOW_S...
fc363413ef8ea842ae7a99e3caf5465dafdd3a49
Analyze and fix the following issue in the Linux kernel code: gpio: vf610: set value before the direction to avoid a glitch
Problem Details: We found a glitch when configuring the pad as output high. To avoid this glitch, move the data value setting before direction config in the function vf610_gpio_direction_output(). Fixes: 659d8a62311f ("gpio: vf610: add imx7ulp support") Signed-off-by: Haibo Chen <haibo.chen@nxp.com> [Bartosz: tweak th...
```diff diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c index d1f05810340f..656d6b1dddb5 100644 --- a/drivers/gpio/gpio-vf610.c +++ b/drivers/gpio/gpio-vf610.c @@ -126,14 +126,14 @@ static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, unsigned long mask = BIT(gpio); u32 v...
430232619791e7de95191f2cd8ebaa4c380d17d0
Analyze and fix the following issue in the Linux kernel code: gpio: vf610: mask the gpio irq in system suspend and support wakeup
Problem Details: Add flag IRQCHIP_MASK_ON_SUSPEND to make sure gpio irq is masked on suspend, if lack this flag, current irq arctitecture will not mask the irq, and these unmasked gpio irq will wrongly wakeup the system even they are not config as wakeup source. Also add flag IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND to make s...
```diff diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c index dbc7ba0ee72c..d1f05810340f 100644 --- a/drivers/gpio/gpio-vf610.c +++ b/drivers/gpio/gpio-vf610.c @@ -246,7 +246,8 @@ static const struct irq_chip vf610_irqchip = { .irq_unmask = vf610_gpio_irq_unmask, .irq_set_type = vf610_gpio_irq_se...
1b7ef2d94ff4cb0b1186a224a97349864820c606
Analyze and fix the following issue in the Linux kernel code: sched/fair: Remove duplicate #include
Problem Details: ./kernel/sched/fair.c: linux/sched/cond_resched.h is included more than once. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20231018062759.44375-1-jiapeng.c...
```diff diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 38d757c35004..9ae2208089e4 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -51,8 +51,6 @@ #include <asm/switch_to.h> -#include <linux/sched/cond_resched.h> - #include "sched.h" #include "stats.h" #include "autogroup.h" ```
6291b3a67ad55102f163f6a636bc540e460f892d
Analyze and fix the following issue in the Linux kernel code: netfilter: conntrack: convert nf_conntrack_update to netfilter verdicts
Problem Details: This function calls helpers that can return nf-verdicts, but then those get converted to -1/0 as thats what the caller expects. Theoretically NF_DROP could have an errno number set in the upper 24 bits of the return value. Or any of those helpers could return NF_STOLEN, which would result in use-after...
```diff diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 124136b5a79a..2e5f3864d353 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -2169,11 +2169,11 @@ static int __nf_conntrack_update(struct net *net, struct sk_buff *skb, dataoff = ...
b5f4e371336a62a48f6ae51abb8366e968a8f88f
Analyze and fix the following issue in the Linux kernel code: devlink: don't take instance lock for nested handle put
Problem Details: Lockdep reports following issue: WARNING: possible circular locking dependency detected ------------------------------------------------------ devlink/8191 is trying to acquire lock: ffff88813f32c250 (&devlink->lock_key#14){+.+.}-{3:3}, at: devlink_rel_devlink_handle_put+0x11e/0x2d0 ...
```diff diff --git a/net/devlink/core.c b/net/devlink/core.c index c47c9e6c744f..655903ddbdfd 100644 --- a/net/devlink/core.c +++ b/net/devlink/core.c @@ -183,9 +183,8 @@ static struct devlink_rel *devlink_rel_find(unsigned long rel_index) DEVLINK_REL_IN_USE); } -static struct devlink *devlink_rel_devlink_...
a380687200e0f7f0e00d745796fd8b8ea4bcb746
Analyze and fix the following issue in the Linux kernel code: devlink: take device reference for devlink object
Problem Details: In preparation to allow to access device pointer without devlink instance lock held, make sure the device pointer is usable until devlink_release() is called. Fixes: c137743bce02 ("devlink: introduce object and nested devlink relationship infra") Signed-off-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by...
```diff diff --git a/net/devlink/core.c b/net/devlink/core.c index bcbbb952569f..c47c9e6c744f 100644 --- a/net/devlink/core.c +++ b/net/devlink/core.c @@ -310,6 +310,7 @@ static void devlink_release(struct work_struct *work) mutex_destroy(&devlink->lock); lockdep_unregister_key(&devlink->lock_key); + put_device(d...
c503bc7df602257e9d03851654a347649a33f3c3
Analyze and fix the following issue in the Linux kernel code: devlink: call peernet2id_alloc() with net pointer under RCU read lock
Problem Details: peernet2id_alloc() allows to be called lockless with peer net pointer obtained in RCU critical section and makes sure to return ns ID if net namespaces is not being removed concurrently. Benefit from read_pnet_rcu() helper addition, use it to obtain net pointer under RCU read lock and pass it to peerne...
```diff diff --git a/net/devlink/netlink.c b/net/devlink/netlink.c index 499304d9de49..809bfc3ba8c4 100644 --- a/net/devlink/netlink.c +++ b/net/devlink/netlink.c @@ -86,18 +86,24 @@ int devlink_nl_put_nested_handle(struct sk_buff *msg, struct net *net, struct devlink *devlink, int attrtype) { struct nlattr *n...
d2929762cc3f85528b0ca12f6f63c2a714f24778
Analyze and fix the following issue in the Linux kernel code: sched/eevdf: Fix heap corruption more
Problem Details: Because someone is a flaming idiot... and forgot we have current as se->on_rq but not actually in the tree itself, and walking rb_parent() on an entry not in the tree is 'funky' and KASAN complains. Fixes: 8dafa9d0eb1a ("sched/eevdf: Fix min_deadline heap integrity") Reported-by: 0599jiangyc@gmail.com...
```diff diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 061a30a8925a..df348aa55d3c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3657,7 +3657,8 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, */ deadline = div_s64(deadline * old_weight, weight); se-...
bd78c9d714208fb5d989bd8ad007ff0e2bcfb2a9
Analyze and fix the following issue in the Linux kernel code: modpost: define TO_NATIVE() using bswap_* functions
Problem Details: The current TO_NATIVE() has some limitations: 1) You cannot cast the argument. 2) You cannot pass a variable marked as 'const'. 3) Passing an array is a bug, but it is not detected. Impelement TO_NATIVE() using bswap_*() functions. These are GNU extensions. If we face portability issues, we can ...
```diff diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 2f3b0fe6f68d..99476a9695c5 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1410,15 +1410,10 @@ static void get_rel_type_and_sym(struct elf_info *elf, uint64_t r_info, return; } - if (is_64bit) { - Elf64_Xword r_info64 = ...
ac96a15a0f0c8812a3aaa587b871cd5527f6d736
Analyze and fix the following issue in the Linux kernel code: modpost: fix ishtp MODULE_DEVICE_TABLE built on big-endian host
Problem Details: When MODULE_DEVICE_TABLE(ishtp, ) is built on a host with a different endianness from the target architecture, it results in an incorrect MODULE_ALIAS(). For example, see a case where drivers/platform/x86/intel/ishtp_eclite.c is built as a module for x86. If you build it on a little-endian host, you ...
```diff diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 70bf6a2f585c..6583b36dbe69 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -1401,10 +1401,10 @@ static int do_mhi_ep_entry(const char *filename, void *symval, char *alias) /* Looks like: ishtp:{guid} */ static int d...
7f54e00e5842663c2cea501bbbdfa572c94348a3
Analyze and fix the following issue in the Linux kernel code: modpost: fix tee MODULE_DEVICE_TABLE built on big-endian host
Problem Details: When MODULE_DEVICE_TABLE(tee, ) is built on a host with a different endianness from the target architecture, it results in an incorrect MODULE_ALIAS(). For example, see a case where drivers/char/hw_random/optee-rng.c is built as a module for ARM little-endian. If you build it on a little-endian host,...
```diff diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 7056751c29b1..70bf6a2f585c 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -1348,13 +1348,13 @@ static int do_typec_entry(const char *filename, void *symval, char *alias) /* Looks like: tee:uuid */ static int do_tee...
34a674e99acd6ec4b541cd4c630e126ba1a4c22f
Analyze and fix the following issue in the Linux kernel code: mei: me: emit error only if reset was unexpected
Problem Details: GSC devices perform legal firmware initiated resets due to state transition that may appear as unexpected to the driver. Lower the log level for those devices to debug level and save the firmware status registers. When the device comes out of the reset it is possible to check whether the resets was due...
```diff diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h index bdc65d50b945..961e5d53a27a 100644 --- a/drivers/misc/mei/hw-me-regs.h +++ b/drivers/misc/mei/hw-me-regs.h @@ -123,6 +123,9 @@ # define PCI_CFG_HFS_1_OPMODE_MSK 0xf0000 /* OP MODE Mask: SPS <= 4.0 */ # define PCI_CFG_HFS_1_OPMOD...
3b54a111bb7e558e4a40e483ded7c123fe94382c
Analyze and fix the following issue in the Linux kernel code: misc: mei: main.c: fix kernel-doc warnings
Problem Details: Fix kernel-doc warnings in main.c: main.c:465: warning: contents before sections main.c:590: warning: missing initial short description on line: * mei_ioctl_client_notify_request - Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Tomas Winkler <tomas.winkler@intel.com> Cc: Arnd Bergmann <arnd...
```diff diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index bb4e9eabda97..79e6f3c1341f 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c @@ -460,11 +460,11 @@ end: /** * mei_vt_support_check - check if client support vtags * - * Locking: called under "dev->device_lock" lock - * ...
980dcc7e43bddedb755a41a375817ee5de80222f
Analyze and fix the following issue in the Linux kernel code: misc: mei: interrupt.c: fix kernel-doc warnings
Problem Details: Fix kernel-doc warnings in interrupt.c: interrupt.c:631: warning: contents before sections Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Tomas Winkler <tomas.winkler@intel.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.or...
```diff diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index 5a050f50f33e..b09b79fedaba 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c @@ -626,9 +626,9 @@ static void mei_connect_timeout(struct mei_cl *cl) /** * mei_schedule_stall_timer - re-arm stall_timer wor...
de735e7fda11a27eb2eed81daf2a17548efb63f7
Analyze and fix the following issue in the Linux kernel code: misc: mei: hw-me.c: fix kernel-doc warnings
Problem Details: Fix kernel-doc warnings in hw-me.c: hw-me.c:1391: warning: contents before sections hw-me.c:1475: warning: contents before sections hw-me.c:1501: warning: contents before sections hw-me.c:1525: warning: contents before sections Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Tomas Winkler <to...
```diff diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index da4ef0b51954..e72c0d78932e 100644 --- a/drivers/misc/mei/hw-me.c +++ b/drivers/misc/mei/hw-me.c @@ -1379,6 +1379,8 @@ EXPORT_SYMBOL_GPL(mei_me_irq_thread_handler); /** * mei_me_polling_thread - interrupt register polling thread * + * @_...
fbe3599ee65de93cac243862df777775e23dbd83
Analyze and fix the following issue in the Linux kernel code: misc: mei: hbm.c: fix kernel-doc warnings
Problem Details: Fix kernel-doc warnings in hbm.c: hbm.c:98: warning: No description found for return value of 'mei_hbm_write_message' Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Tomas Winkler <tomas.winkler@intel.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> L...
```diff diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c index 15737655c896..026b1f686c16 100644 --- a/drivers/misc/mei/hbm.c +++ b/drivers/misc/mei/hbm.c @@ -91,6 +91,8 @@ static int mei_cl_conn_status_to_errno(enum mei_cl_connect_status status) * @dev: mei device * @hdr: mei header * @data: payload ...
4efa1e2a05d6b4340c4ca39ad0664f0e160e5d8d
Analyze and fix the following issue in the Linux kernel code: misc: mei: dma-ring.c: fix kernel-doc warnings
Problem Details: Fix kernel-doc warnings in dma-ring.c: dma-ring.c:130: warning: No description found for return value of 'mei_dma_copy_from' dma-ring.c:150: warning: No description found for return value of 'mei_dma_copy_to' Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Tomas Winkler <tomas.winkler@intel.c...
```diff diff --git a/drivers/misc/mei/dma-ring.c b/drivers/misc/mei/dma-ring.c index e5d800e68cb1..651e77ef82bd 100644 --- a/drivers/misc/mei/dma-ring.c +++ b/drivers/misc/mei/dma-ring.c @@ -124,6 +124,8 @@ void mei_dma_ring_reset(struct mei_device *dev) * @buf: data buffer * @offset: offset in slots. * @n: numbe...
daa0c28d3bdeeca0be3d617feac379c4a979a5f7
Analyze and fix the following issue in the Linux kernel code: misc: mei: client.c: fix kernel-doc warnings
Problem Details: Fix kernel-doc warnings in client.c: client.c:53: warning: contents before sections client.c:68: warning: contents before sections client.c:334: warning: contents before sections client.c:349: warning: contents before sections client.c:364: warning: contents before sections Signed-off-by: Randy Dunla...
```diff diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c index 5c19097266fe..9c8fc87938a7 100644 --- a/drivers/misc/mei/client.c +++ b/drivers/misc/mei/client.c @@ -48,9 +48,9 @@ struct mei_me_client *mei_me_cl_get(struct mei_me_client *me_cl) /** * mei_me_cl_release - free me client * - * Lockin...
5d33dc7df2ba14e963c094f0d0ab7a20ad4a5310
Analyze and fix the following issue in the Linux kernel code: misc: mei: hw.h: fix kernel-doc warnings
Problem Details: Fix kernel-doc warnings in hw.h: hw.h:809: warning: missing initial short description on line: * struct hbm_client_dma_unmap_request hw.h:812: warning: contents before sections hw.h:825: warning: missing initial short description on line: * struct hbm_client_dma_response hw.h:828: warning: contents ...
```diff diff --git a/drivers/misc/mei/hw.h b/drivers/misc/mei/hw.h index 3ad3080519c4..eb800a07a84b 100644 --- a/drivers/misc/mei/hw.h +++ b/drivers/misc/mei/hw.h @@ -806,8 +806,8 @@ struct hbm_client_dma_map_request { } __packed; /** - * struct hbm_client_dma_unmap_request - * client dma unmap request from the ...
ae4cb6bd5039a659d71632dbc2e176bf9227e294
Analyze and fix the following issue in the Linux kernel code: mei: docs: fix spelling errors
Problem Details: Fix spelling errors in the mei code base. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Reviewed-by: Randy Dunlap <rdunlap@infradead.org> Link: https://lore.kernel.org/r/20231011074301.223879-4-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
```diff diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 7f4ee9a47404..f9bcff197615 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -1385,7 +1385,7 @@ static inline void mei_cl_bus_set_name(struct mei_cl_device *cldev) * @bus: mei device * @me_cl: me client * - * Return: allo...
64459c626b5a08aa8e8fdaa128a218215df93675
Analyze and fix the following issue in the Linux kernel code: mei: docs: use correct structures name in kdoc
Problem Details: Fix misalignment between structures names and their kdoc in hw.h Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Reviewed-by: Randy Dunlap <rdunlap@infradead.org> Link: https://lore.kernel.org/r/20231011074301.223879-2-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfound...
```diff diff --git a/drivers/misc/mei/hw.h b/drivers/misc/mei/hw.h index e910302fcd1f..3ad3080519c4 100644 --- a/drivers/misc/mei/hw.h +++ b/drivers/misc/mei/hw.h @@ -429,7 +429,7 @@ struct mei_bus_message { } __packed; /** - * struct hbm_cl_cmd - client specific host bus command + * struct mei_hbm_cl_cmd - client ...
f2b543a191b613efef00f360036f7a9009bc0e25
Analyze and fix the following issue in the Linux kernel code: arm64: dts: mediatek: add device-tree for Genio 1200 EVK board
Problem Details: Add basic device-tree for the Genio 1200-EVK board. This board is made by MediaTek and has a MT8395 SoC (MT8195 family), associated with the MT6359 and MT6360 PMICs, and the MT7921 connectivity chip. The IOs available on that board are: * 1 USB Type-C connector with DP aux mode support * 2 USB Type-A ...
```diff diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile index c99c3372a4b5..10e640c6ae08 100644 --- a/arch/arm64/boot/dts/mediatek/Makefile +++ b/arch/arm64/boot/dts/mediatek/Makefile @@ -53,4 +53,5 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8195-cherry-tomato-r3.dtb dtb-$(CONFIG_AR...
25e20eedc1d63dcdf6f781588e8dbc37cd0aad16
Analyze and fix the following issue in the Linux kernel code: ARM: dts: samsung: exynos4412-midas: fix key-ok event code
Problem Details: Input event code 139 stands for KEY_MENU, instead of KEY_OK as node name key-ok inplies. Fix it with correct event code 0x160. Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com> Link: https://lore.kernel.org/r/20231017101636.62755-1-raymondhackley@protonmail.com [krzysztof: use KEY_OK cons...
```diff diff --git a/arch/arm/boot/dts/samsung/exynos4412-midas.dtsi b/arch/arm/boot/dts/samsung/exynos4412-midas.dtsi index 7daf25865551..2a67fcc07041 100644 --- a/arch/arm/boot/dts/samsung/exynos4412-midas.dtsi +++ b/arch/arm/boot/dts/samsung/exynos4412-midas.dtsi @@ -159,7 +159,7 @@ key-ok { gpios = <&gpx0 ...
b11950356c4b416d2e87941f3aa7a8bf089db72b
Analyze and fix the following issue in the Linux kernel code: KEYS: asymmetric: Fix sign/verify on pkcs1pad without a hash
Problem Details: The new sign/verify code broke the case of pkcs1pad without a hash algorithm. Fix it by setting issig correctly for this case. Fixes: 63ba4d67594a ("KEYS: asymmetric: Use new crypto interface without scatterlists") Cc: stable@vger.kernel.org # v6.5 Reported-by: Denis Kenzior <denkenz@gmail.com> Signe...
```diff diff --git a/crypto/asymmetric_keys/public_key.c b/crypto/asymmetric_keys/public_key.c index abeecb8329b3..1dcab27986a6 100644 --- a/crypto/asymmetric_keys/public_key.c +++ b/crypto/asymmetric_keys/public_key.c @@ -81,14 +81,13 @@ software_key_determine_akcipher(const struct public_key *pkey, * RSA signatur...
e339c6d628fe66c9b64bf31040a55770952aec57
Analyze and fix the following issue in the Linux kernel code: drm/i915: Retry gtt fault when out of fence registers
Problem Details: If we can't find a free fence register to handle a fault in the GMADR range just return VM_FAULT_NOPAGE without populating the PTE so that userspace will retry the access and trigger another fault. Eventually we should find a free fence and the fault will get properly handled. A further improvement id...
```diff diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c index aa4d842d4c5a..310654542b42 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c @@ -235,6 +235,7 @@ static vm_fault_t i915_error_to_vmf_fault(int err) case 0: ...
5e4c16fe08c8b894b258f4110349dc9b642669f9
Analyze and fix the following issue in the Linux kernel code: drm/i915/cx0: Only clear/set the Pipe Reset bit of the PHY Lanes Owned
Problem Details: Currently, with MFD/pin assignment D, the driver clears the pipe reset bit of lane 1 which is not owned by display. This causes the display to block S0iX. By not clearing this bit for lane 1 and keeping whatever default, S0ix started to work. This is already what the driver does at the end of the phy ...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c b/drivers/gpu/drm/i915/display/intel_cx0_phy.c index 1b00ef2c6185..80e4ec6ee403 100644 --- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c +++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c @@ -2553,8 +2553,7 @@ static void intel_cx0_phy_lane_reset(struct...
9fea94d3a8cadd83f5de22eae953bd9e951d5215
Analyze and fix the following issue in the Linux kernel code: tools: ynl: fix converting flags to names after recent cleanup
Problem Details: I recently cleaned up specs to not specify enum-as-flags when target enum is already defined as flags. YNL Python library did not convert flags, unfortunately, so this caused breakage for Stan and Willem. Note that the nlspec.py abstraction already hides the differences between flags and enums (value ...
```diff diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py index 13c4b019a881..28ac35008e65 100644 --- a/tools/net/ynl/lib/ynl.py +++ b/tools/net/ynl/lib/ynl.py @@ -474,7 +474,7 @@ class YnlFamily(SpecFamily): def _decode_enum(self, raw, attr_spec): enum = self.consts[attr_spec['enum']] - ...
c53647a5df9e66dd9fedf240198e1fe50d88c286
Analyze and fix the following issue in the Linux kernel code: net: usb: smsc95xx: Fix an error code in smsc95xx_reset()
Problem Details: Return a negative error code instead of success. Fixes: 2f7ca802bdae ("net: Add SMSC LAN9500 USB2.0 10/100 ethernet adapter driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/147927f0-9ada-45cc-81ff-75a19dd30b76@mo...
```diff diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 563ecd27b93e..17da42fe605c 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -897,7 +897,7 @@ static int smsc95xx_reset(struct usbnet *dev) if (timeout >= 100) { netdev_warn(dev->net, "timeout waiting for...
73b24e7ce8f1f47e2b73c9b6724188898f4ca6fd
Analyze and fix the following issue in the Linux kernel code: eth: bnxt: fix backward compatibility with older devices
Problem Details: Recent FW interface update bumped the size of struct hwrm_func_cfg_input above 128B which is the max some devices support. Probe on Stratus (BCM957452) with FW 20.8.3.11 fails with: bnxt_en ...: Unable to reserve tx rings bnxt_en ...: 2nd rings reservation failed. bnxt_en ...: Not enough rin...
```diff diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index b0ca3b319e4f..16eb7a7af970 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -5861,7 +5861,7 @@ static int bnxt_hwrm_set_async_event_cr(struct bnxt *bp...
cbfbfe3aee718dc4c3c837f5d2463170ee59d78c
Analyze and fix the following issue in the Linux kernel code: tun: prevent negative ifindex
Problem Details: After commit 956db0a13b47 ("net: warn about attempts to register negative ifindex") syzbot is able to trigger the following splat. Negative ifindex are not supported. WARNING: CPU: 1 PID: 6003 at net/core/dev.c:9596 dev_index_reserve+0x104/0x210 Modules linked in: CPU: 1 PID: 6003 Comm: syz-executor9...
```diff diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 89ab9efe522c..afa5497f7c35 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -3073,10 +3073,11 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd, struct net *net = sock_net(&tfile->sk); struct tun_struct *tun; void __user* a...
fa8391ad68c16716e2c06ada397e99ceed2fb647
Analyze and fix the following issue in the Linux kernel code: gpu/drm: Eliminate DRM_SCHED_PRIORITY_UNSET
Problem Details: Eliminate DRM_SCHED_PRIORITY_UNSET, value of -2, whose only user was amdgpu. Furthermore, eliminate an index bug, in that when amdgpu boots, it calls drm_sched_entity_init() with DRM_SCHED_PRIORITY_UNSET, which uses it to index sched->sched_rq[]. Cc: Alex Deucher <Alexander.Deucher@amd.com> Cc: Christ...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index 092962b93064..aac52d9754e6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c @@ -64,7 +64,8 @@ amdgpu_ctx_to_drm_sched_prio(int32_t ctx_prio) { switch (ctx_pri...
1c2709cfff1dedbb9591e989e2f001484208d914
Analyze and fix the following issue in the Linux kernel code: tcp: fix excessive TLP and RACK timeouts from HZ rounding
Problem Details: We discovered from packet traces of slow loss recovery on kernels with the default HZ=250 setting (and min_rtt < 1ms) that after reordering, when receiving a SACKed sequence range, the RACK reordering timer was firing after about 16ms rather than the desired value of roughly min_rtt/4 + 2ms. The proble...
```diff diff --git a/include/net/tcp.h b/include/net/tcp.h index 7b1a720691ae..4b03ca7cb8a5 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -141,6 +141,9 @@ void tcp_time_wait(struct sock *sk, int state, int timeo); #define TCP_RTO_MAX ((unsigned)(120*HZ)) #define TCP_RTO_MIN ((unsigned)(HZ/5)) #define TCP...
d6800af51c76b6dae20e6023bbdc9b3da3ab5121
Analyze and fix the following issue in the Linux kernel code: KVM: x86: hyper-v: Don't auto-enable stimer on write from user-space
Problem Details: Don't apply the stimer's counter side effects when modifying its value from user-space, as this may trigger spurious interrupts. For example: - The stimer is configured in auto-enable mode. - The stimer's count is set and the timer enabled. - The stimer expires, an interrupt is injected. - The VM ...
```diff diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index 7c2dac6824e2..238afd7335e4 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -727,10 +727,12 @@ static int stimer_set_count(struct kvm_vcpu_hv_stimer *stimer, u64 count, stimer_cleanup(stimer); stimer->count = count; - if (st...
5a989bbead4cc9cd67c3911226ad857d293643d8
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Update the variable naming in kvm_x86_ops.sched_in()
Problem Details: Update the variable with name 'kvm' in kvm_x86_ops.sched_in() to 'vcpu' to avoid confusions. Variable naming in KVM has a clear convention that 'kvm' refers to pointer of type 'struct kvm *', while 'vcpu' refers to pointer of type 'struct kvm_vcpu *'. Fix this 9-year old naming issue for fun. Signed-...
```diff diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index da497cc56e84..63e08b17a7b7 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1701,7 +1701,7 @@ struct kvm_x86_ops { void (*request_immediate_exit)(struct kvm_vcpu *vcpu); - void (*sche...
f6a2dae2a1f52ea23f649c02615d073beba4cc35
Analyze and fix the following issue in the Linux kernel code: xfs: make sure maxlen is still congruent with prod when rounding down
Problem Details: In commit 2a6ca4baed62, we tried to fix an overflow problem in the realtime allocator that was caused by an overly large maxlen value causing xfs_rtcheck_range to run off the end of the realtime bitmap. Unfortunately, there is a subtle bug here -- maxlen (and minlen) both have to be aligned with @prod,...
```diff diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 31fd65b3aaa9..0e4e2df08aed 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -211,6 +211,23 @@ xfs_rtallocate_range( return error; } +/* + * Make sure we don't run off the end of the rt volume. Be careful that + * adjusting maxle...
ddd98076d5c075c8a6c49d9e6e8ee12844137f23
Analyze and fix the following issue in the Linux kernel code: xfs: fix units conversion error in xfs_bmap_del_extent_delay
Problem Details: The unit conversions in this function do not make sense. First we convert a block count to bytes, then divide that bytes value by rextsize, which is in blocks, to get an rt extent count. You can't divide bytes by blocks to get a (possibly multiblock) extent value. Fortunately nobody uses delalloc on...
```diff diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 26bfa34b4bbf..617cc7e78e38 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -4827,7 +4827,7 @@ xfs_bmap_del_extent_delay( ASSERT(got_endoff >= del_endoff); if (isrt) { - uint64_t rtexts = XFS_FSB_TO_B(mp, del->b...
c2988eb5cff75c02bc57e02c323154aa08f55b78
Analyze and fix the following issue in the Linux kernel code: xfs: rt stubs should return negative errnos when rt disabled
Problem Details: When realtime support is not compiled into the kernel, these functions should return negative errnos, not positive errnos. While we're at it, fix a broken macro declaration. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
```diff diff --git a/fs/xfs/xfs_rtalloc.h b/fs/xfs/xfs_rtalloc.h index 3b2f1b499a11..65c284e9d33e 100644 --- a/fs/xfs/xfs_rtalloc.h +++ b/fs/xfs/xfs_rtalloc.h @@ -141,17 +141,17 @@ int xfs_rtalloc_extent_is_free(struct xfs_mount *mp, struct xfs_trans *tp, bool *is_free); int xfs_rtalloc_reinit_frextents(str...
20045f0155ab79f8beb840022ea86bff46167f79
Analyze and fix the following issue in the Linux kernel code: powerpc/64s/radix: Don't warn on copros in radix__tlb_flush()
Problem Details: Sachin reported a warning when running the inject-ra-err selftest: # selftests: powerpc/mce: inject-ra-err Disabling lock debugging due to kernel taint MCE: CPU19: machine check (Severe) Real address Load/Store (foreign/control memory) [Not recovered] MCE: CPU19: PID: 5254 Comm: inject-ra-err...
```diff diff --git a/arch/powerpc/mm/book3s64/radix_tlb.c b/arch/powerpc/mm/book3s64/radix_tlb.c index 39acc2cbab4c..9e1f6558d026 100644 --- a/arch/powerpc/mm/book3s64/radix_tlb.c +++ b/arch/powerpc/mm/book3s64/radix_tlb.c @@ -1212,14 +1212,7 @@ void radix__tlb_flush(struct mmu_gather *tlb) smp_mb(); /* see radix...
a590ed62269a049a72484ce617fe2f34e2da66cf
Analyze and fix the following issue in the Linux kernel code: tools/power/x86/intel-speed-select: v1.18 release
Problem Details: This version addresses issues with: - When CPU 0 hotplug is not possible, try cgroup v2 isolation without any user input - Fix turbo mode enable/disable swapped - Sanitize command line integer and hex arguments - Add more error messages - Increase CPU count in one request Signed-off-by: Srinivas Pandr...
```diff diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c index b51c21ae2c83..d865dc1f89ee 100644 --- a/tools/power/x86/intel-speed-select/isst-config.c +++ b/tools/power/x86/intel-speed-select/isst-config.c @@ -16,7 +16,7 @@ struct process_cmd_struct { i...
2e9064faccd1a5b9de8c6f4b23d9f4948901cbe9
Analyze and fix the following issue in the Linux kernel code: x86/microcode/amd: Fix snprintf() format string warning in W=1 build
Problem Details: Building with GCC 11.x results in the following warning: arch/x86/kernel/cpu/microcode/amd.c: In function ‘find_blobs_in_containers’: arch/x86/kernel/cpu/microcode/amd.c:504:58: error: ‘h.bin’ directive output may be truncated writing 5 bytes into a region of size between 1 and 7 [-Werror=format-t...
```diff diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index bbd1dc38ea03..b4eea8a1f68a 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -501,7 +501,7 @@ static bool get_builtin_microcode(struct cpio_data *cp, unsigned int family) ...
cf5a103c98a6fb9ee3164334cb5502df6360749b
Analyze and fix the following issue in the Linux kernel code: selftests/user_events: Fix abi_test for BE archs
Problem Details: The abi_test currently uses a long sized test value for enablement checks. On LE this works fine, however, on BE this results in inaccurate assert checks due to a bit being used and assuming it's value is the same on both LE and BE. Use int type for 32-bit values and long type for 64-bit values to ens...
```diff diff --git a/tools/testing/selftests/user_events/abi_test.c b/tools/testing/selftests/user_events/abi_test.c index 8202f1327c39..f5575ef2007c 100644 --- a/tools/testing/selftests/user_events/abi_test.c +++ b/tools/testing/selftests/user_events/abi_test.c @@ -47,7 +47,7 @@ static int change_event(bool enable) ...
3d30bfcbdc268b41a7d9253a9cb3082281223b19
Analyze and fix the following issue in the Linux kernel code: KVM: x86/mmu: Stop kicking vCPUs to sync the dirty log when PML is disabled
Problem Details: Stop kicking vCPUs in kvm_arch_sync_dirty_log() when PML is disabled. Kicking vCPUs when PML is disabled serves no purpose and could negatively impact guest performance. This restores KVM's behavior to prior to 5.12 commit a018eba53870 ("KVM: x86: Move MMU's PML logic to common code"), which replaced ...
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 94ccad95f7e0..051ca1978442 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6355,6 +6355,9 @@ void kvm_arch_sync_dirty_log(struct kvm *kvm, struct kvm_memory_slot *memslot) struct kvm_vcpu *vcpu; unsigned long i; + if (!kvm_x86_ops.cpu...
41efa431244f6498833ff8ee8dde28c4924c5479
Analyze and fix the following issue in the Linux kernel code: PCI/MSI: Provide stubs for IMS functions
Problem Details: The IMS related functions (pci_create_ims_domain(), pci_ims_alloc_irq(), and pci_ims_free_irq()) are not declared when CONFIG_PCI_MSI is disabled. Provide definitions of these functions for use when callers are compiled with CONFIG_PCI_MSI disabled. Fixes: 0194425af0c8 ("PCI/MSI: Provide IMS (Interru...
```diff diff --git a/include/linux/pci.h b/include/linux/pci.h index 8c7c2c3c6c65..b56417276042 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1624,6 +1624,8 @@ struct msix_entry { u16 entry; /* Driver uses to specify entry, OS writes */ }; +struct msi_domain_template; + #ifdef CONFIG_PCI_MSI int...
9a13ee457a6e7a850ac1d145b0731b1d729b8f42
Analyze and fix the following issue in the Linux kernel code: perf: script: fix missing ',' for fields option
Problem Details: A comma is missed at the end of line. Signed-off-by: Changbin Du <changbin.du@huawei.com> Link: https://lore.kernel.org/r/20231017015524.797065-1-changbin.du@huawei.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
```diff diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 517bf25750c8..b1f57401ff23 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -3899,7 +3899,7 @@ int cmd_script(int argc, const char **argv) "comma separated output fields prepend with 'type:'. " ...
a20fca2c5db19a09260827e526f37397ba698ce0
Analyze and fix the following issue in the Linux kernel code: perf tests: Fix shellcheck warning in stat_all_metricgroups
Problem Details: Running shellcheck on stat_all_metricgroups.sh reports below warning: In ./tests/shell/stat_all_metricgroups.sh line 7: function ParanoidAndNotRoot() ^-- SC2112: 'function' keyword is non-standard. Delete it. As per the format, "function" is a non-standard keyword that can be used to declare funct...
```diff diff --git a/tools/perf/tests/shell/stat_all_metricgroups.sh b/tools/perf/tests/shell/stat_all_metricgroups.sh index f3e305649e2c..55ef9c9ded2d 100755 --- a/tools/perf/tests/shell/stat_all_metricgroups.sh +++ b/tools/perf/tests/shell/stat_all_metricgroups.sh @@ -4,7 +4,7 @@ set -e -function ParanoidAndNotR...
eff65ee26ed73f3ca635bac13c386a4538a608d8
Analyze and fix the following issue in the Linux kernel code: perf tests: Fix shellcheck warning in record_sideband.sh
Problem Details: Running shellcheck on record_sideband.sh throws below warning: In tests/shell/record_sideband.sh line 25: if ! perf record -o ${perfdata} -BN --no-bpf-event -C $1 true 2>&1 >/dev/null ^--^ SC2069: To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify). This s...
```diff diff --git a/tools/perf/tests/shell/record_sideband.sh b/tools/perf/tests/shell/record_sideband.sh index 5024a7ce0c51..ac70ac27d590 100755 --- a/tools/perf/tests/shell/record_sideband.sh +++ b/tools/perf/tests/shell/record_sideband.sh @@ -22,7 +22,7 @@ trap trap_cleanup EXIT TERM INT can_cpu_wide() { - i...
47f5693c4ce9b2bf2364303a531423e43278d3b6
Analyze and fix the following issue in the Linux kernel code: perf tests: Ignore shellcheck warning in lock_contention
Problem Details: Running shellcheck on lock_contention.sh generates below warning In tests/shell/lock_contention.sh line 36: if [ `nproc` -lt 4 ]; then ^-----^ SC2046: Quote this to prevent word splitting. Here since nproc will generate a single word output and there is no possibility of word splitting, this...
```diff diff --git a/tools/perf/tests/shell/lock_contention.sh b/tools/perf/tests/shell/lock_contention.sh index d5a191d3d090..c1ec5762215b 100755 --- a/tools/perf/tests/shell/lock_contention.sh +++ b/tools/perf/tests/shell/lock_contention.sh @@ -33,6 +33,7 @@ check() { exit fi + # shellcheck disable=SC2046 if...
f6a66ff98ac1cfbfb83ec2445f5652ae065a1bf0
Analyze and fix the following issue in the Linux kernel code: tools/perf/arch/powerpc: Fix the CPU ID const char* value by adding 0x prefix
Problem Details: Simple expression parser test fails in powerpc as below: 4: Simple expression parser test child forked, pid 170385 Using CPUID 004e2102 division by zero syntax error syntax error FAILED tests/expr.c:65 parse test failed test child finished with -1 Simple expression ...
```diff diff --git a/tools/perf/arch/powerpc/util/header.c b/tools/perf/arch/powerpc/util/header.c index c8d0dc775e5d..6b00efd53638 100644 --- a/tools/perf/arch/powerpc/util/header.c +++ b/tools/perf/arch/powerpc/util/header.c @@ -34,7 +34,7 @@ get_cpuid_str(struct perf_pmu *pmu __maybe_unused) { char *bufp; - if ...
bee448390e5166d019e9e037194d487ee94399d9
Analyze and fix the following issue in the Linux kernel code: iio: afe: rescale: Accept only offset channels
Problem Details: As noted by Jonathan Cameron: it is perfectly legal for a channel to have an offset but no scale in addition to the raw interface. The conversion will imply that scale is 1:1. Make rescale_configure_channel() accept just scale, or just offset to process a channel. When a user asks for IIO_CHAN_INFO_O...
```diff diff --git a/drivers/iio/afe/iio-rescale.c b/drivers/iio/afe/iio-rescale.c index 1f280c360701..56e5913ab82d 100644 --- a/drivers/iio/afe/iio-rescale.c +++ b/drivers/iio/afe/iio-rescale.c @@ -214,8 +214,18 @@ static int rescale_read_raw(struct iio_dev *indio_dev, return ret < 0 ? ret : -EOPNOTSUPP; } -...
7b00d1018c8c8ed55aa1393b2ca234400eb6ca86
Analyze and fix the following issue in the Linux kernel code: tools/power/x86/intel-speed-select: turbo-mode enable disable swapped
Problem Details: The command for turbo-mode enable and disable is swapped. Fix that. Previously turbo-mode enable was actually disabling and disable was enabling. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
```diff diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c index 9306436bb5b0..72be2d4db21c 100644 --- a/tools/power/x86/intel-speed-select/isst-config.c +++ b/tools/power/x86/intel-speed-select/isst-config.c @@ -2527,22 +2527,22 @@ static void set_turbo_mod...
780967feb626c6f4efa1e4b3532f1be83884cd76
Analyze and fix the following issue in the Linux kernel code: dt-bindings: Add Marantec vendor prefix
Problem Details: Add vendor prefix for Marantec electronics GmbH. Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20231016150415.3196-1-cniedermaier@dh-electronics.com Signed-off-by: Rob Herring <robh@...
```diff diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 573578db9509..8a858850fb54 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -805,6 +805,8 @@ patte...
29a7e00ffadddd8d68eff311de1bf12ae10687bb
Analyze and fix the following issue in the Linux kernel code: bpf: Fix missed rcu read lock in bpf_task_under_cgroup()
Problem Details: When employed within a sleepable program not under RCU protection, the use of 'bpf_task_under_cgroup()' may trigger a warning in the kernel log, particularly when CONFIG_PROVE_RCU is enabled: [ 1259.662357] WARNING: suspicious RCU usage [ 1259.662358] 6.5.0+ #33 Not tainted [ 1259.662360] ------...
```diff diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index 62a53ebfedf9..61f51dee8448 100644 --- a/kernel/bpf/helpers.c +++ b/kernel/bpf/helpers.c @@ -2215,7 +2215,12 @@ __bpf_kfunc struct cgroup *bpf_cgroup_from_id(u64 cgid) __bpf_kfunc long bpf_task_under_cgroup(struct task_struct *task, stru...
0059bc9a29e02853dbbaa0f6d0635a687c8b9835
Analyze and fix the following issue in the Linux kernel code: console: fix up ARM screen_info reference
Problem Details: Separating the VGA console screen_info from the EFI one unfortunately caused a build failure for footbridge that I had never caught with randconfig builds: arch/arm/kernel/setup.c:932:27: error: static declaration of 'vgacon_screen_info' follows non-static declaration 932 | static struct screen_info...
```diff diff --git a/arch/arm/include/asm/vga.h b/arch/arm/include/asm/vga.h index 7c0bee57855a..6c430ec371df 100644 --- a/arch/arm/include/asm/vga.h +++ b/arch/arm/include/asm/vga.h @@ -5,6 +5,7 @@ #include <linux/io.h> extern unsigned long vga_base; +extern struct screen_info vgacon_screen_info; #define VGA_MA...
85248d670b71d9edda9459ee14fdc85c8e9632c0
Analyze and fix the following issue in the Linux kernel code: ublk: move ublk_cancel_dev() out of ub->mutex
Problem Details: ublk_cancel_dev() just calls ublk_cancel_queue() to cancel all pending io commands after ublk request queue is idle. The only protection is just the read & write of ubq->nr_io_ready and avoid duplicated command cancel, so add one per-queue lock with cancel flag for providing this protection, meantime m...
```diff diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index 2e2efae62c77..5b1cf94bd22f 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -115,6 +115,9 @@ struct ublk_uring_cmd_pdu { */ #define UBLK_IO_FLAG_NEED_GET_DATA 0x08 +/* atomic RW with ubq->cancel_lock */ +#define U...
5fe030e38974d6f8e078c23a503fd6ce23412667
Analyze and fix the following issue in the Linux kernel code: staging: wlan-ng: remove function prism2sta_ev_txexc
Problem Details: The function prism2sta_ev_txexc() is called by the function hfa384x_usbin_txcompl() to print the transmit exception event - a debug information using netdev_dbg(). The debugging utility function can be called directly by hfa384x_usbin_txcompl(). Signed-off-by: Calvince Otieno <calvncce@gmail.com> Lin...
```diff diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index 3e8c92675c82..35650f911ebc 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -3194,7 +3194,7 @@ static void hfa384x_usbin_txcompl(struct wlandevice *wlandev, /* Wa...
97fe6d0ae79b98e0445a27fca9a1436490c3fea6
Analyze and fix the following issue in the Linux kernel code: staging: wlan-ng: use netdev_dbg over pr_debug
Problem Details: This patch replaces the usage of pr_debug() with netdev_dbg(). The change is made to enhance context-aware debugging, improve code clarity, and maintain compatibility with established network debugging practices. There were no functional code changes. Signed-off-by: Calvince Otieno <calvncce@gmail.com...
```diff diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c index b5e95a3207fe..964164bb4165 100644 --- a/drivers/staging/wlan-ng/prism2sta.c +++ b/drivers/staging/wlan-ng/prism2sta.c @@ -265,46 +265,50 @@ static int prism2sta_mlmerequest(struct wlandevice *wlandev, switch (msg->m...
a2fc3e8215313c8e4e42d4b2062830aaf1ef49c0
Analyze and fix the following issue in the Linux kernel code: staging: rtl8192u: remove entry from Makefile
Problem Details: In commit 697455ce4110 ("staging: rtl8192u: Remove broken driver"), the driver was removed, along with the Kconfig entry, but the Makefile line in drivers/staging/Makefile was not updated, so things like 'make clean' fail to work properly as they will decend into all subdirectories to try to clean thin...
```diff diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile index ffa70dda481d..0f6379436443 100644 --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile @@ -4,7 +4,6 @@ obj-y += media/ obj-$(CONFIG_PRISM2_USB) += wlan-ng/ obj-$(CONFIG_FB_OLPC_DCON) += olpc_dcon/ -obj-$(CONFIG_RTL8192U) += r...
4cee14bcb14881aae81d60f106a335c68553ac1f
Analyze and fix the following issue in the Linux kernel code: x86/resctrl: Display RMID of resource group
Problem Details: In x86, hardware uses RMID to identify a monitoring group. When a user creates a monitor group these details are not visible. These details can help resctrl debugging. Add RMID(mon_hw_id) to the monitor groups display in the resctrl interface. Users can see these details when resctrl is mounted with "...
```diff diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/resctrl.rst index 7412252f95a7..a6279df64a9d 100644 --- a/Documentation/arch/x86/resctrl.rst +++ b/Documentation/arch/x86/resctrl.rst @@ -376,6 +376,10 @@ When monitoring is enabled all MON groups will also contain: the sum for all tasks...
ca8dad225e237493f19b1c5d4a8531f13a9b078f
Analyze and fix the following issue in the Linux kernel code: x86/resctrl: Display CLOSID for resource group
Problem Details: In x86, hardware uses CLOSID to identify a control group. When a user creates a control group this information is not visible to the user. It can help resctrl debugging. Add CLOSID(ctrl_hw_id) to the control groups display in the resctrl interface. Users can see this detail when resctrl is mounted wit...
```diff diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/resctrl.rst index 68f11611f341..7412252f95a7 100644 --- a/Documentation/arch/x86/resctrl.rst +++ b/Documentation/arch/x86/resctrl.rst @@ -359,6 +359,10 @@ When control is enabled all CTRL_MON groups will also contain: file. On successful...
95535e37e8959f50e7aee365a5bdc9e5ed720443
Analyze and fix the following issue in the Linux kernel code: gve: Do not fully free QPL pages on prefill errors
Problem Details: The prefill function should have only removed the page count bias it added. Fully freeing the page will cause gve_free_queue_page_list to free a page the driver no longer owns. Fixes: 82fd151d38d9 ("gve: Reduce alloc and copy costs in the GQ rx path") Signed-off-by: Shailend Chand <shailend@google.com...
```diff diff --git a/drivers/net/ethernet/google/gve/gve_rx.c b/drivers/net/ethernet/google/gve/gve_rx.c index d1da7413dc4d..e84a066aa1a4 100644 --- a/drivers/net/ethernet/google/gve/gve_rx.c +++ b/drivers/net/ethernet/google/gve/gve_rx.c @@ -146,7 +146,7 @@ static int gve_prefill_rx_pages(struct gve_rx_ring *rx) er...
184fdf9fc7ae6ae7155768faa48fc609d1a24b7e
Analyze and fix the following issue in the Linux kernel code: locking/seqlock: Fix grammar in comment
Problem Details: The "neither writes before and after ..." for the description of do_write_seqcount_end() should be "neither writes before nor after". Signed-off-by: Cuda-Chen <clh960524@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20231017053703.11312-1-clh960524@gmail.com
```diff diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 80f21d2ca2aa..e92f9d5577ba 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h @@ -584,7 +584,7 @@ static inline void do_write_seqcount_end(seqcount_t *s) * via WRITE_ONCE): a) to ensure the writes become visible to other thre...
cb07d71f01017b7c2885ed629da9b973cb56b1d2
Analyze and fix the following issue in the Linux kernel code: x86/resctrl: Introduce "-o debug" mount option
Problem Details: Add "-o debug" option to mount resctrl filesystem in debug mode. When in debug mode resctrl displays files that have the new RFTYPE_DEBUG flag to help resctrl debugging. Signed-off-by: Babu Moger <babu.moger@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Peter Newman <peter...
```diff diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/resctrl.rst index 178ab1d8f747..68f11611f341 100644 --- a/Documentation/arch/x86/resctrl.rst +++ b/Documentation/arch/x86/resctrl.rst @@ -35,7 +35,7 @@ about the feature from resctrl's info directory. To use the feature mount the file s...
1b2d3b45c1941453703d70f46b70ab8985303b5d
Analyze and fix the following issue in the Linux kernel code: net: gso_test: release each segment individually
Problem Details: consume_skb() doesn't walk the segment list, so segments other than the first are leaked. Move this skb_consume call into the loop. Cc: Willem de Bruijn <willemb@google.com> Fixes: b3098d32ed6e ("net: add skb_segment kunit test") Signed-off-by: Florian Westphal <fw@strlen.de> Reviewed-by: Willem de B...
```diff diff --git a/net/core/gso_test.c b/net/core/gso_test.c index c4b13de6abfb..ceb684be4cbf 100644 --- a/net/core/gso_test.c +++ b/net/core/gso_test.c @@ -144,8 +144,8 @@ KUNIT_ARRAY_PARAM(gso_test, cases, gso_test_case_to_desc); static void gso_test_func(struct kunit *test) { const int shinfo_size = SKB_DATA_A...
d41592435cde9a658a1bd3b3fdfeb8db7b330d78
Analyze and fix the following issue in the Linux kernel code: x86/resctrl: Rename rftype flags for consistency
Problem Details: resctrl associates rftype flags with its files so that files can be chosen based on the resource, whether it is info or base, and if it is control or monitor type file. These flags use the RF_ as well as RFTYPE_ prefixes. Change the prefix to RFTYPE_ for all these flags to be consistent. Signed-off-b...
```diff diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 0ad970c5c867..ba4611111212 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -248,10 +248,10 @@ struct rdtgroup { #define RFTYPE_TOP BIT(6) #define RFTYPE_RES_...
137df1189d128a6b5dee2f653e054b40ef36b94c
Analyze and fix the following issue in the Linux kernel code: libbpf: Don't assume SHT_GNU_verdef presence for SHT_GNU_versym section
Problem Details: Fix too eager assumption that SHT_GNU_verdef ELF section is going to be present whenever binary has SHT_GNU_versym section. It seems like either SHT_GNU_verdef or SHT_GNU_verneed can be used, so failing on missing SHT_GNU_verdef actually breaks use cases in production. One specific reported issue, whi...
```diff diff --git a/tools/lib/bpf/elf.c b/tools/lib/bpf/elf.c index 2a158e8a8b7c..2a62bf411bb3 100644 --- a/tools/lib/bpf/elf.c +++ b/tools/lib/bpf/elf.c @@ -141,14 +141,15 @@ static int elf_sym_iter_new(struct elf_sym_iter *iter, iter->versyms = elf_getdata(scn, 0); scn = elf_find_next_scn_by_type(elf, SHT_GNU_...
5055fadfa7e16f2427d5b3c40b2bf563ddfdab22
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/mediatek: Fix probe for THERMAL_V2
Problem Details: Fix the probe function to call mtk_thermal_release_periodic_ts for everything != MTK_THERMAL_V1. This was accidentally changed from V1 to V2 in the original patch. Reported-by: Frank Wunderlich <frank-w@public-files.de> Closes: https://lore.kernel.org/lkml/B0B3775B-B8D1-4284-814F-4F41EC22F532@public-f...
```diff diff --git a/drivers/thermal/mediatek/auxadc_thermal.c b/drivers/thermal/mediatek/auxadc_thermal.c index 843214d30bd8..8b0edb204844 100644 --- a/drivers/thermal/mediatek/auxadc_thermal.c +++ b/drivers/thermal/mediatek/auxadc_thermal.c @@ -1267,7 +1267,7 @@ static int mtk_thermal_probe(struct platform_device *pd...
63e44bc52047f182601e7817da969a105aa1f721
Analyze and fix the following issue in the Linux kernel code: x86/sev: Check for user-space IOIO pointing to kernel space
Problem Details: Check the memory operand of INS/OUTS before emulating the instruction. The #VC exception can get raised from user-space, but the memory operand can be manipulated to access kernel memory before the emulation actually begins and after the exception handler has run. [ bp: Massage commit message. ] Fi...
```diff diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boot/compressed/sev.c index afd91041ec3e..80d76aea1f7b 100644 --- a/arch/x86/boot/compressed/sev.c +++ b/arch/x86/boot/compressed/sev.c @@ -108,6 +108,11 @@ static enum es_result vc_ioio_check(struct es_em_ctxt *ctxt, u16 port, size_t si return ES_OK; } ...
6c29e29e4d7f29348a9e051ad5bdb833c5a1bbb6
Analyze and fix the following issue in the Linux kernel code: PM / devfreq: mediatek: unlock on error in mtk_ccifreq_target()
Problem Details: Call mutex_unlock(&drv->reg_lock) before returning the error code. Link: https://lore.kernel.org/all/1bada9b2-d276-4123-bfdf-03d165569543@moroto.mountain/ Fixes: d2805601988f ("PM / devfreq: mediatek: protect oop in critical session") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by...
```diff diff --git a/drivers/devfreq/mtk-cci-devfreq.c b/drivers/devfreq/mtk-cci-devfreq.c index b0ed25e33f2b..11bc3d03494c 100644 --- a/drivers/devfreq/mtk-cci-devfreq.c +++ b/drivers/devfreq/mtk-cci-devfreq.c @@ -146,7 +146,8 @@ static int mtk_ccifreq_target(struct device *dev, unsigned long *freq, opp = devfreq_re...
b3edc3463d64bc469162138a6bec6913fbeef931
Analyze and fix the following issue in the Linux kernel code: extcon: realtek: add the error handler for nvmem_cell_read
Problem Details: There are following smatch warning: drivers/extcon/extcon-rtk-type-c.c:905 __updated_type_c_parameter_by_efuse() error: 'buf' dereferencing possible ERR_PTR() The nvmem_cell_read may fail to read. So, driver must handle failure cases. Link: https://lore.kernel.org/all/20231016053510.28881-1-stanley_c...
```diff diff --git a/drivers/extcon/extcon-rtk-type-c.c b/drivers/extcon/extcon-rtk-type-c.c index 00465cfba23e..a592bab77538 100644 --- a/drivers/extcon/extcon-rtk-type-c.c +++ b/drivers/extcon/extcon-rtk-type-c.c @@ -901,25 +901,26 @@ static int __updated_type_c_parameter_by_efuse(struct type_c_data *type_c) int v...
6f2eeef4a0aa9791bbba9d353641a6e067bb86c1
Analyze and fix the following issue in the Linux kernel code: Documentation/gpu: Add a VM_BIND async document
Problem Details: Add a motivation for and description of asynchronous VM_BIND operation v2: - Fix typos (Nirmoy Das) - Improve the description of a memory fence (Oak Zeng) - Add a reference to the document in the Xe RFC. - Add pointers to sample uAPI suggestions v3: - Address review comments (Danilo Krummrich) - Forma...
```diff diff --git a/Documentation/gpu/drm-vm-bind-async.rst b/Documentation/gpu/drm-vm-bind-async.rst new file mode 100644 index 000000000000..3d709d02099c --- /dev/null +++ b/Documentation/gpu/drm-vm-bind-async.rst @@ -0,0 +1,309 @@ +.. SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +==================== +Asynchronous ...
b858a97bf0533eb94c6fd8a307df74a3e59a6bd2
Analyze and fix the following issue in the Linux kernel code: vga16fb: drop powerpc support
Problem Details: I noticed that commit 0db5b61e0dc07 ("fbdev/vga16fb: Create EGA/VGA devices in sysfb code") broke vga16fb on non-x86 platforms, because the sysfb code never creates a vga-framebuffer device when screen_info.orig_video_isVGA is set to '1' instead of VIDEO_TYPE_VGAC. However, it turns out that the only ...
```diff diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 2f1026fba00d..22d48a543061 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -22,7 +22,6 @@ #include <linux/seq_file.h> #include <linux/ioport.h> #include <linux/console.h> -#i...
555624c0d10bf09c62c45a86a47e752013f86fb5
Analyze and fix the following issue in the Linux kernel code: vgacon: clean up global screen_info instances
Problem Details: To prepare for completely separating the VGA console screen_info from the one used in EFI/sysfb, rename the vgacon instances and make them local as much as possible. ia64 and arm both have confurations with vgacon and efi, but the contents never overlaps because ia64 has no EFI framebuffer, and arm on...
```diff diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h index 5816a31c1b38..2c89c1c55712 100644 --- a/arch/alpha/kernel/proto.h +++ b/arch/alpha/kernel/proto.h @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 */ #include <linux/interrupt.h> +#include <linux/screen_info.h> #include <linux/io.h> ...
2a1d728f20edeee7f26dc307ed9df4e0d23947ab
Analyze and fix the following issue in the Linux kernel code: tty: serial: meson: fix hard LOCKUP on crtscts mode
Problem Details: There might be hard lockup if we set crtscts mode on port without RTS/CTS configured: # stty -F /dev/ttyAML6 crtscts; echo 1 > /dev/ttyAML6; echo 2 > /dev/ttyAML6 [ 95.890386] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: [ 95.890857] rcu: 3-...0: (201 ticks this GP) idle=e33c/1/0x4000...
```diff diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c index de298bf75d9b..8dd84617e715 100644 --- a/drivers/tty/serial/meson_uart.c +++ b/drivers/tty/serial/meson_uart.c @@ -380,10 +380,14 @@ static void meson_uart_set_termios(struct uart_port *port, else val |= AML_UART_STOP_BIT_1...
48b5aaec596d9a2a22c97a1e2aa56103e0c72d38
Analyze and fix the following issue in the Linux kernel code: OPP: Remove genpd_virt_dev_lock
Problem Details: All the config operations for OPP tables share common code paths now and none of the other ones have such protection in place. Either all should have it or none. The understanding here is that user won't clear the OPP configs while still using them and so such a case won't happen. We can always come b...
```diff diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 42ca52fbe210..2ceadc3f93ca 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -1076,7 +1076,7 @@ static int _opp_set_required_opps_genpd(struct device *dev, { struct device **genpd_virt_devs = opp_table->genpd_virt_devs ? opp_table->genpd...
1aee9158bc978f91701c5992e395efbc6da2de3c
Analyze and fix the following issue in the Linux kernel code: nfsd: lock_rename() needs both directories to live on the same fs
Problem Details: ... checking that after lock_rename() is too late. Incidentally, NFSv2 had no nfserr_xdev... Fixes: aa387d6ce153 "nfsd: fix EXDEV checking in rename" Cc: stable@vger.kernel.org # v3.9+ Reviewed-by: Jeff Layton <jlayton@kernel.org> Acked-by: Chuck Lever <chuck.lever@oracle.com> Tested-by: Jeff Layton ...
```diff diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 48260cf68fde..02f5fcaad03f 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1788,6 +1788,12 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen, if (!flen || isdotent(fname, flen) || !tlen || isdotent(tname, tlen)) goto out; ...
700b2b439766e8aab8a7174991198497345bd411
Analyze and fix the following issue in the Linux kernel code: fprobe: Fix to ensure the number of active retprobes is not zero
Problem Details: The number of active retprobes can be zero but it is not acceptable, so return EINVAL error if detected. Link: https://lore.kernel.org/all/169750018550.186853.11198884812017796410.stgit@devnote2/ Reported-by: wuqiang.matt <wuqiang.matt@bytedance.com> Closes: https://lore.kernel.org/all/20231016222103...
```diff diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c index 3b21f4063258..881f90f0cbcf 100644 --- a/kernel/trace/fprobe.c +++ b/kernel/trace/fprobe.c @@ -189,7 +189,7 @@ static int fprobe_init_rethook(struct fprobe *fp, int num) { int i, size; - if (num < 0) + if (num <= 0) return -EINVAL; if (...
2a86ac30a6687e47436e547deadae3bf0fc28697
Analyze and fix the following issue in the Linux kernel code: Documentation: probes: Add a new ret_ip callback parameter
Problem Details: Add a new ret_ip callback parameter description. Link: https://lore.kernel.org/all/169556257133.146934.13560704846459957726.stgit@devnote2/ Fixes: cb16330d1274 ("fprobe: Pass return address to the handlers") Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Acked-by: Florent Revest <reve...
```diff diff --git a/Documentation/trace/fprobe.rst b/Documentation/trace/fprobe.rst index 7a895514b537..196f52386aaa 100644 --- a/Documentation/trace/fprobe.rst +++ b/Documentation/trace/fprobe.rst @@ -91,9 +91,9 @@ The prototype of the entry/exit callback function are as follows: .. code-block:: c - int entry_ca...
097c06394c835be0cf21e23f9bd13ff771601b63
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Fix double free of dsd_list during driver load
Problem Details: On driver load, scsi_add_host() can fail. This triggers the free path to call qla2x00_mem_free() multiple times. This causes NULL pointer access of ha->base_qpair. Add check before access. BUG: unable to handle kernel NULL pointer dereference at 0000000000000030 IP: [<ffffffffc118f73c>] qla2x00_mem_...
```diff diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 50db08265c51..dcae09a37d49 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -4953,7 +4953,7 @@ qla2x00_mem_free(struct qla_hw_data *ha) ha->gid_list = NULL; ha->gid_list_dma = 0; - if (!list_e...
e40c04ade0e2f3916b78211d747317843b11ce10
Analyze and fix the following issue in the Linux kernel code: scsi: mpt3sas: Fix in error path
Problem Details: The driver should be deregistered as misc driver after PCI registration failure. Signed-off-by: Tomas Henzl <thenzl@redhat.com> Link: https://lore.kernel.org/r/20231015114529.10725-1-thenzl@redhat.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
```diff diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index c3c1f466fe01..605013d3ee83 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -12913,8 +12913,10 @@ _mpt3sas_init(void) mpt3sas_ctl_init(hbas_to_enumerate); error = p...
573c2d066eb950dd9bd6e8735d3a859bbc21b3cc
Analyze and fix the following issue in the Linux kernel code: scsi: scsi_debug: Add param to control sdev's allow_restart
Problem Details: Add new module param "allow_restart" to control scsi_device's allow_restart flag. This flag determines if EH is triggered after a command completes with sense_key 0x6, ASC 0x4 and ASCQ 0x2. EH would be triggered if allow_restart=1 in this condition. The new param can be used with the error injection c...
```diff diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 2743eb36c58e..67922e2c4c19 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -843,6 +843,7 @@ static bool have_dif_prot; static bool write_since_sync; static bool sdebug_statistics = DEF_STATISTICS; static bool s...
f084fe52c640775de51056670f568ec7104b922a
Analyze and fix the following issue in the Linux kernel code: scsi: scsi_debug: Add debugfs interface to fail target reset
Problem Details: The interface is found at /sys/kernel/debug/scsi_debug/target<h:c:t>/fail_reset where <h:c:t> identifies the target to inject errors on. It's a simple bool type interface which would make this target's reset fail if set to 'Y'. Signed-off-by: Wenchao Hao <haowenchao2@huawei.com> Link: https://lore.ker...
```diff diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index e54ba0bfa0d6..2743eb36c58e 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -42,6 +42,7 @@ #include <linux/xarray.h> #include <linux/prefetch.h> #include <linux/debugfs.h> +#include <linux/async.h> #include <...
0267811625e13a7743eeb6072b57509bf909f484
Analyze and fix the following issue in the Linux kernel code: scsi: scsi_debug: Add new error injection type: Reset LUN failed
Problem Details: Add error injection type 4 to make scsi_debug_device_reset() return FAILED. Fail abort command format: +--------+------+-------------------------------------------------------+ | Column | Type | Description | +--------+------+----------------------------...
```diff diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 89f47ded1e23..e54ba0bfa0d6 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -295,6 +295,8 @@ enum sdebug_err_type { /* with errors set in scsi_cmnd */ ERR_ABORT_CMD_FAILED = 3, /* control return FAILED from...
5551ce928805ba790db0fa0a895e207d5d05717d
Analyze and fix the following issue in the Linux kernel code: scsi: scsi_debug: Add new error injection type: Abort Failed
Problem Details: Add error injection type 3 to make scsi_debug_abort() return FAILED. Fail abort command format: +--------+------+-------------------------------------------------------+ | Column | Type | Description | +--------+------+----------------------------------...
```diff diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index d15d007f1317..89f47ded1e23 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -293,6 +293,8 @@ enum sdebug_err_type { ERR_FAIL_CMD = 2, /* make specific scsi command's */ /* queuecmd return succeed but */ ...