id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
b8dbe9648d69059cfe3a28917bfbf7e61efd7f15
Analyze and fix the following issue in the Linux kernel code: Bluetooth: MGMT: validate LTK enc_size on load
Problem Details: Load Long Term Keys stores the user-provided enc_size and later uses it to size fixed-size stack operations when replying to LE LTK requests. An enc_size larger than the 16-byte key buffer can therefore overflow the reply stack buffer. Reject oversized enc_size values while validating the management L...
```diff diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index e5f9287fb826..adcd86c15b4e 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -7248,6 +7248,9 @@ static bool ltk_is_valid(struct mgmt_ltk_info *key) if (key->initiator != 0x00 && key->initiator != 0x01) return false; + if (key->e...
0ffac654e95c1bdfe2d4edf28fb18d6ba1f103e6
Analyze and fix the following issue in the Linux kernel code: Bluetooth: hci_h4: Fix race during initialization
Problem Details: Commit 5df5dafc171b ("Bluetooth: hci_uart: Fix another race during initialization") fixed a race for hci commands sent during initialization. However, there is still a race that happens if an hci event from one of these commands is received before HCI_UART_REGISTERED has been set at the end of hci_uart...
```diff diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c index 07cc2a79a77b..a889a66a326f 100644 --- a/drivers/bluetooth/hci_h4.c +++ b/drivers/bluetooth/hci_h4.c @@ -109,9 +109,6 @@ static int h4_recv(struct hci_uart *hu, const void *data, int count) { struct h4_struct *h4 = hu->priv; - if (!t...
035c25007c9e698bef3826070ee34bb6d778020c
Analyze and fix the following issue in the Linux kernel code: Bluetooth: hci_sync: Fix UAF in le_read_features_complete
Problem Details: This fixes the following backtrace caused by hci_conn being freed before le_read_features_complete but after hci_le_read_remote_features_sync so hci_conn_del -> hci_cmd_sync_dequeue is not able to prevent it: ================================================================== BUG: KASAN: slab-use-after...
```diff diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 8cbbba50e77e..ffb0ceda6f7b 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -7390,10 +7390,8 @@ static void le_read_features_complete(struct hci_dev *hdev, void *data, int err) bt_dev_dbg(hdev, "err %d", err); - ...
aca377208e7f7322bf4e107cdec6e7d7e8aa7a88
Analyze and fix the following issue in the Linux kernel code: Bluetooth: hci_sync: fix leaks when hci_cmd_sync_queue_once fails
Problem Details: When hci_cmd_sync_queue_once() returns with error, the destroy callback will not be called. Fix leaking references / memory on these failures. Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
```diff diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 97745710e3ce..8cbbba50e77e 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -7460,13 +7460,16 @@ int hci_le_read_remote_features(struct hci_conn *conn) * role is possible. Otherwise just transition into the * con...
2b2bf47cd75518c36fa2d41380e4a40641cc89cd
Analyze and fix the following issue in the Linux kernel code: Bluetooth: hci_event: move wake reason storage into validated event handlers
Problem Details: hci_store_wake_reason() is called from hci_event_packet() immediately after stripping the HCI event header but before hci_event_func() enforces the per-event minimum payload length from hci_ev_table. This means a short HCI event frame can reach bacpy() before any bounds check runs. Rather than duplica...
```diff diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 286529d2e554..81d2f9a3eec9 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -80,6 +80,10 @@ static void *hci_le_ev_skb_pull(struct hci_dev *hdev, struct sk_buff *skb, return data; } +static void hci_store_wake...
8a5b0135d4a5d9683203a3d9a12a711ccec5936b
Analyze and fix the following issue in the Linux kernel code: Bluetooth: SCO: fix race conditions in sco_sock_connect()
Problem Details: sco_sock_connect() checks sk_state and sk_type without holding the socket lock. Two concurrent connect() syscalls on the same socket can both pass the check and enter sco_connect(), leading to use-after-free. The buggy scenario involves three participants and was confirmed with additional logging inst...
```diff diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 584e059de20a..b84587811ef4 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -298,7 +298,7 @@ static int sco_chan_add(struct sco_conn *conn, struct sock *sk, int err = 0; sco_conn_lock(conn); - if (conn->sk) + if (conn->sk || sco_pi(...
a834a0b66ec6fb743377201a0f4229bb2503f4ce
Analyze and fix the following issue in the Linux kernel code: Bluetooth: hci_sync: call destroy in hci_cmd_sync_run if immediate
Problem Details: hci_cmd_sync_run() may run the work immediately if called from existing sync work (otherwise it queues a new sync work). In this case it fails to call the destroy() function. On immediate run, make it behave same way as if item was queued successfully: call destroy, and return 0. The only callsite is...
```diff diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 45d16639874a..6283a4df78b0 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -801,8 +801,15 @@ int hci_cmd_sync_run(struct hci_dev *hdev, hci_cmd_sync_work_func_t func, return -ENETDOWN; /* If on cmd_sync_work th...
01cc50ea5167bb14117257ec084637abe9e5f691
Analyze and fix the following issue in the Linux kernel code: mips: mm: Allocate tlb_vpn array atomically
Problem Details: Found by DEBUG_ATOMIC_SLEEP: BUG: sleeping function called from invalid context at /include/linux/sched/mm.h:306 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 0, name: swapper/1 preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 no locks held by swapper/1/0. irq event st...
```diff diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c index 08c3e65bf0f2..24fe85fa169d 100644 --- a/arch/mips/mm/tlb-r4k.c +++ b/arch/mips/mm/tlb-r4k.c @@ -751,7 +751,7 @@ static void __ref r4k_tlb_uniquify(void) tlb_vpn_size = tlbsize * sizeof(*tlb_vpns); tlb_vpns = (use_slab ? - kmalloc(tlb_...
9dc42c9070282c81058a875fea5acae057610980
Analyze and fix the following issue in the Linux kernel code: workqueue: fix typo in WQ_AFFN_SMT comment
Problem Details: Fix "poer" -> "per" in the WQ_AFFN_SMT enum comment. Signed-off-by: Breno Leitao <leitao@debian.org> Signed-off-by: Tejun Heo <tj@kernel.org>
```diff diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 9f971912c6be..75634a09576a 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -131,7 +131,7 @@ struct rcu_work { enum wq_affn_scope { WQ_AFFN_DFL, /* use system default */ WQ_AFFN_CPU, /* one pod per CPU */ ...
703ccb63ae9f7444d6ff876d024e17f628103c69
Analyze and fix the following issue in the Linux kernel code: workqueue: Add pool_workqueue to pending_pwqs list when unplugging multiple inactive works
Problem Details: In unplug_oldest_pwq(), the first inactive work item on the pool_workqueue is activated correctly. However, if multiple inactive works exist on the same pool_workqueue, subsequent works fail to activate because wq_node_nr_active.pending_pwqs is empty — the list insertion is skipped when the pool_workqu...
```diff diff --git a/kernel/workqueue.c b/kernel/workqueue.c index eda756556341..c6ea96d5b716 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1849,8 +1849,20 @@ static void unplug_oldest_pwq(struct workqueue_struct *wq) raw_spin_lock_irq(&pwq->pool->lock); if (pwq->plugged) { pwq->plugged = false; -...
540760b77b8fc49d39d1b2b76196e5ec57711a32
Analyze and fix the following issue in the Linux kernel code: MIPS: mm: Rewrite TLB uniquification for the hidden bit feature
Problem Details: Before the introduction of the EHINV feature, which lets software mark TLB entries invalid, certain older implementations of the MIPS ISA were equipped with an analogous bit, as a vendor extension, which however is hidden from software and only ever set at reset, and then any software write clears it, ...
```diff diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c index 27bb64469604..08c3e65bf0f2 100644 --- a/arch/mips/mm/tlb-r4k.c +++ b/arch/mips/mm/tlb-r4k.c @@ -13,6 +13,7 @@ #include <linux/sched.h> #include <linux/smp.h> #include <linux/memblock.h> +#include <linux/minmax.h> #include <linux/mm.h> #incl...
ec8bf18814915460d9c617b556bf024efef26613
Analyze and fix the following issue in the Linux kernel code: MIPS: Fix the GCC version check for `__multi3' workaround
Problem Details: It was only GCC 10 that fixed a MIPS64r6 code generation issue with a `__multi3' libcall inefficiently produced to perform 64-bit widening multiplication while suitable machine instructions exist to do such a calculation. The fix went in with GCC commit 48b2123f6336 ("re PR target/82981 (unnecessary _...
```diff diff --git a/arch/mips/lib/multi3.c b/arch/mips/lib/multi3.c index 4c2483f410c2..92b3778bb56f 100644 --- a/arch/mips/lib/multi3.c +++ b/arch/mips/lib/multi3.c @@ -4,12 +4,12 @@ #include "libgcc.h" /* - * GCC 7 & older can suboptimally generate __multi3 calls for mips64r6, so for + * GCC 9 & older can subopt...
d62cf1511743526f530a4c169424e50c757f5a5e
Analyze and fix the following issue in the Linux kernel code: MIPS: SiByte: Bring back cache initialisation
Problem Details: Bring back cache initialisation for Broadcom SiByte SB1 cores, which has been removed causing the kernel to hang at bootstrap right after: Dentry cache hash table entries: 524288 (order: 8, 4194304 bytes, linear) Inode-cache hash table entries: 262144 (order: 7, 2097152 bytes, linear) The cause of th...
```diff diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index e3b4224c9a40..ad9b0430a28e 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c @@ -207,7 +207,8 @@ void cpu_cache_init(void) { if (IS_ENABLED(CONFIG_CPU_R3000) && cpu_has_3k_cache) r3k_cache_init(); - if (IS_ENABLED(CONFIG_CPU_R4K_CAC...
43985a62bab9d35e5e9af41118ce2f44c01b97d2
Analyze and fix the following issue in the Linux kernel code: mips: ralink: update CPU clock index
Problem Details: Update CPU clock index to match the clock driver changes. Fixes: d34db686a3d7 ("clk: ralink: mtmips: fix clocks probe order in oldest ralink SoCs") Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> Signed-off-by: Shiji Yang <yangshiji66@outlook.com> Reviewed-by: Sergio Paracuellos <sergio.paracuel...
```diff diff --git a/arch/mips/ralink/clk.c b/arch/mips/ralink/clk.c index 9db73fcac522..5c1eb46ef5d0 100644 --- a/arch/mips/ralink/clk.c +++ b/arch/mips/ralink/clk.c @@ -21,16 +21,16 @@ static const char *clk_cpu(int *idx) { switch (ralink_soc) { case RT2880_SOC: - *idx = 0; + *idx = 1; return "ralink,rt2880...
35d8945bf9b0c4d9586c7fa9fadeecf2cfc26c23
Analyze and fix the following issue in the Linux kernel code: MIPS: Loongson64: env: Check UARTs passed by LEFI cautiously
Problem Details: Some firmware does not set nr_uarts properly and passes empty items. Iterate at most min(system->nr_uarts, MAX_UARTS) items to prevent out-of-bounds access, and ignore UARTs with addr 0 silently. Meanwhile, our DT only works with UPIO_MEM but theoretically firmware may pass other IO types, so explicit...
```diff diff --git a/arch/mips/loongson64/env.c b/arch/mips/loongson64/env.c index 11ddf02d6a15..7abcca7ab4ed 100644 --- a/arch/mips/loongson64/env.c +++ b/arch/mips/loongson64/env.c @@ -17,7 +17,9 @@ #include <linux/dma-map-ops.h> #include <linux/export.h> #include <linux/libfdt.h> +#include <linux/minmax.h> #incl...
c064abc68e009d2cc18416e7132d9c25e03125b6
Analyze and fix the following issue in the Linux kernel code: firmware: dmi: Correct an indexing error in dmi.h
Problem Details: The entries later in enum dmi_entry_type don't match the SMBIOS specification¹. The entry for type 33: `64-Bit Memory Error Information` is not present and thus the index for all later entries is incorrect. Add it. Also, add missing entry types 43-46, while at it. ¹ Search for "System Management ...
```diff diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 927f8a8b7a1d..2eedf44e6801 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h @@ -60,6 +60,7 @@ enum dmi_entry_type { DMI_ENTRY_OOB_REMOTE_ACCESS, DMI_ENTRY_BIS_ENTRY, DMI_ENTRY_SYSTEM_BOOT, + DMI_ENTRY_64_MEM_ERROR, DMI_ENTRY_MGMT_DEV...
47f28a5bd154a95d5aa563dde02a801bd32ddb81
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl_easrc: Change the type for iec958 channel status controls
Problem Details: Use the type SNDRV_CTL_ELEM_TYPE_IEC958 for iec958 channel status controls, the original type will cause mixer-test to iterate all 32bit values, which costs a lot of time. And using IEC958 type can reduce the control numbers. Also enable pm runtime before updating registers to make the regmap cache da...
```diff diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index fbd1ba12aad0..41985162df0b 100644 --- a/sound/soc/fsl/fsl_easrc.c +++ b/sound/soc/fsl/fsl_easrc.c @@ -78,17 +78,47 @@ static int fsl_easrc_iec958_get_bits(struct snd_kcontrol *kcontrol, return 0; } +static int fsl_easrc_iec958_info(st...
aa21fe4a81458cf469c2615b08cbde5997dde25a
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl_easrc: Fix value type in fsl_easrc_iec958_get_bits()
Problem Details: The value type of controls "Context 0 IEC958 Bits Per Sample" should be integer, not enumerated, the issue is found by the mixer-test. Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/20260401094...
```diff diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index 6de1e1d3d8dc..fbd1ba12aad0 100644 --- a/sound/soc/fsl/fsl_easrc.c +++ b/sound/soc/fsl/fsl_easrc.c @@ -73,7 +73,7 @@ static int fsl_easrc_iec958_get_bits(struct snd_kcontrol *kcontrol, struct soc_mreg_control *mc = (struct soc_mreg_con...
00541b86fb578d4949cfdd6aff1f82d43fcf07af
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl_easrc: Check the variable range in fsl_easrc_iec958_put_bits()
Problem Details: Add check of input value's range in fsl_easrc_iec958_put_bits(), otherwise the wrong value may be written from user space. Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/20260401094226.2900532-...
```diff diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index 6c56134c60cc..6de1e1d3d8dc 100644 --- a/sound/soc/fsl/fsl_easrc.c +++ b/sound/soc/fsl/fsl_easrc.c @@ -54,6 +54,9 @@ static int fsl_easrc_iec958_put_bits(struct snd_kcontrol *kcontrol, unsigned int regval = ucontrol->value.integer.value[0...
64a496ba976324615b845d60739dfcdae3d57434
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl_xcvr: Fix event generation in fsl_xcvr_mode_put()
Problem Details: ALSA controls should return 1 if the value in the control changed but the control put operation fsl_xcvr_mode_put() only returns 0 or a negative error code, causing ALSA to not generate any change events. Add a suitable check in the function before updating the mode variable. Fixes: 28564486866f ("AS...
```diff diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c index 008e45009c83..d7a823384c08 100644 --- a/sound/soc/fsl/fsl_xcvr.c +++ b/sound/soc/fsl/fsl_xcvr.c @@ -225,10 +225,17 @@ static int fsl_xcvr_mode_put(struct snd_kcontrol *kcontrol, struct fsl_xcvr *xcvr = snd_soc_dai_get_drvdata(dai); struc...
1b61c8103c9317a9c37fe544c2d83cee1c281149
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl_xcvr: Fix event generation in fsl_xcvr_arc_mode_put()
Problem Details: ALSA controls should return 1 if the value in the control changed but the control put operation fsl_xcvr_arc_mode_put() only returns 0 or a negative error code, causing ALSA to not generate any change events. Add a suitable check in the function before updating the arc_mode variable. Fixes: 285644868...
```diff diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c index a268fb81a2f8..008e45009c83 100644 --- a/sound/soc/fsl/fsl_xcvr.c +++ b/sound/soc/fsl/fsl_xcvr.c @@ -115,10 +115,17 @@ static int fsl_xcvr_arc_mode_put(struct snd_kcontrol *kcontrol, struct fsl_xcvr *xcvr = snd_soc_dai_get_drvdata(dai); s...
e5785093b1b45af7ee57d18619b2854a8aed073a
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl_micfil: Fix event generation in micfil_quality_set()
Problem Details: ALSA controls should return 1 if the value in the control changed but the control put operation micfil_quality_set() only returns 0 or a negative error code, causing ALSA to not generate any change events. Add a suitable check in the function before updating the quality variable. Also enable pm runti...
```diff diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index 983805bbaae2..2e887f1f1f36 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -289,10 +289,34 @@ static int micfil_quality_set(struct snd_kcontrol *kcontrol, { struct snd_soc_component *cmpnt = snd_kcontrol_ch...
7d2bd35100de370dc326b250e8f6b66bee06a2f3
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl_micfil: Fix event generation in micfil_put_dc_remover_state()
Problem Details: ALSA controls should return 1 if the value in the control changed but the control put operation micfil_put_dc_remover_state() only returns 0 or a negative error code, causing ALSA to not generate any change events. return the value of snd_soc_component_update_bits() directly, as it has the capability ...
```diff diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index 0cfdd6343291..983805bbaae2 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -351,6 +351,10 @@ static int micfil_put_dc_remover_state(struct snd_kcontrol *kcontrol, if (val < 0 || val > 3) return -EINVAL; ...
fc4daaddb276d370b7da3819872044df446a1911
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl_micfil: Fix event generation in micfil_range_set()
Problem Details: ALSA controls should return 1 if the value in the control changed but the control put operation micfil_range_set() only returns 0 or a negative error code, causing ALSA to not generate any change events. Use snd_soc_component_update_bits() function to replace the regmap_update_bits(), for snd_soc_comp...
```diff diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index 1c826e0cb1d5..0cfdd6343291 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -210,15 +210,23 @@ static int micfil_range_set(struct snd_kcontrol *kcontrol, (struct soc_mixer_control *)kcontrol->private_value; ...
7e226209906906421f0d952d7304e48fdb0adabc
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl_micfil: Fix event generation in hwvad_put_init_mode()
Problem Details: ALSA controls should return 1 if the value in the control changed but the control put operation hwvad_put_init_mode() only returns 0 or a negative error code, causing ALSA to not generate any change events. Add a suitable check in the function before updating the vad_init_mode variable. Fixes: 29dbfe...
```diff diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index 97f24c9bdd68..1c826e0cb1d5 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -407,13 +407,18 @@ static int hwvad_put_init_mode(struct snd_kcontrol *kcontrol, unsigned int *item = ucontrol->value.enumerated.ite...
59b9061824f2179fe133e2636203548eaba3e528
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl_micfil: Fix event generation in hwvad_put_enable()
Problem Details: ALSA controls should return 1 if the value in the control changed but the control put operation hwvad_put_enable() only returns 0 or a negative error code, causing ALSA to not generate any change events. Add a suitable check in the function before updating the vad_enabled variable. Fixes: 29dbfeecab8...
```diff diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index 79850211742c..97f24c9bdd68 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -377,10 +377,15 @@ static int hwvad_put_enable(struct snd_kcontrol *kcontrol, unsigned int *item = ucontrol->value.enumerated.item; ...
c7661bfc7422443df394c01e069ae4e5c3a7f04c
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl_micfil: Add access property for "VAD Detected"
Problem Details: Add access property SNDRV_CTL_ELEM_ACCESS_READ for control "VAD Detected", which doesn't support put operation, otherwise there will be issue with mixer-test. Fixes: 29dbfeecab85 ("ASoC: fsl_micfil: Add Hardware Voice Activity Detector support") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Lin...
```diff diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index d6cde2757c6d..79850211742c 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -503,7 +503,13 @@ static const struct snd_kcontrol_new fsl_micfil_snd_controls[] = { SOC_SINGLE("HWVAD ZCD Adjustment", REG_MICFIL_V...
abe572f630bc1f0e77041012ab075869036ede4f
Analyze and fix the following issue in the Linux kernel code: spi: ch341: fix devres lifetime
Problem Details: USB drivers bind to USB interfaces and any device managed resources should have their lifetime tied to the interface rather than parent USB device. This avoids issues like memory leaks when drivers are unbound without their devices being physically disconnected (e.g. on probe deferral or configuration ...
```diff diff --git a/drivers/spi/spi-ch341.c b/drivers/spi/spi-ch341.c index ded093566260..3eaa8f176f63 100644 --- a/drivers/spi/spi-ch341.c +++ b/drivers/spi/spi-ch341.c @@ -152,7 +152,7 @@ static int ch341_probe(struct usb_interface *intf, if (ret) return ret; - ctrl = devm_spi_alloc_host(&udev->dev, sizeof(st...
b99e3ddb91b499d920e63a2daff8880be68cfe9e
Analyze and fix the following issue in the Linux kernel code: spi: ch341: fix memory leaks on probe failures
Problem Details: Make sure to deregister the controller, disable pins, and kill and free the RX URB on probe failures to mirror disconnect and avoid memory leaks and use-after-free. Also add an explicit URB kill on disconnect for symmetry (even if that is not strictly required as USB core would have stopped it in the ...
```diff diff --git a/drivers/spi/spi-ch341.c b/drivers/spi/spi-ch341.c index 79d2f9ab4ef0..ded093566260 100644 --- a/drivers/spi/spi-ch341.c +++ b/drivers/spi/spi-ch341.c @@ -173,17 +173,17 @@ static int ch341_probe(struct usb_interface *intf, ch341->tx_buf = devm_kzalloc(&udev->dev, CH341_PACKET_LENGTH, GFP_KER...
48478b9f791376b4b89018d7afdfd06865498f65
Analyze and fix the following issue in the Linux kernel code: arm64/mm: Enable batched TLB flush in unmap_hotplug_range()
Problem Details: During a memory hot remove operation, both linear and vmemmap mappings for the memory range being removed, get unmapped via unmap_hotplug_range() but mapped pages get freed only for vmemmap mapping. This is just a sequential operation where each table entry gets cleared, followed by a leaf specific TLB...
```diff diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index a6a00accf4f9..5dbf988120c8 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1458,10 +1458,14 @@ static void unmap_hotplug_pte_range(pmd_t *pmdp, unsigned long addr, WARN_ON(!pte_present(pte)); __pte_clear(&init_mm, addr, ptep); -...
c5283a1ffdd5a877120279d164e9d5761e8455af
Analyze and fix the following issue in the Linux kernel code: hrtimer: Fix incorrect #endif comment for BITS_PER_LONG check
Problem Details: The #endif comment says "BITS_PER_LONG >= 64", but the corresponding #if guard is "BITS_PER_LONG < 64". The comment was originally correct when the block had a three-way #if/#else/#endif structure, where the #else branch provided a 64-bit inline version. Commit 79bf2bb335b8 ("[PATCH] tick-management:...
```diff diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 2db171bae05c..000fb6ba7d74 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -355,7 +355,7 @@ s64 __ktime_divns(const ktime_t kt, s64 div) return dclc < 0 ? -tmp : tmp; } EXPORT_SYMBOL_GPL(__ktime_divns); -#endif /* BITS_PER_LO...
328335a79487ec38d6b0e1aa807785b0f75e594d
Analyze and fix the following issue in the Linux kernel code: powerpc/powernv/iommu: iommu incorrectly bypass DMA APIs
Problem Details: In a PowerNV environment, for devices that supports DMA mask less than 64 bit but larger than 32 bits, iommu is incorrectly bypassing DMA APIs while allocating and mapping buffers for DMA operations. Devices are failing with ENOMEN during probe with the following messages amdgpu 0000:01:00.0: [drm] D...
```diff diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c index 73e10bd4d56d..8b4de508d2eb 100644 --- a/arch/powerpc/kernel/dma-iommu.c +++ b/arch/powerpc/kernel/dma-iommu.c @@ -67,7 +67,7 @@ bool arch_dma_unmap_sg_direct(struct device *dev, struct scatterlist *sg, } bool arch_dma_alloc_d...
8ae2837d5a97644b729a889951127da98111a32d
Analyze and fix the following issue in the Linux kernel code: io_uring/zcrx: don't use mark0 for allocating xarray
Problem Details: XA_MARK_0 is not compatible with xarray allocating entries, use XA_MARK_1. Fixes: fda90d43f4fac ("io_uring/zcrx: return back two step unregistration") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://patch.msgid.link/f232cfd3c466047d333b474dd2bddd246b6ebb82.1774780198.git.asml.sile...
```diff diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index b8f15439d5df..5c0a49340722 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -929,12 +929,12 @@ ifq_free: static inline bool is_zcrx_entry_marked(struct io_ring_ctx *ctx, unsigned long id) { - return xa_get_mark(&ctx->zcrx_ctxs, id, XA_MARK_0); + retu...
77d8c8d0f1b76a005267ee9714ed98964c87ecc5
Analyze and fix the following issue in the Linux kernel code: io_uring: cast id to u64 before shifting in io_allocate_rbuf_ring()
Problem Details: Smatch warns: io_uring/zcrx.c:393 io_allocate_rbuf_ring() warn: should 'id << 16' be a 64 bit type? The expression 'id << IORING_OFF_PBUF_SHIFT' is evaluated using 32-bit arithmetic because id is a u32. This may overflow before being promoted to the 64-bit mmap_offset. Cast id to u64 before shifting ...
```diff diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index 1ce867c68446..b8f15439d5df 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -384,7 +384,7 @@ static int io_allocate_rbuf_ring(struct io_ring_ctx *ctx, return -EINVAL; mmap_offset = IORING_MAP_OFF_ZCRX_REGION; - mmap_offset += id << IORING_OFF_PBUF...
a9d008489f0c5304ca7f705348324e47824a7454
Analyze and fix the following issue in the Linux kernel code: io_uring/zcrx: reject REG_NODEV with large rx_buf_size
Problem Details: The copy fallback path doesn't care about the actual niov size and only uses first PAGE_SIZE bytes, and any additional space will be wasted. Since ZCRX_REG_NODEV solely relies on the copy path, it doesn't make sense to support non-standard rx_buf_len. Reject it for now, and re-enable once improved. Fi...
```diff diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index f94f74d0f566..1ce867c68446 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -449,6 +449,8 @@ static int io_zcrx_create_area(struct io_zcrx_ifq *ifq, return -EINVAL; buf_size_shift = ilog2(reg->rx_buf_len); } + if (!ifq->dev && buf_size_shift != ...
19a8cc6cda580a3726ab8f117e7c6de507376d9b
Analyze and fix the following issue in the Linux kernel code: io_uring/rsrc: use io_cache_free() to free node
Problem Details: Replace kfree(node) with io_cache_free() in io_buffer_register_bvec() to match all other error paths that free nodes allocated via io_rsrc_node_alloc(). The node is allocated through io_cache_alloc() internally, so it should be returned to the cache via io_cache_free() for proper object reuse. Signed-...
```diff diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index 52554ed89b11..2d8be5edbbf6 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -961,7 +961,7 @@ int io_buffer_register_bvec(struct io_uring_cmd *cmd, struct request *rq, */ imu = io_alloc_imu(ctx, blk_rq_nr_phys_segments(rq)); if (!imu) { - kfree(no...
825f2764919fca61a88ab2f93dfdfd1d22566264
Analyze and fix the following issue in the Linux kernel code: io_uring/zcrx: implement device-less mode for zcrx
Problem Details: Allow creating a zcrx instance without attaching it to a net device. All data will be copied through the fallback path. The user is also expected to use ZCRX_CTRL_FLUSH_RQ to handle overflows as it normally should even with a netdev, but it becomes even more relevant as there will likely be no one to a...
```diff diff --git a/include/uapi/linux/io_uring/zcrx.h b/include/uapi/linux/io_uring/zcrx.h index 3163a4b8aeb0..5ce02c7a6096 100644 --- a/include/uapi/linux/io_uring/zcrx.h +++ b/include/uapi/linux/io_uring/zcrx.h @@ -49,7 +49,14 @@ struct io_uring_zcrx_area_reg { }; enum zcrx_reg_flags { - ZCRX_REG_IMPORT = 1, + ...
1dff9ac2c85860af67a74777fa6d31c2ad07a15a
Analyze and fix the following issue in the Linux kernel code: tools/nolibc/printf: Support negative variable width and precision
Problem Details: For (eg) "%*.*s" treat a negative field width as a request to left align the output (the same as the '-' flag), and a negative precision to request the default precision. Set the default precision to -1 (not INT_MAX) and add explicit checks to the string handling for negative values (makes the tet uns...
```diff diff --git a/tools/include/nolibc/stdio.h b/tools/include/nolibc/stdio.h index 8f7e1948a651..b6d14a58cfe7 100644 --- a/tools/include/nolibc/stdio.h +++ b/tools/include/nolibc/stdio.h @@ -347,6 +347,7 @@ int __nolibc_printf(__nolibc_printf_cb cb, void *state, const char *fmt, va_list char *out; const char *o...
896070686b16cc45cca7854be2049923b2b303d3
Analyze and fix the following issue in the Linux kernel code: drm/xe/vm: Add missing pad and extensions check
Problem Details: Add missing pad and extensions check to xe_vm_get_property_ioctl v2: - Combine with other check (Auld) Fixes: 50c577eab051 ("drm/xe/xe_vm: Implement xe_vm_get_property_ioctl") Suggested-by: Matthew Auld <matthew.auld@intel.com> Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com> Reviewed-by: M...
```diff diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index 72559bd33946..2408b547ca3d 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -4156,7 +4156,8 @@ int xe_vm_get_property_ioctl(struct drm_device *drm, void *data, int ret = 0; if (XE_IOCTL_DBG(xe, (args->res...
f8dc1bde187310e0345beb08df949e0c2a4c86ce
Analyze and fix the following issue in the Linux kernel code: dax/hmem: Fix singleton confusion between dax_hmem_work and hmem devices
Problem Details: dax_hmem (ab)uses a platform device to allow for a module to autoload in the presence of "Soft Reserved" resources. The dax_hmem driver had no dependencies on the "hmem_platform" device being a singleton until the recent "dax_hmem vs dax_cxl" takeover solution. Replace the layering violation of dax_hm...
```diff diff --git a/drivers/dax/bus.h b/drivers/dax/bus.h index ebbfe2d6da14..7b1a83f1ce1f 100644 --- a/drivers/dax/bus.h +++ b/drivers/dax/bus.h @@ -3,7 +3,9 @@ #ifndef __DAX_BUS_H__ #define __DAX_BUS_H__ #include <linux/device.h> +#include <linux/platform_device.h> #include <linux/range.h> +#include <linux/workq...
1eaef15b2349087d9ce583b9153970d5cf5c5329
Analyze and fix the following issue in the Linux kernel code: dax/cxl: Fix HMEM dependencies
Problem Details: The expectation is that DEV_DAX_HMEM=y should be disallowed if any of CXL_ACPI, or CXL_PCI are set =m. Also DEV_DAX_CXL=y should be disallowed if DEV_DAX_HMEM=m. Use "$config || !$config" syntax for each dependency. Otherwise, the invalid DEV_DAX_HMEM=m && DEV_DAX_CXL=y configuration is allowed. Lastl...
```diff diff --git a/drivers/dax/Kconfig b/drivers/dax/Kconfig index 3683bb3f2311..504f7f735ef5 100644 --- a/drivers/dax/Kconfig +++ b/drivers/dax/Kconfig @@ -32,6 +32,9 @@ config DEV_DAX_HMEM depends on EFI_SOFT_RESERVE select NUMA_KEEP_MEMINFO if NUMA_MEMBLKS default DEV_DAX + depends on CXL_ACPI || !CXL_ACPI +...
87805c32e6ad7b5ce2d9f7f47e76081857a4a335
Analyze and fix the following issue in the Linux kernel code: cxl/region: Fix use-after-free from auto assembly failure
Problem Details: The following crash signature results from region destruction while an endpoint decoder is staged, but not fully attached. [ dj: Moved bus_find_device( to next line. ] Signed-off-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Alison Schofield <al...
```diff diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index f7b20f60ac5c..b89442931277 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -1064,6 +1064,14 @@ static int cxl_rr_ep_add(struct cxl_region_ref *cxl_rr, if (!cxld->region) { cxld->region = cxlr; + + /* + *...
502455d8bef2f8502540102218c47fc12da2a04e
Analyze and fix the following issue in the Linux kernel code: drm/msm/dpu: eliza: Use Eliza-specific CWB array
Problem Details: The driver references CWB array from SM8650, but should use the Eliza specific, which has different register space sizes. This should not have noticeable impact on function but is indeed confusing, since the Eliza table is used for .cwb_count. Fixes: 0eb707bbc7fc ("drm/msm/dpu: Add support for Eliza ...
```diff diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_12_4_eliza.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_12_4_eliza.h index b482a7e4e6c0..b93d32888972 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_12_4_eliza.h +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_12_4_eliza.h @@ -353,7 +353,7 @@ const...
7090420420d5a7d7c88b21d16962f2a230be3ef3
Analyze and fix the following issue in the Linux kernel code: drm/msm/dpu: drop INTF_0 on MSM8953
Problem Details: There is no INTF_0 on MSM8953. Currently catalog lists dummy INTF_NONE entry for it. Drop it from the catalog. Fixes: 7a6109ce1c2c ("drm/msm/dpu: Add support for MSM8953") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Pa...
```diff diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_1_16_msm8953.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_1_16_msm8953.h index e8aabe43c9ff..859a97e8c07e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_1_16_msm8953.h +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_1_16_msm8953.h @@ -121,13 +121,6...
469df8c2b571bb243d0da30424686aac14a8f068
Analyze and fix the following issue in the Linux kernel code: drm/msm/dpu: correct DP MST interface configuration
Problem Details: Due to historical reasons we ended up with dummy values being specified for MST-related interfaces some of them had INTF_NONE, others had non-existing DP controller indices. Those workarounds are no longer necessary. Fix types and indices for all DP-MST related INTF instances. The only exception is IN...
```diff diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_10_0_sm8650.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_10_0_sm8650.h index db79f9382f8b..2eef5f69832f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_10_0_sm8650.h +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_10_0_sm8650.h @@ -377,7 +377,7 @@ s...
cffff6df669a438ecac506dadd49a53d4475a796
Analyze and fix the following issue in the Linux kernel code: hwmon: (asus-ec-sensors) Fix T_Sensor for PRIME X670E-PRO WIFI
Problem Details: On the Asus PRIME X670E-PRO WIFI, the driver reports a constant value of zero for T_Sensor. On this board, the register for T_Sensor is at a different address, as found by experimentation and confirmed by comparison to an independent temperature reading. * sensor disconnected: -62.0°C * ambient temper...
```diff diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c index 86f444498650..adedaf0db10e 100644 --- a/drivers/hwmon/asus-ec-sensors.c +++ b/drivers/hwmon/asus-ec-sensors.c @@ -111,6 +111,8 @@ enum ec_sensors { ec_sensor_temp_mb, /* "T_Sensor" temperature sensor reading [℃] */ ec_sen...
f4626281c6bb563ef5ad9d3a59a1449b45a3dc30
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Don't advertises GICv3 in ID_PFR1_EL1 if AArch32 isn't supported
Problem Details: Although the AArch32 ID regs are architecturally UNKNOWN when AArch32 isn't supported at any EL, KVM makes a point in making them RAZ. Therefore, advertising GICv3 in ID_PFR1_EL1 must be gated on AArch32 being supported at least at EL0. Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com> Fixes: a2...
```diff diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c index 2859dad46a93..933983bb2005 100644 --- a/arch/arm64/kvm/vgic/vgic-init.c +++ b/arch/arm64/kvm/vgic/vgic-init.c @@ -700,7 +700,8 @@ void kvm_vgic_finalize_idregs(struct kvm *kvm) break; case KVM_DEV_TYPE_ARM_VGIC_V3: aa64...
be46a408f376df31762e8a9914dc6d082755e686
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Correctly plumb ID_AA64PFR2_EL1 into pkvm idreg handling
Problem Details: While we now compute ID_AA64PFR2_EL1 to a glorious 0, we never use that data and instead return the 0 that corresponds to an allocated idreg. Not a big deal, but we might as well be consistent. Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com> Fixes: 5aefaf11f9af5 ("KVM: arm64: gic: Hide GICv5 fo...
```diff diff --git a/arch/arm64/kvm/hyp/nvhe/sys_regs.c b/arch/arm64/kvm/hyp/nvhe/sys_regs.c index b40fd01ebf32..be6f420388a1 100644 --- a/arch/arm64/kvm/hyp/nvhe/sys_regs.c +++ b/arch/arm64/kvm/hyp/nvhe/sys_regs.c @@ -439,7 +439,7 @@ static const struct sys_reg_desc pvm_sys_reg_descs[] = { /* CRm=4 */ AARCH64(SYS_...
06c85b58e0b13e67f4e56cbba346201bfe95ad00
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Move GICv5 timer PPI validation into timer_irqs_are_valid()
Problem Details: Userspace can set the timer PPI numbers way before a GIC has been created, leading to odd behaviours on GICv5 as we'd accept non architectural PPI numbers. Move the v5 check into timer_irqs_are_valid(), which aligns the behaviour with the pre-v5 GICs, and is also guaranteed to run only once a GIC has ...
```diff diff --git a/arch/arm64/kvm/arch_timer.c b/arch/arm64/kvm/arch_timer.c index 6608c47d1f62..cbea4d9ee955 100644 --- a/arch/arm64/kvm/arch_timer.c +++ b/arch/arm64/kvm/arch_timer.c @@ -1543,6 +1543,10 @@ static bool timer_irqs_are_valid(struct kvm_vcpu *vcpu) if (kvm_vgic_set_owner(vcpu, irq, ctx)) break; ...
fbcbf259d97d340376a176de20bdc04687356949
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Remove evaluation of timer state in kvm_cpu_has_pending_timer()
Problem Details: The vgic-v5 code added some evaluations of the timers in a helper funtion (kvm_cpu_has_pending_timer()) that is called to determine whether the vcpu can wake-up. But looking at the timer there is wrong: - we want to see timers that are signalling an interrupt to the vcpu, and not just that have a p...
```diff diff --git a/arch/arm64/kvm/arch_timer.c b/arch/arm64/kvm/arch_timer.c index 37279f874869..6608c47d1f62 100644 --- a/arch/arm64/kvm/arch_timer.c +++ b/arch/arm64/kvm/arch_timer.c @@ -402,11 +402,7 @@ static bool kvm_timer_should_fire(struct arch_timer_context *timer_ctx) int kvm_cpu_has_pending_timer(struct ...
8fe30434a81d36715ab83fdb4a5e6c967d2e3ecf
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Kill arch_timer_context::direct field
Problem Details: The newly introduced arch_timer_context::direct field is a bit pointless, as it is always set on timers that are... err... direct, while we already have a way to get to that by doing a get_map() operation. Additionally, this field is: - only set when get_map() is called - never cleared and the sing...
```diff diff --git a/arch/arm64/kvm/arch_timer.c b/arch/arm64/kvm/arch_timer.c index 67b989671b41..37279f874869 100644 --- a/arch/arm64/kvm/arch_timer.c +++ b/arch/arm64/kvm/arch_timer.c @@ -183,10 +183,6 @@ void get_timer_map(struct kvm_vcpu *vcpu, struct timer_map *map) map->emul_ptimer = vcpu_ptimer(vcpu); } ...
848fa8373a53b0e5d871560743e13278da56fabc
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: vgic-v5: Correctly set dist->ready once initialised
Problem Details: kvm_vgic_map_resources() targetting a v5 model results in vgic->dist_ready never being set. This doesn't result in anything really bad, only some more heavy locking as we go and re-init something for no good reason. Rejig the code to correctly set the ready flag in all non-failing cases. Reviewed-by:...
```diff diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c index 34460179fb8a..2859dad46a93 100644 --- a/arch/arm64/kvm/vgic/vgic-init.c +++ b/arch/arm64/kvm/vgic/vgic-init.c @@ -657,16 +657,20 @@ int kvm_vgic_map_resources(struct kvm *kvm) needs_dist = false; } - if (ret || !needs_di...
a4a645584793dbbb4e5a1a876800654a8883326e
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: vgic-v5: Make the effective priority mask a strict limit
Problem Details: The way the effective priority mask is compared to the priority of an interrupt to decide whether to wake-up or not, is slightly odd, and breaks at the limits. This could result in spurious wake-ups that are undesirable. Make the computed priority mask comparison a strict inequality, so that interrup...
```diff diff --git a/arch/arm64/kvm/vgic/vgic-v5.c b/arch/arm64/kvm/vgic/vgic-v5.c index 0f269321ece4..31040cfb61fc 100644 --- a/arch/arm64/kvm/vgic/vgic-v5.c +++ b/arch/arm64/kvm/vgic/vgic-v5.c @@ -367,7 +367,7 @@ bool vgic_v5_has_pending_ppi(struct kvm_vcpu *vcpu) scoped_guard(raw_spinlock_irqsave, &irq->irq_loc...
42d7eac8291d2724b3897141ab2f226c69b7923e
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: vgic-v5: Cast vgic_apr to u32 to avoid undefined behaviours
Problem Details: Passing a u64 to __builtin_ctz() is odd, and requires some digging to figure out why this construct is indeed safe as long as the HW is correct. But it is much easier to make it clear to the compiler by casting the u64 into an intermediate u32, and be done with the UD. Reviewed-by: Sascha Bischoff <s...
```diff diff --git a/arch/arm64/kvm/vgic/vgic-v5.c b/arch/arm64/kvm/vgic/vgic-v5.c index 422741c86c6a..0f269321ece4 100644 --- a/arch/arm64/kvm/vgic/vgic-v5.c +++ b/arch/arm64/kvm/vgic/vgic-v5.c @@ -212,7 +212,7 @@ int vgic_v5_finalize_ppi_state(struct kvm *kvm) static u32 vgic_v5_get_effective_priority_mask(struct kv...
170a77b4185a87cc7e02e404d22b9bf3f9923884
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: vgic-v5: Transfer edge pending state to ICH_PPI_PENDRx_EL2
Problem Details: While it is perfectly correct to leave the pending state of a level interrupt as is when queuing it (it is, after all, only driven by the line), edge pending state must be transfered, as nothing will lower it. Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com> Fixes: 4d591252bacb2 ("KVM: arm64: gi...
```diff diff --git a/arch/arm64/kvm/vgic/vgic-v5.c b/arch/arm64/kvm/vgic/vgic-v5.c index 119d7d01d0e7..422741c86c6a 100644 --- a/arch/arm64/kvm/vgic/vgic-v5.c +++ b/arch/arm64/kvm/vgic/vgic-v5.c @@ -445,8 +445,11 @@ void vgic_v5_flush_ppi_state(struct kvm_vcpu *vcpu) irq = vgic_get_vcpu_irq(vcpu, intid); - scop...
e63d0a32e7368f3eb935755db87add1bf000ea90
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: vgic-v5: Hold config_lock while finalizing GICv5 PPIs
Problem Details: Finalizing the PPI state is done without holding any lock, which means that two vcpus can race against each other and have one zeroing the state while another one is setting it, or even maybe using it. Fixing this is done by: - holding the config lock while performing the initialisation - checking i...
```diff diff --git a/arch/arm64/kvm/vgic/vgic-v5.c b/arch/arm64/kvm/vgic/vgic-v5.c index 2b6cd5c3f9c2..119d7d01d0e7 100644 --- a/arch/arm64/kvm/vgic/vgic-v5.c +++ b/arch/arm64/kvm/vgic/vgic-v5.c @@ -172,6 +172,16 @@ int vgic_v5_finalize_ppi_state(struct kvm *kvm) if (!vgic_is_v5(kvm)) return 0; + guard(mutex)(&k...
d70d4323dd9636e35696639f6b4c2b2735291516
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Account for RESx bits in __compute_fgt()
Problem Details: When computing Fine Grained Traps, it is preferable to account for the reserved bits. The HW will most probably ignore them, unless the bits have been repurposed to do something else. Use caution, and fold our view of the reserved bits in, Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com> Fixes:...
```diff diff --git a/arch/arm64/kvm/config.c b/arch/arm64/kvm/config.c index e14685343191..f35b8dddd7c1 100644 --- a/arch/arm64/kvm/config.c +++ b/arch/arm64/kvm/config.c @@ -1663,8 +1663,8 @@ static __always_inline void __compute_fgt(struct kvm_vcpu *vcpu, enum vcpu_sysre clear |= ~nested & m->nmask; } - val |=...
76efe94b1c5cc9b5fac7c5c1096d03f1596c7267
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Fix writeable mask for ID_AA64PFR2_EL1
Problem Details: The writeable mask for fields in ID_AA64PFR2_EL1 has been accidentally inverted, which isn't a very good idea. Restore the expected polarity. Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com> Fixes: a258a383b9177 ("KVM: arm64: gic-v5: Sanitize ID_AA64PFR2_EL1.GCIE") Link: https://sashiko.dev/#/p...
```diff diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index 18e2d2fccedb..6a96cb7ba9a3 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -3304,10 +3304,10 @@ static const struct sys_reg_desc sys_reg_descs[] = { ID_AA64PFR1_EL1_MPAM_frac | ID_AA64PFR1_...
77acae60be60adddf33e4c7e9cf73291f64fb9e8
Analyze and fix the following issue in the Linux kernel code: arm64: Fix field references for ICH_PPI_DVIR[01]_EL2
Problem Details: The ICH_PPI_DVIR[01]_EL2 registers should refer to the ICH_PPI_DVIRx_EL2 fields, instead of ICH_PPI_DVIx_EL2. Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com> Fixes: 2808a8337078f ("arm64/sysreg: Add remaining GICv5 ICC_ & ICH_ sysregs for KVM support") Link: https://sashiko.dev/#/patchset/20260...
```diff diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg index 51dcca5b2fa6..3b57cb692c5b 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -4888,11 +4888,11 @@ Field 0 DVI0 EndSysregFields Sysreg ICH_PPI_DVIR0_EL2 3 4 12 10 0 -Fields ICH_PPI_DVIx_EL2 +Fields ICH_PPI_DVIRx_EL2 End...
d82d09d5ba4be0b5eb053b2ba2bc0e82c49cf2c8
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Don't skip per-vcpu NV initialisation
Problem Details: Some GICv5-related rework have resulted in the NV sanitisation of registers being skipped for secondary vcpus, which is a pretty bad idea. Hoist the NV init early so that it is always executed. Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com> Fixes: cbd8c958be54a ("KVM: arm64: Return early from...
```diff diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index e1001544d4f4..18e2d2fccedb 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -5772,6 +5772,12 @@ int kvm_finalize_sys_regs(struct kvm_vcpu *vcpu) guard(mutex)(&kvm->arch.config_lock); + if (vcpu_has_nv(vcpu)) ...
ecc7f02499544ae879716be837af78260a6a10f7
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: vgic: Don't reset cpuif/redist addresses at finalize time
Problem Details: Although we are OK with rewriting idregs at finalize time, resetting the guest's cpuif (GICv3) or redistributor (GICv3) addresses once we start running the guest is a pretty bad idea. Move back this initialisation to vgic creation time. Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com> Fixes: a2...
```diff diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c index 47169604100f..34460179fb8a 100644 --- a/arch/arm64/kvm/vgic/vgic-init.c +++ b/arch/arm64/kvm/vgic/vgic-init.c @@ -147,6 +147,15 @@ int kvm_vgic_create(struct kvm *kvm, u32 type) kvm->arch.vgic.implementation_rev = KVM_VGIC_IM...
eb8fa32085261a07d763e9d616b3c206d0be82ff
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sdm845-lg: Add wifi nodes
Problem Details: Wi-Fi now works with this patch, relevant firmware and qcom,snoc-host-cap-skip-quirk qcom,snoc-host-cap-skip-quirk has not been approved/merged in mainline, so it is not included here. ath10k_snoc 18800000.wifi: qmi chip_id 0x30214 chip_family 0x4001 board_id 0xff soc_id 0x40030001 ath10k_snoc 188000...
```diff diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi index 552d9719bede..8481f0cce974 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi @@ -670,3 +670,13 @@ &venus { status = "okay"; }; + +...
e746ed5af3084e9534135679c55e69eced0c657f
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sdm845-lg: Add uarts and Bluetooth
Problem Details: uart9 is debug serial on USB SBU1/2 UART RX is SBU1 and UART TX is SBU2 of the USB-C port). 1.8V Logic Level Tested using pololu usb07a https://www.pololu.com/product/2585 and CH340 USB-UART uart6 is bluetooth Bluetooth: hci0: setting up wcn399x Bluetooth: hci0: QCA Product ID :0x0000000a Bluetoot...
```diff diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi index 8b7a271b7568..27221b3afb30 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi @@ -27,10 +27,17 @@ /delete-node/ &wlan_msa_mem; / { ...
b9afe8581c0e14b7b56e2314dc7f9597bf23ef67
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sdm845-lg-judyln: Add firmware nodes, change path
Problem Details: Add paths for Qualcomm firmware, including: ipa, modem, venus, gpu GPU and bluetooth are confirmed working, others may need more testing/fixes But regardless they will need the firmware paths specified here and firmware added upstream before they will work, so might as well get started on it now. Si...
```diff diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-judyln.dts b/arch/arm64/boot/dts/qcom/sdm845-lg-judyln.dts index 09bfcef42402..6d6cc197176c 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-lg-judyln.dts +++ b/arch/arm64/boot/dts/qcom/sdm845-lg-judyln.dts @@ -40,19 +40,23 @@ }; &adsp_pas { - firmware-name = "qco...
aa35dd6bdd033dea8aa3e20cbbbe10e06b2d044f
Analyze and fix the following issue in the Linux kernel code: io_uring/bpf_filters: retain COW'ed settings on parse failures
Problem Details: If io_parse_restrictions() fails, it ends up clearing any restrictions currently set. The intent is only to clear whatever it already applied, but it ends up clearing everything, including whatever settings may have been applied in a copy-on-write fashion already. Ensure that those are retained. Link:...
```diff diff --git a/io_uring/register.c b/io_uring/register.c index 5f3eb018fb32..837324bf0223 100644 --- a/io_uring/register.c +++ b/io_uring/register.c @@ -178,9 +178,17 @@ static __cold int io_register_restrictions(struct io_ring_ctx *ctx, return -EBUSY; ret = io_parse_restrictions(arg, nr_args, &ctx->restri...
61a11cf4812726aceaee17c96432e1c08f6ed6cb
Analyze and fix the following issue in the Linux kernel code: io_uring: protect remaining lockless ctx->rings accesses with RCU
Problem Details: Commit 96189080265e addressed one case of ctx->rings being potentially accessed while a resize is happening on the ring, but there are still a few others that need handling. Add a helper for retrieving the rings associated with an io_uring context, and add some sanity checking to that to catch bad uses...
```diff diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 20ec8fdafcae..48f2f627319d 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2015,7 +2015,7 @@ int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr) if (ctx->flags & IORING_SETUP_SQ_REWIND) entries = ctx->sq_entries; else - ...
6dcf9d0064ce2f3e3dfe5755f98b93abe6a98e1e
Analyze and fix the following issue in the Linux kernel code: cpufreq: governor: fix double free in cpufreq_dbs_governor_init() error path
Problem Details: When kobject_init_and_add() fails, cpufreq_dbs_governor_init() calls kobject_put(&dbs_data->attr_set.kobj). The kobject release callback cpufreq_dbs_data_release() calls gov->exit(dbs_data) and kfree(dbs_data), but the current error path then calls gov->exit(dbs_data) and kfree(dbs_data) again, causin...
```diff diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index acf101878733..86f35e451914 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -468,13 +468,13 @@ int cpufreq_dbs_governor_init(struct cpufreq_policy *policy) /* Failure, so roll ...
9266b4da051a410d9e6c5c0b0ef0c877855aa1b8
Analyze and fix the following issue in the Linux kernel code: cpufreq: Allocate QoS freq_req objects with policy
Problem Details: A recent change exposed a bug in the error path: if freq_qos_add_request(boost_freq_req) fails, min_freq_req may remain a valid pointer even though it was never successfully added. During policy teardown, this leads to an unconditional call to freq_qos_remove_request(), triggering a WARN. The current ...
```diff diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index c0aa970c7a67..f4a949f1e48f 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -614,7 +614,7 @@ static int policy_set_boost(struct cpufreq_policy *policy, bool enable) return ret; } - ret = freq_qos_update_requ...
e74c38ef6f170179c0029b5744d6a14dfd543108
Analyze and fix the following issue in the Linux kernel code: ASoC: amd: ps: Fix missing leading zeros in subsystem_device SSID log
Problem Details: Ensure that subsystem_device is printed with leading zeros when combined with subsystem_vendor to form the SSID. Without this, devices with upper bits unset may appear to have an incorrect SSID in the debug output. Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Link: https://patch.msgid.l...
```diff diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index 3a20cc10d61f..9751cf0784a6 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -339,7 +339,7 @@ static struct snd_soc_acpi_mach *acp63_sdw_machine_select(struct device *dev) mach->mach_params.subsystem_device = ac...
5a77906982df26975aa26caefb81b7d6f53d9b3f
Analyze and fix the following issue in the Linux kernel code: ASoC: soc.h: remove snd_soc_of_parse_audio_prefix()
Problem Details: No one is using snd_soc_of_parse_audio_prefix(). Remove it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/877bqrttvp.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
```diff diff --git a/include/sound/soc.h b/include/sound/soc.h index d66164fd83e5..f70edd9c23b2 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1337,15 +1337,6 @@ void snd_soc_of_parse_node_prefix(struct device_node *np, struct snd_soc_codec_conf *codec_conf, struct device_node *of_node, ...
1877d3f258cbb57d64e275754fb9b18b089ce72d
Analyze and fix the following issue in the Linux kernel code: PM: domains: De-constify fields in struct dev_pm_domain_attach_data
Problem Details: It doesn't really make sense to keep u32 fields to be marked as const. Having the const fields prevents their modification in the driver. Instead the whole struct can be defined as const, if it is constant. Fixes: 161e16a5e50a ("PM: domains: Add helper functions to attach/detach multiple PM domains") ...
```diff diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 93ba0143ca47..38d1814ab8a5 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -49,8 +49,8 @@ struct dev_pm_domain_attach_data { const char * const *pd_names; - const u32 num_pd_names; - const u32 pd_flags; + u32...
8d2cacb20eb1bc613839a3c0e375835c83fb629f
Analyze and fix the following issue in the Linux kernel code: pmdomain: rockchip: quiet regulator error on -EPROBE_DEFER
Problem Details: Change the dev_err() to dev_err_probe() under rockchip_pd_power_on() to prevent errors early in the boot process when the requested regulator is not yet available. This converts errors like the following to debug messages: rockchip-pm-domain fd8d8000.power-management:power-controller: Failed to enable...
```diff diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rockchip/pm-domains.c index 44d34840ede7..490bbb1d1d8e 100644 --- a/drivers/pmdomain/rockchip/pm-domains.c +++ b/drivers/pmdomain/rockchip/pm-domains.c @@ -705,10 +705,9 @@ static int rockchip_pd_power_on(struct generic_pm_domain *domain) ...
c8e9b6a55702be6c6d034e973d519c52c3848415
Analyze and fix the following issue in the Linux kernel code: pmdomain: imx: scu-pd: Fix device_node reference leak during ->probe()
Problem Details: When calling of_parse_phandle_with_args(), the caller is responsible to call of_node_put() to release the reference of device node. In imx_sc_pd_get_console_rsrc(), it does not release the reference. Fixes: 893cfb99734f ("firmware: imx: scu-pd: do not power off console domain") Signed-off-by: Felix Gu...
```diff diff --git a/drivers/pmdomain/imx/scu-pd.c b/drivers/pmdomain/imx/scu-pd.c index 01d465d88f60..3ec33667a308 100644 --- a/drivers/pmdomain/imx/scu-pd.c +++ b/drivers/pmdomain/imx/scu-pd.c @@ -326,6 +326,7 @@ static void imx_sc_pd_get_console_rsrc(void) return; imx_con_rsrc = specs.args[0]; + of_node_put(s...
44c28e1c52764fef6dd1c1ada3a248728812e67f
Analyze and fix the following issue in the Linux kernel code: pmdomain: ti: omap_prm: Fix a reference leak on device node
Problem Details: When calling of_parse_phandle_with_args(), the caller is responsible to call of_node_put() to release the reference of device node. In omap_prm_domain_attach_dev, it does not release the reference. Fixes: 58cbff023bfa ("soc: ti: omap-prm: Add basic power domain support") Signed-off-by: Felix Gu <gu_02...
```diff diff --git a/drivers/pmdomain/ti/omap_prm.c b/drivers/pmdomain/ti/omap_prm.c index 5142f064bf5c..64a187f79a1a 100644 --- a/drivers/pmdomain/ti/omap_prm.c +++ b/drivers/pmdomain/ti/omap_prm.c @@ -655,6 +655,7 @@ static int omap_prm_domain_attach_dev(struct generic_pm_domain *domain, if (pd_args.args_count != 0...
e91d5f94acf68618ea3ad9c92ac28614e791ae7d
Analyze and fix the following issue in the Linux kernel code: pmdomain: imx8mp-blk-ctrl: Keep the NOC_HDCP clock enabled
Problem Details: Keep the NOC_HDCP clock always enabled to fix the potential hang caused by the NoC ADB400 port power down handshake. Fixes: 77b0ddb42add ("soc: imx: add i.MX8MP HDMI blk ctrl HDCP/HRV_MWR") Signed-off-by: Jacky Bai <ping.bai@nxp.com> Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson <ulf.hansson@l...
```diff diff --git a/drivers/pmdomain/imx/imx8mp-blk-ctrl.c b/drivers/pmdomain/imx/imx8mp-blk-ctrl.c index 8fc79f9723f0..3f5b9499d30a 100644 --- a/drivers/pmdomain/imx/imx8mp-blk-ctrl.c +++ b/drivers/pmdomain/imx/imx8mp-blk-ctrl.c @@ -352,9 +352,6 @@ static void imx8mp_hdmi_blk_ctrl_power_on(struct imx8mp_blk_ctrl *bc,...
88c4bd90725557796c15878b7cb70066e9e6b5ab
Analyze and fix the following issue in the Linux kernel code: firmware: thead: Fix buffer overflow and use standard endian macros
Problem Details: Addresses two issues in the TH1520 AON firmware protocol driver: 1. Fix a potential buffer overflow where the code used unsafe pointer arithmetic to access the 'mode' field through the 'resource' pointer with an offset. This was flagged by Smatch static checker as: "buffer overflow 'data' 2 <...
```diff diff --git a/drivers/firmware/thead,th1520-aon.c b/drivers/firmware/thead,th1520-aon.c index a35fd5e2a07f..d7f19b5b5f46 100644 --- a/drivers/firmware/thead,th1520-aon.c +++ b/drivers/firmware/thead,th1520-aon.c @@ -170,10 +170,9 @@ int th1520_aon_power_update(struct th1520_aon_chan *aon_chan, u16 rsrc, hdr->f...
e3007a92332d15b085c5d1157ffeea26f03f0aa6
Analyze and fix the following issue in the Linux kernel code: rust_binder: remove "rust_" prefix from tracepoints
Problem Details: Remove the "rust_" prefix as the name is part of the uapi, and userspace expects tracepoints to have the old names. Link: https://github.com/Rust-for-Linux/linux/issues/1226 Suggested-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Mohamad Alsadhan <...
```diff diff --git a/drivers/android/binder/rust_binder_events.h b/drivers/android/binder/rust_binder_events.h index 8ad785c6bd0f..e3adfb93170d 100644 --- a/drivers/android/binder/rust_binder_events.h +++ b/drivers/android/binder/rust_binder_events.h @@ -15,7 +15,7 @@ #include <linux/tracepoint.h> -TRACE_EVENT(rus...
f698a253e3936ed516aa234495861eb707d608b9
Analyze and fix the following issue in the Linux kernel code: rust_binder: drop startup init log message
Problem Details: The "Loaded Rust Binder." message is logged during normal initialization and does not indicate an error/warning condition. Logging it creates unnecessary noise and is inconsistent with other drivers, so this change fixes that Signed-off-by: Pedro Montes Alcalde <pedro.montes.alcalde@gmail.com> Acked-...
```diff diff --git a/drivers/android/binder/rust_binder_main.rs b/drivers/android/binder/rust_binder_main.rs index aa5f2a75adb4..dccb7ba3ffc0 100644 --- a/drivers/android/binder/rust_binder_main.rs +++ b/drivers/android/binder/rust_binder_main.rs @@ -292,8 +292,6 @@ impl kernel::Module for BinderModule { // SA...
aff12041b4b2f4f2c164a0cf1b9688408515d036
Analyze and fix the following issue in the Linux kernel code: fuse: fix inode initialization race
Problem Details: Fix a race between fuse_iget() and fuse_reverse_inval_inode() where invalidation can arrive while an inode is being initialized, causing the invalidation to be lost. By keeping the inode state I_NEW as long as the attributes are not valid the invalidation can wait until the inode is fully initialized. ...
```diff diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 84f78fb89d35..8b64034ab0bb 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -470,6 +470,7 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid, struct inode *inode; struct fuse_inode *fi; struct fuse_conn *fc = get_fuse_conn_super(sb); + b...
da107398cbd4bbdb6bffecb2ce86d5c9384f4cec
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_tables: reject immediate NF_QUEUE verdict
Problem Details: nft_queue is always used from userspace nftables to deliver the NF_QUEUE verdict. Immediately emitting an NF_QUEUE verdict is never used by the userspace nft tools, so reject immediate NF_QUEUE verdicts. The arp family does not provide queue support, but such an immediate verdict is still reachable. G...
```diff diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 3922cff1bb3d..8c42247a176c 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -11667,8 +11667,6 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data, switch (data->verdict...
3d5d488f11776738deab9da336038add95d342d1
Analyze and fix the following issue in the Linux kernel code: netfilter: x_tables: restrict xt_check_match/xt_check_target extensions for NFPROTO_ARP
Problem Details: Weiming Shi says: xt_match and xt_target structs registered with NFPROTO_UNSPEC can be loaded by any protocol family through nft_compat. When such a match/target sets .hooks to restrict which hooks it may run on, the bitmask uses NF_INET_* constants. This is only correct for families whose hook layout...
```diff diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index e594b3b7ad82..b39017c80548 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c @@ -501,6 +501,17 @@ int xt_check_match(struct xt_mtchk_param *par, par->match->table, par->table); return -EINVAL; } + + /* NFPROT...
9862ef9ab0a116c6dca98842aab7de13a252ae02
Analyze and fix the following issue in the Linux kernel code: netfilter: ipset: drop logically empty buckets in mtype_del
Problem Details: mtype_del() counts empty slots below n->pos in k, but it only drops the bucket when both n->pos and k are zero. This misses buckets whose live entries have all been removed while n->pos still points past deleted slots. Treat a bucket as empty when all positions below n->pos are unused and release it d...
```diff diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h index 181daa9c2019..b79e5dd2af03 100644 --- a/net/netfilter/ipset/ip_set_hash_gen.h +++ b/net/netfilter/ipset/ip_set_hash_gen.h @@ -1098,7 +1098,7 @@ mtype_del(struct ip_set *set, void *value, const struct ip_set_ext *ext...
917b61fa2042f11e2af4c428e43f08199586633a
Analyze and fix the following issue in the Linux kernel code: netfilter: ctnetlink: ignore explicit helper on new expectations
Problem Details: Use the existing master conntrack helper, anything else is not really supported and it just makes validation more complicated, so just ignore what helper userspace suggests for this expectation. This was uncovered when validating CTA_EXPECT_CLASS via different helper provided by userspace than the exi...
```diff diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 38bd7124d9f7..a20cd82446c5 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -2636,7 +2636,6 @@ static const struct nla_policy exp_nla_policy[CTA_EXPECT_MAX+1] = { stat...
35177c6877134a21315f37d57a5577846225623e
Analyze and fix the following issue in the Linux kernel code: netfilter: ctnetlink: zero expect NAT fields when CTA_EXPECT_NAT absent
Problem Details: ctnetlink_alloc_expect() allocates expectations from a non-zeroing slab cache via nf_ct_expect_alloc(). When CTA_EXPECT_NAT is not present in the netlink message, saved_addr and saved_proto are never initialized. Stale data from a previous slab occupant can then be dumped to userspace by ctnetlink_ex...
```diff diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 3f408f3713bb..38bd7124d9f7 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -3588,6 +3588,12 @@ ctnetlink_alloc_expect(const struct nlattr * const cda[], struct nf_conn *...
a242a9ae58aa46ff7dae51ce64150a93957abe65
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_conntrack_helper: pass helper to expect cleanup
Problem Details: nf_conntrack_helper_unregister() calls nf_ct_expect_iterate_destroy() to remove expectations belonging to the helper being unregistered. However, it passes NULL instead of the helper pointer as the data argument, so expect_iter_me() never matches any expectation and all of them survive the cleanup. Af...
```diff diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c index 1b330ba6613b..a715304a53d8 100644 --- a/net/netfilter/nf_conntrack_helper.c +++ b/net/netfilter/nf_conntrack_helper.c @@ -415,7 +415,7 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me) */ synch...
b7e8590987aa94c9dc51518fad0e58cb887b1db5
Analyze and fix the following issue in the Linux kernel code: netfilter: ipset: use nla_strcmp for IPSET_ATTR_NAME attr
Problem Details: IPSET_ATTR_NAME and IPSET_ATTR_NAMEREF are of NLA_STRING type, they cannot be treated like a c-string. They either have to be switched to NLA_NUL_STRING, or the compare operations need to use the nla functions. Fixes: f830837f0eed ("netfilter: ipset: list:set set type support") Signed-off-by: Florian...
```diff diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h index e9f4f845d760..b98331572ad2 100644 --- a/include/linux/netfilter/ipset/ip_set.h +++ b/include/linux/netfilter/ipset/ip_set.h @@ -309,7 +309,7 @@ enum { /* register and unregister set references */ extern ip_set...
a958a4f90ddd7de0800b33ca9d7b886b7d40f74e
Analyze and fix the following issue in the Linux kernel code: netfilter: x_tables: ensure names are nul-terminated
Problem Details: Reject names that lack a \0 character before feeding them to functions that expect c-strings. Fixes tag is the most recent commit that needs this change. Fixes: c38c4597e4bf ("netfilter: implement xt_cgroup cgroup2 path match") Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira...
```diff diff --git a/net/netfilter/xt_cgroup.c b/net/netfilter/xt_cgroup.c index c437fbd59ec1..43d2ae2be628 100644 --- a/net/netfilter/xt_cgroup.c +++ b/net/netfilter/xt_cgroup.c @@ -65,6 +65,9 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par) info->priv = NULL; if (info->has_path) { + if (strnl...
6d52a4a0520a6696bdde51caa11f2d6821cd0c01
Analyze and fix the following issue in the Linux kernel code: netfilter: nfnetlink_log: account for netlink header size
Problem Details: This is a followup to an old bug fix: NLMSG_DONE needs to account for the netlink header size, not just the attribute size. This can result in a WARN splat + drop of the netlink message, but other than this there are no ill effects. Fixes: 9dfa1dfe4d5e ("netfilter: nf_log: account for size of NLMSG_D...
```diff diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index fcbe54940b2e..f80978c06fa0 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c @@ -726,7 +726,7 @@ nfulnl_log_packet(struct net *net, + nla_total_size(plen) /* prefix */ + nla_total_size(sizeof(st...
76522fcdbc3a02b568f5d957f7e66fc194abb893
Analyze and fix the following issue in the Linux kernel code: netfilter: flowtable: strictly check for maximum number of actions
Problem Details: The maximum number of flowtable hardware offload actions in IPv6 is: * ethernet mangling (4 payload actions, 2 for each ethernet address) * SNAT (4 payload actions) * DNAT (4 payload actions) * Double VLAN (4 vlan actions, 2 for popping vlan, and 2 for pushing) for QinQ. * Redirect (1 action) Which...
```diff diff --git a/net/netfilter/nf_flow_table_offload.c b/net/netfilter/nf_flow_table_offload.c index 9b677e116487..93d0aa7f8fcc 100644 --- a/net/netfilter/nf_flow_table_offload.c +++ b/net/netfilter/nf_flow_table_offload.c @@ -14,6 +14,8 @@ #include <net/netfilter/nf_conntrack_core.h> #include <net/netfilter/nf_c...
2c0c1e9a6663c1c62d53a92592ec60ae169a8ee9
Analyze and fix the following issue in the Linux kernel code: drm/{i915, xe}: add shared header for VLV IOSF sideband units and registers
Problem Details: Move vlv_iosf_sb_reg.h to include/drm/intel/vlv_iosf_sb_regs.h. Use _regs.h suffix to align better with other register headers. Move enum vlv_iosf_sb_unit there as well, breaking the final include tie related to IOSF sideband between display and i915 core. With this, we can completely remove the xe co...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_display_power_map.c b/drivers/gpu/drm/i915/display/intel_display_power_map.c index 65204d68a759..3400080d78d2 100644 --- a/drivers/gpu/drm/i915/display/intel_display_power_map.c +++ b/drivers/gpu/drm/i915/display/intel_display_power_map.c @@ -4,13 +4,13 @@ */ ...
36776b7f8a8955b4e75b5d490a75fee0c7a2a7ef
Analyze and fix the following issue in the Linux kernel code: lib/hexdump: print_hex_dump_bytes() calls print_hex_dump_debug()
Problem Details: print_hex_dump_bytes() claims to be a simple wrapper around print_hex_dump(), but it actally calls print_hex_dump_debug(), which means no output is printed if (dynamic) DEBUG is disabled. Update the documentation to match the implementation. Fixes: 091cb0994edd20d6 ("lib/hexdump: make print_hex_dump_...
```diff diff --git a/include/linux/printk.h b/include/linux/printk.h index 45c663124c9b..dc02e217a9d1 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -803,7 +803,8 @@ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type, #endif /** - * print_hex_dump_bytes - shorthand ...
579e7b820de5dd5124585413bb5e9c278d255436
Analyze and fix the following issue in the Linux kernel code: ALSA: hda/cmedia: Remove duplicate pin configuration parsing
Problem Details: The cmedia_probe() function calls snd_hda_parse_pin_defcfg() and snd_hda_gen_parse_auto_config() twice unnecessarily. Remove The duplicate code. Fixes: 0f1e8306dcbe ("ALSA: hda/cmedia: Rewrite to new probe method") Signed-off-by: wangdicheng <wangdicheng@kylinos.cn> Link: https://patch.msgid.link/2026...
```diff diff --git a/sound/hda/codecs/cmedia.c b/sound/hda/codecs/cmedia.c index e6e12c01339f..88dd80d987d4 100644 --- a/sound/hda/codecs/cmedia.c +++ b/sound/hda/codecs/cmedia.c @@ -39,13 +39,6 @@ static int cmedia_probe(struct hda_codec *codec, const struct hda_device_id *id) spec->out_vol_mask = (1ULL << 0x10); ...
59bd1d914bb51ab99a33ce32420403ccd035ad29
Analyze and fix the following issue in the Linux kernel code: memblock: warn when freeing reserved memory before memory map is initialized
Problem Details: When CONFIG_DEFERRED_STRUCT_PAGE_INIT is enabled, freeing of reserved memory before the memory map is fully initialized in deferred_init_memmap() would cause access to uninitialized struct pages and may crash when accessing spurious list pointers, like was recently discovered during discussion about me...
```diff diff --git a/mm/internal.h b/mm/internal.h index cb0af847d7d9..f60c1edb2e02 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1233,7 +1233,17 @@ static inline void vunmap_range_noflush(unsigned long start, unsigned long end) #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT DECLARE_STATIC_KEY_TRUE(deferred_pages); +...
c12c3e1507809ad1fc0448f51c933f52e17d13cd
Analyze and fix the following issue in the Linux kernel code: memblock: reserve_mem: fix end caclulation in reserve_mem_release_by_name()
Problem Details: free_reserved_area() expects end parameter to point to the first address after the area, but reserve_mem_release_by_name() passes it the last address inside the area. Remove subtraction of one in calculation of the area end. Fixes: 74e2498ccf7b ("mm/memblock: Add reserved memory release function") Li...
```diff diff --git a/mm/memblock.c b/mm/memblock.c index eaaa6110bcc1..134724f5299e 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -2460,7 +2460,7 @@ int reserve_mem_release_by_name(const char *name) return 0; start = phys_to_virt(map->start); - end = start + map->size - 1; + end = start + map->size; snprin...
8c0ef7b56d6bbbc53f2d43d99c195144f01b0775
Analyze and fix the following issue in the Linux kernel code: lis3lv02d: fix kernel-doc warnings
Problem Details: Use the correct kernel-doc format to avoid kernel-doc warnings: Warning: include/linux/lis3lv02d.h:125 struct member 'st_min_limits' not described in 'lis3lv02d_platform_data' Warning: include/linux/lis3lv02d.h:125 struct member 'st_max_limits' not described in 'lis3lv02d_platform_data' Signed-off-...
```diff diff --git a/include/linux/lis3lv02d.h b/include/linux/lis3lv02d.h index b72b8cdba765..feb60ba4e30e 100644 --- a/include/linux/lis3lv02d.h +++ b/include/linux/lis3lv02d.h @@ -30,8 +30,8 @@ * @default_rate: Default sampling rate. 0 means reset default * @setup_resources: Interrupt line setup call back functi...
bf86059874ab651eaba9e6e0dd9aa0bc072d2648
Analyze and fix the following issue in the Linux kernel code: rv/rvgen: fix _fill_states() return type annotation
Problem Details: The _fill_states() method returns a list of strings, but the type annotation incorrectly specified str. Update the annotation to list[str] to match the actual return value. Signed-off-by: Wander Lairson Costa <wander@redhat.com> Reviewed-by: Gabriele Monaco <gmonaco@redhat.com> Link: https://lore.kern...
```diff diff --git a/tools/verification/rvgen/rvgen/ltl2k.py b/tools/verification/rvgen/rvgen/ltl2k.py index b8ac584fe250..81fd1f5ea5ea 100644 --- a/tools/verification/rvgen/rvgen/ltl2k.py +++ b/tools/verification/rvgen/rvgen/ltl2k.py @@ -75,7 +75,7 @@ class ltl2k(generator.Monitor): if not self.name: ...
5d98f7f5b96c4abc9325c0d851b7d287d24aee93
Analyze and fix the following issue in the Linux kernel code: rv/rvgen: fix unbound loop variable warning
Problem Details: Pyright static analysis reports a "possibly unbound variable" warning for the loop variable `i` in the `abbreviate_atoms` function. The variable is accessed after the inner loop terminates to slice the atom string. While the loop logic currently ensures execution, the analyzer flags the reliance on the...
```diff diff --git a/tools/verification/rvgen/rvgen/ltl2k.py b/tools/verification/rvgen/rvgen/ltl2k.py index b6300c38154d..b8ac584fe250 100644 --- a/tools/verification/rvgen/rvgen/ltl2k.py +++ b/tools/verification/rvgen/rvgen/ltl2k.py @@ -44,13 +44,17 @@ def abbreviate_atoms(atoms: list[str]) -> list[str]: ski...
957dcbf0b663385dddb3eaa5cf5de5109255696f
Analyze and fix the following issue in the Linux kernel code: rv/rvgen: enforce presence of initial state
Problem Details: The __get_state_variables() method parses DOT files to identify the automaton's initial state. If the input file lacks a node with the required initialization prefix, the initial_state variable is referenced before assignment, causing an UnboundLocalError or a generic error during the state removal ste...
```diff diff --git a/tools/verification/rvgen/rvgen/automata.py b/tools/verification/rvgen/rvgen/automata.py index 9fa17216ca52..b9f8149f7118 100644 --- a/tools/verification/rvgen/rvgen/automata.py +++ b/tools/verification/rvgen/rvgen/automata.py @@ -145,6 +145,7 @@ class Automata: # wait for node declaration ...
8aee49c5a53a57014af08de6687a67de7fb679d8
Analyze and fix the following issue in the Linux kernel code: rv/rvgen: fix isinstance check in Variable.expand()
Problem Details: The Variable.expand() method in ltl2ba.py performs contradiction detection by checking if a negated variable already exists in the graph node's old set. However, the isinstance check was incorrectly testing the ASTNode wrapper instead of the wrapped operator, causing the check to always return False. ...
```diff diff --git a/tools/verification/rvgen/rvgen/ltl2ba.py b/tools/verification/rvgen/rvgen/ltl2ba.py index f9855dfa3bc1..7f538598a868 100644 --- a/tools/verification/rvgen/rvgen/ltl2ba.py +++ b/tools/verification/rvgen/rvgen/ltl2ba.py @@ -395,7 +395,7 @@ class Variable: @staticmethod def expand(n: ASTNode...
d474fedcc53aebd584dfc1a42ccb78329ca68aa0
Analyze and fix the following issue in the Linux kernel code: rv/rvgen: use class constant for init marker
Problem Details: Replace hardcoded string literal and magic number with a class constant for the initial state marker in DOT file parsing. The previous implementation used the magic string "__init_" directly in the code along with a hardcoded length of 7 for substring extraction, which made the code less maintainable a...
```diff diff --git a/tools/verification/rvgen/rvgen/automata.py b/tools/verification/rvgen/rvgen/automata.py index 6b0dc1a8cd6a..1a02c6f29e41 100644 --- a/tools/verification/rvgen/rvgen/automata.py +++ b/tools/verification/rvgen/rvgen/automata.py @@ -42,6 +42,7 @@ class Automata: """ invalid_state_str = "IN...