id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
b43498b7e9be0ef76440980642b2bf20dc213e19
Analyze and fix the following issue in the Linux kernel code: eth fbnic: Add register self test
Problem Details: The register test will be used to verify hardware is behaving as expected. The test itself will have us writing to registers that should have no side effects due to us resetting after the test has been completed. While the test is being run the interface should be offline. This patch counts on the f...
```diff diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_csr.c b/drivers/net/ethernet/meta/fbnic/fbnic_csr.c index d9c0dc1c2af9..dc62d623e37c 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_csr.c +++ b/drivers/net/ethernet/meta/fbnic/fbnic_csr.c @@ -147,3 +147,131 @@ int fbnic_csr_regs_len(struct fbnic_dev *fbd) ...
3c3b41e5911db7668e3938eae8df7ed80c76c153
Analyze and fix the following issue in the Linux kernel code: perf cs-etm: Finish removal of ETM_OPT_*
Problem Details: These #defines have been removed from the kernel headers in favour of the string based PMU format attributes. Usages were previously removed from the recording side of cs-etm in Perf. Finish the removal by removing usages from the decode side too. It's a straight replacement of the old #defines with t...
```diff diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index dc3f4e86b075..4418d21708d6 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c @@ -68,20 +68,6 @@ static const char * const metadata_ete_ro[] = { enum cs_etm_version { CS_NOT_PRESENT, C...
89fe91c65992a37863241e35aec151210efc53ce
Analyze and fix the following issue in the Linux kernel code: net: mana: hardening: Validate doorbell ID from GDMA_REGISTER_DEVICE response
Problem Details: As a part of MANA hardening for CVM, add validation for the doorbell ID (db_id) received from hardware in the GDMA_REGISTER_DEVICE response to prevent out-of-bounds memory access when calculating the doorbell page address. In mana_gd_ring_doorbell(), the doorbell page address is calculated as: addr ...
```diff diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c index aef8612b73cb..ef0dbfaac8f4 100644 --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c @@ -39,49 +39,66 @@ static u64 mana_gd_r64(struct gdm...
59bdbabccaa470ed94aae7d94a1229c7b0ff4681
Analyze and fix the following issue in the Linux kernel code: accel/ivpu: Remove boot params address setting via MMIO register
Problem Details: The NPU 60XX uses the default boot params location specified in the firmware image header, consistent with earlier generations. Remove the unnecessary MMIO register write, freeing the AON register for future use. Fixes: 44e4c88951fa ("accel/ivpu: Implement warm boot flow for NPU6 and unify boot handli...
```diff diff --git a/drivers/accel/ivpu/ivpu_hw_40xx_reg.h b/drivers/accel/ivpu/ivpu_hw_40xx_reg.h index 421242acb184..fc0ee8d637f9 100644 --- a/drivers/accel/ivpu/ivpu_hw_40xx_reg.h +++ b/drivers/accel/ivpu/ivpu_hw_40xx_reg.h @@ -121,12 +121,6 @@ #define VPU_50XX_HOST_SS_AON_PWR_ISLAND_STATUS_DLY 0x0003006cu #defi...
6f1a9140ecda3baba3d945b9a6155af4268aafc4
Analyze and fix the following issue in the Linux kernel code: net: add xmit recursion limit to tunnel xmit functions
Problem Details: Tunnel xmit functions (iptunnel_xmit, ip6tunnel_xmit) lack their own recursion limit. When a bond device in broadcast mode has GRE tap interfaces as slaves, and those GRE tunnels route back through the bond, multicast/broadcast traffic triggers infinite recursion between bond_xmit_broadcast() and ip_tu...
```diff diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 67e25f6d15a4..ae269a2e7f4d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3576,17 +3576,49 @@ struct page_pool_bh { }; DECLARE_PER_CPU(struct page_pool_bh, system_page_pool); +#define XMIT_RECURSION_LIMIT 8 ...
69fb5d91bba44ecf7eb80530b85fa4fb028921d5
Analyze and fix the following issue in the Linux kernel code: libceph: prevent potential out-of-bounds reads in process_message_header()
Problem Details: If the message frame is (maliciously) corrupted in a way that the length of the control segment ends up being less than the size of the message header or a different frame is made to look like a message frame, out-of-bounds reads may ensue in process_message_header(). Perform an explicit bounds check ...
```diff diff --git a/net/ceph/messenger_v2.c b/net/ceph/messenger_v2.c index 5ec3272cd2dd..ed618435d33a 100644 --- a/net/ceph/messenger_v2.c +++ b/net/ceph/messenger_v2.c @@ -2833,12 +2833,15 @@ static int process_message_header(struct ceph_connection *con, void *p, void *end) { struct ceph_frame_desc *desc =...
a8ba129af46856112981c124850ec6a85a1c1ab6
Analyze and fix the following issue in the Linux kernel code: amd-xgbe: reset PHY settings before starting PHY
Problem Details: commit f93505f35745 ("amd-xgbe: let the MAC manage PHY PM") moved xgbe_phy_reset() from xgbe_open() to xgbe_start(), placing it after phy_start(). As a result, the PHY settings were being reset after the PHY had already started. Reorder the calls so that the PHY settings are reset before phy_start() i...
```diff diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c index 39da2f811858..23beea48ae26 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c @@ -1271,6 +1271,12 @@ static int xgbe_start(struct xgbe_prv_data *pdata) if (r...
27a4dd0c702b3b2b9cf2c045d100cc2fe8720b81
Analyze and fix the following issue in the Linux kernel code: amd-xgbe: prevent CRC errors during RX adaptation with AN disabled
Problem Details: When operating in 10GBASE-KR mode with auto-negotiation disabled and RX adaptation enabled, CRC errors can occur during the RX adaptation process. This happens because the driver continues transmitting and receiving packets while adaptation is in progress. Fix this by stopping TX/RX immediately when t...
```diff diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c index 8b79d88480db..39da2f811858 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c @@ -1277,6 +1277,10 @@ static int xgbe_start(struct xgbe_prv_data *pdata) hw_...
6485cb96be5cd0f4bf39554737ba11322cc9b053
Analyze and fix the following issue in the Linux kernel code: amd-xgbe: fix link status handling in xgbe_rx_adaptation
Problem Details: The link status bit is latched low to allow detection of momentary link drops. If the status indicates that the link is already down, read it again to obtain the current state. Fixes: 4f3b20bfbb75 ("amd-xgbe: add support for rx-adaptation") Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com> Link: http...
```diff diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c index c63ddb12237e..13c556dc0d67 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c @@ -1942,7 +1942,7 @@ static void xgbe_set_rx_adap_mode(struct xgbe_p...
8cc7dd77a1466f0ec58c03478b2e735a5b289b96
Analyze and fix the following issue in the Linux kernel code: x86/apic: Disable x2apic on resume if the kernel expects so
Problem Details: When resuming from s2ram, firmware may re-enable x2apic mode, which may have been disabled by the kernel during boot either because it doesn't support IRQ remapping or for other reasons. This causes the kernel to continue using the xapic interface, while the hardware is in x2apic mode, which causes han...
```diff diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index d93f87f29d03..961714e6adae 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1894,6 +1894,7 @@ void __init check_x2apic(void) static inline void try_to_enable_x2apic(int remap_mode) { } static inline vo...
5ad32c3607cf241a1a2680cabd64cbcd757227aa
Analyze and fix the following issue in the Linux kernel code: pinctrl: cy8c95x0: Avoid returning positive values to user space
Problem Details: When probe fails due to unclear interrupt status register, it returns a positive number instead of the proper error code. Fix this accordingly. Fixes: e6cbbe42944d ("pinctrl: Add Cypress cy8c95x0 support") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro....
```diff diff --git a/drivers/pinctrl/pinctrl-cy8c95x0.c b/drivers/pinctrl/pinctrl-cy8c95x0.c index b88a627708ff..38caea3b3376 100644 --- a/drivers/pinctrl/pinctrl-cy8c95x0.c +++ b/drivers/pinctrl/pinctrl-cy8c95x0.c @@ -1300,7 +1300,7 @@ static int cy8c95x0_irq_setup(struct cy8c95x0_pinctrl *chip, int irq) /* Read IRQ...
7d86aa41c073c4e7eb75fd2e674f1fd8f289728a
Analyze and fix the following issue in the Linux kernel code: mctp: route: hold key->lock in mctp_flow_prepare_output()
Problem Details: mctp_flow_prepare_output() checks key->dev and may call mctp_dev_set_key(), but it does not hold key->lock while doing so. mctp_dev_set_key() and mctp_dev_release_key() are annotated with __must_hold(&key->lock), so key->dev access is intended to be serialized by key->lock. The mctp_sendmsg() transmit...
```diff diff --git a/net/mctp/route.c b/net/mctp/route.c index 0381377ab760..59ad60b88563 100644 --- a/net/mctp/route.c +++ b/net/mctp/route.c @@ -359,6 +359,7 @@ static void mctp_flow_prepare_output(struct sk_buff *skb, struct mctp_dev *dev) { struct mctp_sk_key *key; struct mctp_flow *flow; + unsigned long flags...
950803f7254721c1c15858fbbfae3deaaeeecb11
Analyze and fix the following issue in the Linux kernel code: bonding: fix type confusion in bond_setup_by_slave()
Problem Details: kernel BUG at net/core/skbuff.c:2306! Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI RIP: 0010:pskb_expand_head+0xa08/0xfe0 net/core/skbuff.c:2306 RSP: 0018:ffffc90004aff760 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffff88807e3c8780 RCX: ffffffff89593e0e RDX: ffff88807b7c4900 RSI: ffffffff89594747 R...
```diff diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 444519078da3..c1fb92602e46 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1509,6 +1509,50 @@ static netdev_features_t bond_fix_features(struct net_device *dev, return features; } +st...
47bba09b14fa21712398febf36cb14fd4fc3bded
Analyze and fix the following issue in the Linux kernel code: can: hi311x: hi3110_open(): add check for hi3110_power_enable() return value
Problem Details: In hi3110_open(), the return value of hi3110_power_enable() is not checked. If power enable fails, the device may not function correctly, while the driver still returns success. Add a check for the return value and propagate the error accordingly. Signed-off-by: Wenyuan Li <2063309626@qq.com> Link: h...
```diff diff --git a/drivers/net/can/spi/hi311x.c b/drivers/net/can/spi/hi311x.c index e00d3dbc4cf4..91b1fa970f8f 100644 --- a/drivers/net/can/spi/hi311x.c +++ b/drivers/net/can/spi/hi311x.c @@ -755,7 +755,9 @@ static int hi3110_open(struct net_device *net) return ret; mutex_lock(&priv->hi3110_lock); - hi3110_po...
1eea46908c57abb7109b1fce024f366ae6c69c4f
Analyze and fix the following issue in the Linux kernel code: can: dev: keep the max bitrate error at 5%
Problem Details: Commit b360a13d44db ("can: dev: print bitrate error with two decimal digits") changed calculation of the bit rate error from on-tenth of a percent to on-hundredth of a percent, but forgot to adjust the scale of the CAN_CALC_MAX_ERROR constant. Keeping the existing logic unchanged: Only when the bitrat...
```diff diff --git a/drivers/net/can/dev/calc_bittiming.c b/drivers/net/can/dev/calc_bittiming.c index cc4022241553..42498e9d3f38 100644 --- a/drivers/net/can/dev/calc_bittiming.c +++ b/drivers/net/can/dev/calc_bittiming.c @@ -8,7 +8,7 @@ #include <linux/units.h> #include <linux/can/dev.h> -#define CAN_CALC_MAX_ERR...
e3f5e0f22cfc2371e7471c9fd5b4da78f9df7c69
Analyze and fix the following issue in the Linux kernel code: mctp: i2c: fix skb memory leak in receive path
Problem Details: When 'midev->allow_rx' is false, the newly allocated skb isn't consumed by netif_rx(), it needs to free the skb directly. Fixes: f5b8abf9fc3d ("mctp i2c: MCTP I2C binding driver") Signed-off-by: Haiyue Wang <haiyuewa@163.com> Link: https://patch.msgid.link/20260305143240.97592-1-haiyuewa@163.com Signe...
```diff diff --git a/drivers/net/mctp/mctp-i2c.c b/drivers/net/mctp/mctp-i2c.c index de6bc1736734..15fe4d1163c1 100644 --- a/drivers/net/mctp/mctp-i2c.c +++ b/drivers/net/mctp/mctp-i2c.c @@ -343,6 +343,7 @@ static int mctp_i2c_recv(struct mctp_i2c_dev *midev) } else { status = NET_RX_DROP; spin_unlock_irqrestor...
8dafa9f5900c4855a65dbfee51e3bd00636deee1
Analyze and fix the following issue in the Linux kernel code: mm/slab: fix an incorrect check in obj_exts_alloc_size()
Problem Details: obj_exts_alloc_size() prevents recursive allocation of slabobj_ext array from the same cache, to avoid creating slabs that are never freed. There is one mistake that returns the original size when memory allocation profiling is disabled. The assumption was that memcg-triggered slabobj_ext allocation i...
```diff diff --git a/mm/slub.c b/mm/slub.c index 20cb4f3b636d..6371838d2352 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2119,13 +2119,6 @@ static inline size_t obj_exts_alloc_size(struct kmem_cache *s, size_t sz = sizeof(struct slabobj_ext) * slab->objects; struct kmem_cache *obj_exts_cache; - /* - * slabobj_ext ...
a79f7b4aeb8e7562cd6dbf9c223e2c2a04b1a85f
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: pkvm: Don't reprobe for ICH_VTR_EL2.TDS on CPU hotplug
Problem Details: Hotplugging a CPU off and back on fails with pKVM, as we try to probe for ICH_VTR_EL2.TDS. In a non-VHE setup, this is achieved by using an EL2 stub helper. However, the stubs are out of reach once pKVM has deprivileged the kernel. The CPU never boots. Since pKVM doesn't allow late onlining of CPUs, w...
```diff diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index c31f8e17732a..32c2dbcc0c64 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -2345,6 +2345,15 @@ static bool can_trap_icv_dir_el1(const struct arm64_cpu_capabilities *entry, !is_midr_in_ran...
e5452968a4b04f93bf9b778ccfd00f79e4d4f529
Analyze and fix the following issue in the Linux kernel code: arm64: dts: ti: k3-am62l: include WKUP_UART0 in wakeup peripheral window
Problem Details: WKUP_UART0 is apart of the wakeup peripherals and has a range from 0x002B300000 to 0x002B3001FF. Expand the wakeup peripheral window to include WKUP_UART0. Fixes: 5f016758b0ab ("arm64: dts: ti: k3-am62l: add initial infrastructure") Reviewed-by: Dhruva Gole <d-gole@ti.com> Signed-off-by: Kendall Willi...
```diff diff --git a/arch/arm64/boot/dts/ti/k3-am62l.dtsi b/arch/arm64/boot/dts/ti/k3-am62l.dtsi index 23acdbb301fe..e01e342c26da 100644 --- a/arch/arm64/boot/dts/ti/k3-am62l.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62l.dtsi @@ -92,7 +92,7 @@ <0x00 0x00b00000 0x00 0x00b00000 0x00 0x00001400>, /* VTM */ <0x00 0x...
dbe17e7783cb5d6451ff1217d0464865857e97e1
Analyze and fix the following issue in the Linux kernel code: net: enetc: do not skip setting LaBCR[MDIO_PHYAD_PRTAD] for addr 0
Problem Details: Given that some platforms may use PHY address 0 (I suppose the PHY may not treat address 0 as a broadcast address or default response address). It is possible for some boards to connect multiple PHYs to the same ENETC MAC, for example: - a PHY with a non-zero address connects to ENETC MAC through SG...
```diff diff --git a/drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c b/drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c index f0e103615e88..92a0f824dae7 100644 --- a/drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c +++ b/drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c @@ -438,12 +438,6 @@ static int i...
246953f33e8cf95621d6c00332e2780ce1594082
Analyze and fix the following issue in the Linux kernel code: net: enetc: fix incorrect fallback PHY address handling
Problem Details: The current netc_get_phy_addr() implementation falls back to PHY address 0 when the "mdio" node or the PHY child node is missing. On i.MX95, this causes failures when a real PHY is actually assigned address 0 and is managed through the EMDIO interface. Because the bit 0 of phy_mask will be set, leading...
```diff diff --git a/drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c b/drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c index 7fd39f895290..f0e103615e88 100644 --- a/drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c +++ b/drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c @@ -333,11 +333,13 @@ static int ...
fb22bb9701d48c4b0e81fe204c2f96a37a520568
Analyze and fix the following issue in the Linux kernel code: pinctrl: renesas: rza1: Normalize return value of gpio_get()
Problem Details: The GPIO .get() callback is expected to return 0 or 1 (or a negative error code). Ensure that the value returned by rza1_gpio_get() is normalized to the [0, 1] range. Fixes: 86ef402d805d606a ("gpiolib: sanitize the return value of gpio_chip::get()") Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gma...
```diff diff --git a/drivers/pinctrl/renesas/pinctrl-rza1.c b/drivers/pinctrl/renesas/pinctrl-rza1.c index bc8b9b9ad05b..d2949e4dbaf7 100644 --- a/drivers/pinctrl/renesas/pinctrl-rza1.c +++ b/drivers/pinctrl/renesas/pinctrl-rza1.c @@ -589,7 +589,7 @@ static inline unsigned int rza1_get_bit(struct rza1_port *port, { ...
6810365c0d1b31e53777d993e61d7fdd3f5f4af5
Analyze and fix the following issue in the Linux kernel code: ntfs3: remove copy and pasted iomap code
Problem Details: ntfs3 copied the iomap code without attribution or talking to the maintainers, to hook into the bio completion for (unexplained) zeroing. Fix this by just overriding the bio completion handler in the submit handler. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20260223...
```diff diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 7ab4e18f8013..60af9f8e0366 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -605,63 +605,18 @@ static void ntfs_iomap_read_end_io(struct bio *bio) bio_put(bio); } -/* - * Copied from iomap/bio.c. - */ -static int ntfs_iomap_bio_read_folio_range(...
aeeac6d3a1f51c8b0ac44ab262c568e905211879
Analyze and fix the following issue in the Linux kernel code: pinctrl: realtek: Fix grammar in error messages
Problem Details: Correct the grammar in dev_err() messages. Change "Not support <feature>..." to "<feature> unsupported..." to improve readability and comply with standard English usage. Signed-off-by: Yu-Chun Lin <eleanor.lin@realtek.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
```diff diff --git a/drivers/pinctrl/realtek/pinctrl-rtd.c b/drivers/pinctrl/realtek/pinctrl-rtd.c index 382bdae54bf3..5888a36babba 100644 --- a/drivers/pinctrl/realtek/pinctrl-rtd.c +++ b/drivers/pinctrl/realtek/pinctrl-rtd.c @@ -293,14 +293,14 @@ static int rtd_pconf_parse_conf(struct rtd_pinctrl *data, config_de...
6a6b238c66dc69cd784baf03b170c50f7e5f24d9
Analyze and fix the following issue in the Linux kernel code: pinctrl: realtek: Fix return value and silence log for unsupported configs
Problem Details: Treating unsupported configurations as errors causes upper layers (like the GPIO subsystem) to interpret optional features as hard failures, aborting operations or printing unnecessary error logs. For example, during gpiod_get(), the GPIO framework attempts to set PIN_CONFIG_PERSIST_STATE. Since this ...
```diff diff --git a/drivers/pinctrl/realtek/pinctrl-rtd.c b/drivers/pinctrl/realtek/pinctrl-rtd.c index eafa0d7bb19d..41e7f5c2bf74 100644 --- a/drivers/pinctrl/realtek/pinctrl-rtd.c +++ b/drivers/pinctrl/realtek/pinctrl-rtd.c @@ -456,8 +456,8 @@ static int rtd_pconf_parse_conf(struct rtd_pinctrl *data, break; d...
7186d0330c3f3e86de577687a82f4ebd96dcb5ac
Analyze and fix the following issue in the Linux kernel code: leds: lgm-sso: Remove duplicate assignments for priv->mmap
Problem Details: Remove duplicate assignment of priv->mmap in intel_sso_led_probe(). Fixes: fba8a6f2263b ("leds: lgm-sso: Fix clock handling") Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Link: https://patch.msgid.link/20260226033048.3715915-1-nichen@iscas.ac.cn Signed-off-by: Lee Jones <lee@kernel.org>
```diff diff --git a/drivers/leds/blink/leds-lgm-sso.c b/drivers/leds/blink/leds-lgm-sso.c index 8923d2df4704..3d9ef9a54805 100644 --- a/drivers/leds/blink/leds-lgm-sso.c +++ b/drivers/leds/blink/leds-lgm-sso.c @@ -808,8 +808,6 @@ static int intel_sso_led_probe(struct platform_device *pdev) priv->fpid_clkrate = clk...
d45963a93c1495e9f1338fde91d0ebba8fd22474
Analyze and fix the following issue in the Linux kernel code: leds: qcom-lpg: Check for array overflow when selecting the high resolution
Problem Details: When selecting the high resolution values from the array, FIELD_GET() is used to pull from a 3 bit register, yet the array being indexed has only 5 values in it. Odds are the hardware is sane, but just to be safe, properly check before just overflowing and reading random data and then setting up chip ...
```diff diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c index 016bf468e094..f6061c47f863 100644 --- a/drivers/leds/rgb/leds-qcom-lpg.c +++ b/drivers/leds/rgb/leds-qcom-lpg.c @@ -1273,7 +1273,12 @@ static int lpg_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, return ret;...
b5227947e68e7515ba449b870338909ed32ac8d2
Analyze and fix the following issue in the Linux kernel code: leds: multicolor: Change intensity_value to unsigned int
Problem Details: Using min to compare the intensity_value with led_dev->max_brightness causes a signedness error: drivers/leds/led-class-multicolor.c: In function 'multi_intensity_store': ././include/linux/compiler_types.h:630:45: error: call to '__compiletime_assert_195' declared with attribute error: min(i...
```diff diff --git a/drivers/leds/led-class-multicolor.c b/drivers/leds/led-class-multicolor.c index fd66d2bdeace..6b671f3f9c61 100644 --- a/drivers/leds/led-class-multicolor.c +++ b/drivers/leds/led-class-multicolor.c @@ -34,14 +34,14 @@ static ssize_t multi_intensity_store(struct device *dev, struct led_classdev *l...
263447532463cf4444a3595e835b99a4e90952fa
Analyze and fix the following issue in the Linux kernel code: pinctrl: qcom: spmi-gpio: implement .get_direction()
Problem Details: GPIO controller driver should typically implement the .get_direction() callback as GPIOLIB internals may try to use it to determine the state of a pin. Since introduction of shared proxy, it prints a warning splat when using a shared spmi gpio. The implementation is not easy because the controller sup...
```diff diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c index 83f940fe30b2..d02d42513ebb 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c @@ -723,6 +723,21 @@ static const struct pinconf_ops pmic_gpio_pinconf_ops = { ...
e002d162654b74fad60a0f85e8fdb1a6c8a903f5
Analyze and fix the following issue in the Linux kernel code: pinctrl: pinconf-generic: Use only fwnode API in parse_dt_cfg()
Problem Details: The parse_dt_cfg() uses OF and fwnode APIs. Fix this inconsistency by fully switching it to use fwnode API and rename the function accordingly. While at it, add missing linux/property.h inclusion. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Linus Walleij <linusw@...
```diff diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index 901a225f3531..855ca973a1c8 100644 --- a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c @@ -16,6 +16,7 @@ #include <linux/init.h> #include <linux/module.h> #include <linux/of.h> +#include <linux...
2737dcb3c467824cd55921fba3fbd1375fc01695
Analyze and fix the following issue in the Linux kernel code: reset: core: Fix indentation
Problem Details: Correct an accidental whitespace change. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202603100730.J3pi4xqi-lkp@intel.com/ Fixes: 9035073d0ef1 ("reset: convert reset core to using firmware nodes") Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
```diff diff --git a/drivers/reset/core.c b/drivers/reset/core.c index e625cf59cfb0..726b7346b148 100644 --- a/drivers/reset/core.c +++ b/drivers/reset/core.c @@ -1215,7 +1215,7 @@ __fwnode_reset_control_get(struct fwnode_handle *fwnode, const char *id, int ind } if (rstc_id < 0) { rstc = ERR_PTR(rstc_id); - g...
d7bf74c94f11dedde59a16d9c94e6c1aec32e1f5
Analyze and fix the following issue in the Linux kernel code: ntfs: fix pointer/integer casting warnings
Problem Details: Use uintptr_t for both conversion paths to fix the warnings. Reported-by: kernel test robot <lkp@intel.com> Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
```diff diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c index 62c3f5733dbe..ba42c566940a 100644 --- a/fs/ntfs/namei.c +++ b/fs/ntfs/namei.c @@ -810,7 +810,7 @@ no_hardlink: static int ntfs_test_inode_attr(struct inode *vi, void *data) { struct ntfs_inode *ni = NTFS_I(vi); - u64 mft_no = (u64)data; + u64 mft_no = (u6...
186ac39b8a7d3ec7ce9c5dd45e5c2730177f375c
Analyze and fix the following issue in the Linux kernel code: xfs: ensure dquot item is deleted from AIL only after log shutdown
Problem Details: In xfs_qm_dqflush(), when a dquot flush fails due to corruption (the out_abort error path), the original code removed the dquot log item from the AIL before calling xfs_force_shutdown(). This ordering introduces a subtle race condition that can lead to data loss after a crash. The AIL tracks the oldes...
```diff diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c index 2b208e2c5264..69e9bc588c8b 100644 --- a/fs/xfs/xfs_dquot.c +++ b/fs/xfs/xfs_dquot.c @@ -1439,9 +1439,15 @@ xfs_qm_dqflush( return 0; out_abort: + /* + * Shut down the log before removing the dquot item from the AIL. + * Otherwise, the log tail ma...
edf04f1af05d714c7aba0cf008ded1245365fcd7
Analyze and fix the following issue in the Linux kernel code: ALSA: hda/senary: Fix beep error handling and optimize EAPD switching
Problem Details: This patch addresses a potential state inconsistency bug and optimizes runtime performance: 1. Fix error handling in set_beep_amp(): Previously, beep_nid was assigned before adding kcontrols. If kcontrol creation failed, the function returned error but left beep_nid set, causing inconsistent ...
```diff diff --git a/sound/hda/codecs/senarytech.c b/sound/hda/codecs/senarytech.c index f9a389df3a17..29b554cdd81d 100644 --- a/sound/hda/codecs/senarytech.c +++ b/sound/hda/codecs/senarytech.c @@ -76,7 +76,6 @@ static int set_beep_amp(struct senary_spec *spec, hda_nid_t nid, unsigned int beep_amp = HDA_COMPOSE_AMP_...
df1d8abf36ca3681c21a6809eaa9a1e01ef897a6
Analyze and fix the following issue in the Linux kernel code: ALSA: usb-audio: Check endpoint numbers at parsing Scarlett2 mixer interfaces
Problem Details: The Scarlett2 mixer quirk in USB-audio driver may hit a NULL dereference when a malformed USB descriptor is passed, since it assumes the presence of an endpoint in the parsed interface in scarlett2_find_fc_interface(), as reported by fuzzer. For avoiding the NULL dereference, just add the sanity check...
```diff diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c index ef3150581eab..fd1fb668929a 100644 --- a/sound/usb/mixer_scarlett2.c +++ b/sound/usb/mixer_scarlett2.c @@ -8251,6 +8251,8 @@ static int scarlett2_find_fc_interface(struct usb_device *dev, if (desc->bInterfaceClass != 255) conti...
335b237d902c7362cb7228802e68374406b24acf
Analyze and fix the following issue in the Linux kernel code: drm/i915/dp: Read ALPM caps after DPCD init
Problem Details: For eDP read the ALPM DPCD caps after DPCD initalization and just before the PSR init. v2: Move intel_alpm_init to intel_edp_init_dpcd (Jouni) v3: Add Fixes with commit-id (Jouni) v4: Separated the alpm dpcd read caps from alpm_init and moved to intel_edp_init_dpcd. v5: Read alpm_caps always for eDP i...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c index 07ffee38974b..f4f1b68f7543 100644 --- a/drivers/gpu/drm/i915/display/intel_alpm.c +++ b/drivers/gpu/drm/i915/display/intel_alpm.c @@ -43,12 +43,6 @@ bool intel_alpm_is_alpm_aux_less(struct intel_dp *intel_dp...
5923a6e0459fdd3edac4ad5abccb24d777d8f1b6
Analyze and fix the following issue in the Linux kernel code: drm/i915/psr: Write DSC parameters on Selective Update in ET mode
Problem Details: There are slice row per frame and pic height parameters in DSC that needs to be configured on every Selective Update in Early Transport mode. Use helper provided by DSC code to configure these on Selective Update when in Early Transport mode. Also fill crtc_state->psr2_su_area with full frame area on f...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 3848cd4fba0e..b7302a32ded4 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -2619,6 +2619,12 @@ void intel_psr2_program_trans_man_trk_ctl(struct intel_dsb...
1be2fca84f520105413d0d89ed04bb0ff742ab16
Analyze and fix the following issue in the Linux kernel code: drm/i915/psr: Repeat Selective Update area alignment
Problem Details: Currently we are aligning Selective Update area to cover cursor fully if needed only once. It may happen that cursor is in Selective Update area after pipe alignment and after that covering cursor plane only partially. Fix this by looping alignment as long as alignment isn't needed anymore. v2: - do...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 4ce1173a2e91..3848cd4fba0e 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -2689,11 +2689,12 @@ static void clip_area_update(struct drm_rect *overlap_dam...
029ae067431ab9d0fca479bdabe780fa436706ea
Analyze and fix the following issue in the Linux kernel code: drm/i915: Fix potential overflow of shmem scatterlist length
Problem Details: When a scatterlists table of a GEM shmem object of size 4 GB or more is populated with pages allocated from a folio, unsigned int .length attribute of a scatterlist may get overflowed if total byte length of pages allocated to that single scatterlist happens to reach or cross the 4GB limit. As a conse...
```diff diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c index c6c64ba29bc4..720a9ad39aa2 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c @@ -153,8 +153,12 @@ int shmem_sg_alloc_table(struct drm_i915_private *i915, ...
237aab549676288d9255bb8dcc284738e56eaa31
Analyze and fix the following issue in the Linux kernel code: drm/i915/vrr: Configure VRR timings after enabling TRANS_DDI_FUNC_CTL
Problem Details: Apparently ICL may hang with an MCE if we write TRANS_VRR_VMAX/FLIPLINE before enabling TRANS_DDI_FUNC_CTL. Personally I was only able to reproduce a hang (on an Dell XPS 7390 2-in-1) with an external display connected via a dock using a dodgy type-C cable that made the link training fail. After the f...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 3b8ba8ab76a1..c4246481fc2f 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -1614,7 +1614,6 @@ static void hsw_configure_cpu_transcoder(co...
0d9a60a0618d255530ca56072c5f39eb58e1ed4a
Analyze and fix the following issue in the Linux kernel code: bnxt_en: Fix RSS table size check when changing ethtool channels
Problem Details: When changing channels, the current check in bnxt_set_channels() is not checking for non-default RSS contexts when the RSS table size changes. The current check for IFF_RXFH_CONFIGURED is only sufficient for the default RSS context. Expand the check to include the presence of any non-default RSS contex...
```diff diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index ba47e8294fff..28d0ece2e7b1 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -979,8 +979,8 @@ static int bnxt_set_chann...
312c816c6bc30342bc30dca0d6db617ab4d3ae4e
Analyze and fix the following issue in the Linux kernel code: net: usb: lan78xx: fix WARN in __netif_napi_del_locked on disconnect
Problem Details: Remove redundant netif_napi_del() call from disconnect path. A WARN may be triggered in __netif_napi_del_locked() during USB device disconnect: WARNING: CPU: 0 PID: 11 at net/core/dev.c:7417 __netif_napi_del_locked+0x2b4/0x350 This happens because netif_napi_del() is called in the disconnect path ...
```diff diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index f8558b87eaec..19cdf69fa589 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -4552,8 +4552,6 @@ static void lan78xx_disconnect(struct usb_interface *intf) phylink_disconnect_phy(dev->phylink); rtnl_unlock(); -...
d9cc0e440f0664f6f3e2c26e39ab9dd5f3badba7
Analyze and fix the following issue in the Linux kernel code: net: usb: lan78xx: skip LTM configuration for LAN7850
Problem Details: Do not configure Latency Tolerance Messaging (LTM) on USB 2.0 hardware. The LAN7850 is a High-Speed (USB 2.0) only device and does not support SuperSpeed features like LTM. Currently, the driver unconditionally attempts to configure LTM registers during initialization. On the LAN7850, these registers ...
```diff diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 507dbcf3b7b0..f8558b87eaec 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -3119,6 +3119,10 @@ static int lan78xx_init_ltm(struct lan78xx_net *dev) int ret; u32 buf; + /* LAN7850 is USB 2.0 and does not supp...
50988747c30df47b73b787f234f746027cb7ec6c
Analyze and fix the following issue in the Linux kernel code: net: usb: lan78xx: fix TX byte statistics for small packets
Problem Details: Account for hardware auto-padding in TX byte counters to reflect actual wire traffic. The LAN7850 hardware automatically pads undersized frames to the minimum Ethernet frame length (ETH_ZLEN, 60 bytes). However, the driver tracks the network statistics based on the unpadded socket buffer length. This ...
```diff diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 1c8f69190378..507dbcf3b7b0 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -4178,7 +4178,7 @@ static struct skb_data *lan78xx_tx_buf_fill(struct lan78xx_net *dev, } tx_data += len; - entry->length += len;...
e4f774a0cc955ce762aec91c66915a6e15087ab7
Analyze and fix the following issue in the Linux kernel code: net: usb: lan78xx: fix silent drop of packets with checksum errors
Problem Details: Do not drop packets with checksum errors at the USB driver level; pass them to the network stack. Previously, the driver dropped all packets where the 'Receive Error Detected' (RED) bit was set, regardless of the specific error type. This caused packets with only IP or TCP/UDP checksum errors to be dr...
```diff diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index a0021df12fde..1c8f69190378 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -3829,6 +3829,7 @@ static void lan78xx_rx_csum_offload(struct lan78xx_net *dev, */ if (!(dev->net->features & NETIF_F_RXCSUM) || ...
687e7863f027426175791f8a23a59b7c4c816fe9
Analyze and fix the following issue in the Linux kernel code: net: stmmac: ptp: remove redundant priv->pps[].available
Problem Details: priv->pps[].available is set in stmmac_ptp_register() for all PPS outputs reported by hardware up to STMMAC_PPS_MAX. Since we now set priv->ptp_clock_ops.n_per_out to the number of PPS outputs that both the hardware and driver can support to prevent array overflow in stmmac_enable(), this makes priv->...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c index 1c431b918719..f1bb981cab7c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c @@ -525,8 +525,6 @@ int dwmac5_flex_pps_config(void __iomem *ioad...
bf3471e6e6c02137dc0d26caa783ac1849f9aab8
Analyze and fix the following issue in the Linux kernel code: net: airoha: Make flow control source port mapping dependent on nbq parameter
Problem Details: Flow control source port mapping for USB serdes needs to be configured according to the GDM port nbq parameter. This is a preliminary patch since nbq parameter is specific for the given port serdes and needs to be read from the DTS (in the current codebase is assigned statically). Signed-off-by: Loren...
```diff diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c index 09acbe669536..7b47d9e066ce 100644 --- a/drivers/net/ethernet/airoha/airoha_eth.c +++ b/drivers/net/ethernet/airoha/airoha_eth.c @@ -1729,10 +1729,12 @@ static int airhoha_set_gdm2_loopback(struct airoha_gdm_po...
dc9c9193c7c19a0163552da3a73a1706b7faea12
Analyze and fix the following issue in the Linux kernel code: selftests: fib_tests: fix link-local retrieval in fib6_nexthop()
Problem Details: fib6_nexthop() retrieves the link-local address for two interfaces used in the test. However, both lldummy and llv1 are obtained from dummy0. llv1 is expected to be retrieved from veth1, which is the interface used later in the test. The subsequent check and error message also expect the address to be...
```diff diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh index c5694cc4ddd2..439461080c60 100755 --- a/tools/testing/selftests/net/fib_tests.sh +++ b/tools/testing/selftests/net/fib_tests.sh @@ -545,7 +545,7 @@ fib4_nexthop() fib6_nexthop() { local lldummy=$(get_linkl...
b2662e7593e94ae09b1cf7ee5f09160a3612bcb2
Analyze and fix the following issue in the Linux kernel code: net: nexthop: fix percpu use-after-free in remove_nh_grp_entry
Problem Details: When removing a nexthop from a group, remove_nh_grp_entry() publishes the new group via rcu_assign_pointer() then immediately frees the removed entry's percpu stats with free_percpu(). However, the synchronize_net() grace period in the caller remove_nexthop_from_groups() runs after the free. RCU reader...
```diff diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c index 1aa2b05ee8de..c942f1282236 100644 --- a/net/ipv4/nexthop.c +++ b/net/ipv4/nexthop.c @@ -2002,7 +2002,8 @@ static void nh_hthr_group_rebalance(struct nh_group *nhg) } static void remove_nh_grp_entry(struct net *net, struct nh_grp_entry *nhge, - st...
288598d80a068a0e9281de35bcb4ce495f189e2a
Analyze and fix the following issue in the Linux kernel code: serial: caif: hold tty->link reference in ldisc_open and ser_release
Problem Details: A reproducer triggers a KASAN slab-use-after-free in pty_write_room() when caif_serial's TX path calls tty_write_room(). The faulting access is on tty->link->port. Hold an extra kref on tty->link for the lifetime of the caif_serial line discipline: get it in ldisc_open() and drop it in ser_release(), ...
```diff diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c index b90890030751..1873d8287bb9 100644 --- a/drivers/net/caif/caif_serial.c +++ b/drivers/net/caif/caif_serial.c @@ -297,6 +297,7 @@ static void ser_release(struct work_struct *work) dev_close(ser->dev); unregister_netdevice(s...
87d126852158467ab87d5cbc36ccfd3f15464a6c
Analyze and fix the following issue in the Linux kernel code: net: sfp: improve Huawei MA5671a fixup
Problem Details: With the current sfp_fixup_ignore_tx_fault() fixup we ignore the TX_FAULT signal, but we also need to apply sfp_fixup_ignore_los() in order to be able to communicate with the module even if the fiber isn't connected for configuration purposes. This is needed for all the MA5671a firmwares, excluding the...
```diff diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index f4bf53da3d4f..5db841377199 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -367,6 +367,12 @@ static void sfp_fixup_ignore_tx_fault(struct sfp *sfp) sfp->state_ignore_mask |= SFP_F_TX_FAULT; } +static void sfp_fixup_ignore_tx...
4185b95f8a42d92d68c49289b4644546b51e252b
Analyze and fix the following issue in the Linux kernel code: ASoC: simple-card-utils: fix graph_util_is_ports0() for DT overlays
Problem Details: graph_util_is_ports0() identifies DPCM front-end (ports@0) vs back-end (ports@1) by calling of_get_child_by_name() to find the first "ports" child and comparing pointers. This relies on child iteration order matching DTS source order. When the DPCM topology comes from a DT overlay, __of_attach_node() ...
```diff diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index bdc02e85b089..9e5be0eaa77f 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -1038,11 +1038,15 @@ int graph_util_is_ports0(struct device_node *np) else port = np;...
b3414148bbc1f9cd56217e58a558c6ac4fd1b4a6
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/sprd: Fix raw temperature clamping in sprd_thm_rawdata_to_temp
Problem Details: The raw temperature data was never clamped to SPRD_THM_RAW_DATA_LOW or SPRD_THM_RAW_DATA_HIGH because the return value of clamp() was not used. Fix this by assigning the clamped value to 'rawdata'. Casting SPRD_THM_RAW_DATA_LOW and SPRD_THM_RAW_DATA_HIGH to u32 is also redundant and can be removed. F...
```diff diff --git a/drivers/thermal/sprd_thermal.c b/drivers/thermal/sprd_thermal.c index 70c879e75d85..44fa45f74da7 100644 --- a/drivers/thermal/sprd_thermal.c +++ b/drivers/thermal/sprd_thermal.c @@ -178,7 +178,7 @@ static int sprd_thm_sensor_calibration(struct device_node *np, static int sprd_thm_rawdata_to_temp(s...
83c0f9a5d679a6f8d84fc49b2f62ea434ccab4b6
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/sprd: Fix temperature clamping in sprd_thm_temp_to_rawdata
Problem Details: The temperature was never clamped to SPRD_THM_TEMP_LOW or SPRD_THM_TEMP_HIGH because the return value of clamp() was not used. Fix this by assigning the clamped value to 'temp'. Casting SPRD_THM_TEMP_LOW and SPRD_THM_TEMP_HIGH to int is also redundant and can be removed. Fixes: 554fdbaf19b1 ("thermal...
```diff diff --git a/drivers/thermal/sprd_thermal.c b/drivers/thermal/sprd_thermal.c index e546067c9621..70c879e75d85 100644 --- a/drivers/thermal/sprd_thermal.c +++ b/drivers/thermal/sprd_thermal.c @@ -192,7 +192,7 @@ static int sprd_thm_temp_to_rawdata(int temp, struct sprd_thermal_sensor *sen) { u32 val; - clam...
a5c21b9bd5f531e50141b0484faabb707b92f1e2
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: correct RBR opp entry
Problem Details: DisplayPort Reduced Bit Rate uses link rate of 1.62 Gbps, the main link clock should be 162 MHz. Having the incorrect frequency (160 MHz) in the OPP table will result in selecting wrong link frequency. Correct the entry in the OPP table. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.c...
```diff diff --git a/arch/arm64/boot/dts/qcom/hamoa.dtsi b/arch/arm64/boot/dts/qcom/hamoa.dtsi index db65c392e618..a3a045732941 100644 --- a/arch/arm64/boot/dts/qcom/hamoa.dtsi +++ b/arch/arm64/boot/dts/qcom/hamoa.dtsi @@ -5658,8 +5658,8 @@ mdss_dp0_opp_table: opp-table { compatible = "operating-points-v2"; ...
8e135b8aee5a06c52a4347a5a6d51223c6f36ba3
Analyze and fix the following issue in the Linux kernel code: apparmor: fix race between freeing data and fs accessing it
Problem Details: AppArmor was putting the reference to i_private data on its end after removing the original entry from the file system. However the inode can aand does live beyond that point and it is possible that some of the fs call back functions will be invoked after the reference has been put, which results in a ...
```diff diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 7a6ca7c5500d..242c71b3fb6e 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -32,6 +32,7 @@ #include "include/crypto.h" #include "include/ipc.h" #include "include/label.h" +#include "include/l...
a0b7091c4de45a7325c8780e6934a894f92ac86b
Analyze and fix the following issue in the Linux kernel code: apparmor: fix race on rawdata dereference
Problem Details: There is a race condition that leads to a use-after-free situation: because the rawdata inodes are not refcounted, an attacker can start open()ing one of the rawdata files, and at the same time remove the last reference to this rawdata (by removing the corresponding profile, for example), which frees i...
```diff diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 81e57666a56e..7a6ca7c5500d 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -79,7 +79,7 @@ static void rawdata_f_data_free(struct rawdata_f_data *private) if (!private) return; - aa_put_l...
39440b137546a3aa383cfdabc605fb73811b6093
Analyze and fix the following issue in the Linux kernel code: apparmor: fix differential encoding verification
Problem Details: Differential encoding allows loops to be created if it is abused. To prevent this the unpack should verify that a diff-encode chain terminates. Unfortunately the differential encode verification had two bugs. 1. it conflated states that had gone through check and already been marked, with states t...
```diff diff --git a/security/apparmor/include/match.h b/security/apparmor/include/match.h index 0dde8eda3d1a..7accb1c39849 100644 --- a/security/apparmor/include/match.h +++ b/security/apparmor/include/match.h @@ -185,6 +185,7 @@ static inline void aa_put_dfa(struct aa_dfa *dfa) #define MATCH_FLAG_DIFF_ENCODE 0x80000...
6601e13e82841879406bf9f369032656f441a425
Analyze and fix the following issue in the Linux kernel code: apparmor: fix unprivileged local user can do privileged policy management
Problem Details: An unprivileged local user can load, replace, and remove profiles by opening the apparmorfs interfaces, via a confused deputy attack, by passing the opened fd to a privileged process, and getting the privileged process to write to the interface. This does require a privileged target that can be manipu...
```diff diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 2f84bd23edb6..81e57666a56e 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -417,7 +417,8 @@ static struct aa_loaddata *aa_simple_write_to_buffer(const char __user *userbuf, } static ssize_t...
5df0c44e8f5f619d3beb871207aded7c78414502
Analyze and fix the following issue in the Linux kernel code: apparmor: Fix double free of ns_name in aa_replace_profiles()
Problem Details: if ns_name is NULL after 1071 error = aa_unpack(udata, &lh, &ns_name); and if ent->ns_name contains an ns_name in 1089 } else if (ent->ns_name) { then ns_name is assigned the ent->ns_name 1095 ns_name = ent->ns_name; however ent->ns_name is freed at 12...
```diff diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index 566821852592..4476515d97b1 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c @@ -1166,6 +1166,7 @@ ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label, goto fail; } ns_name = en...
d352873bbefa7eb39995239d0b44ccdf8aaa79a4
Analyze and fix the following issue in the Linux kernel code: apparmor: fix missing bounds check on DEFAULT table in verify_dfa()
Problem Details: The verify_dfa() function only checks DEFAULT_TABLE bounds when the state is not differentially encoded. When the verification loop traverses the differential encoding chain, it reads k = DEFAULT_TABLE[j] and uses k as an array index without validation. A malformed DFA with DEFAULT_TABLE[j] >= state_c...
```diff diff --git a/security/apparmor/match.c b/security/apparmor/match.c index 30c46b119869..2aad2cbed565 100644 --- a/security/apparmor/match.c +++ b/security/apparmor/match.c @@ -160,9 +160,10 @@ static int verify_dfa(struct aa_dfa *dfa) if (state_count == 0) goto out; for (i = 0; i < state_count; i++) { - ...
8756b68edae37ff546c02091989a4ceab3f20abd
Analyze and fix the following issue in the Linux kernel code: apparmor: fix side-effect bug in match_char() macro usage
Problem Details: The match_char() macro evaluates its character parameter multiple times when traversing differential encoding chains. When invoked with *str++, the string pointer advances on each iteration of the inner do-while loop, causing the DFA to check different characters at each iteration and therefore skip in...
```diff diff --git a/security/apparmor/match.c b/security/apparmor/match.c index 8fa0a1494acd..30c46b119869 100644 --- a/security/apparmor/match.c +++ b/security/apparmor/match.c @@ -463,13 +463,18 @@ aa_state_t aa_dfa_match_len(struct aa_dfa *dfa, aa_state_t start, if (dfa->tables[YYTD_ID_EC]) { /* Equivalence cl...
306039414932c80f8420695a24d4fe10c84ccfb2
Analyze and fix the following issue in the Linux kernel code: apparmor: fix: limit the number of levels of policy namespaces
Problem Details: Currently the number of policy namespaces is not bounded relying on the user namespace limit. However policy namespaces aren't strictly tied to user namespaces and it is possible to create them and nest them arbitrarily deep which can be used to exhaust system resource. Hard cap policy namespaces to t...
```diff diff --git a/security/apparmor/include/policy_ns.h b/security/apparmor/include/policy_ns.h index d646070fd966..cc6e84151812 100644 --- a/security/apparmor/include/policy_ns.h +++ b/security/apparmor/include/policy_ns.h @@ -18,6 +18,8 @@ #include "label.h" #include "policy.h" +/* Match max depth of user name...
ab09264660f9de5d05d1ef4e225aa447c63a8747
Analyze and fix the following issue in the Linux kernel code: apparmor: replace recursive profile removal with iterative approach
Problem Details: The profile removal code uses recursion when removing nested profiles, which can lead to kernel stack exhaustion and system crashes. Reproducer: $ pf='a'; for ((i=0; i<1024; i++)); do echo -e "profile $pf { \n }" | apparmor_parser -K -a; pf="$pf//x"; done $ echo -n a > /sys/kernel/se...
```diff diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index 9108d74c6b46..566821852592 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c @@ -191,19 +191,43 @@ static void __list_remove_profile(struct aa_profile *profile) } /** - * __remove_profile - remove old profile, ...
e38c55d9f834e5b848bfed0f5c586aaf45acb825
Analyze and fix the following issue in the Linux kernel code: apparmor: fix memory leak in verify_header
Problem Details: The function sets `*ns = NULL` on every call, leaking the namespace string allocated in previous iterations when multiple profiles are unpacked. This also breaks namespace consistency checking since *ns is always NULL when the comparison is made. Remove the incorrect assignment. The caller (aa_unpack)...
```diff diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index ba5d40dbeb24..5d90ea55de82 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -1419,7 +1419,6 @@ static int verify_header(struct aa_ext *e, int required, const char **ns) { int erro...
9063d7e2615f4a7ab321de6b520e23d370e58816
Analyze and fix the following issue in the Linux kernel code: apparmor: validate DFA start states are in bounds in unpack_pdb
Problem Details: Start states are read from untrusted data and used as indexes into the DFA state tables. The aa_dfa_next() function call in unpack_pdb() will access dfa->tables[YYTD_ID_BASE][start], and if the start state exceeds the number of states in the DFA, this results in an out-of-bound read. =================...
```diff diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index 1769417a9962..ba5d40dbeb24 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -1010,7 +1010,17 @@ static int unpack_pdb(struct aa_ext *e, struct aa_policydb **policy, if (!aa_unpack...
95bc5c225513fc3c4ce169563fb5e3929fbb938b
Analyze and fix the following issue in the Linux kernel code: ASoC: soc-core: flush delayed work before removing DAIs and widgets
Problem Details: When a sound card is unbound while a PCM stream is open, a use-after-free can occur in snd_soc_dapm_stream_event(), called from the close_delayed_work workqueue handler. During unbind, snd_soc_unbind_card() flushes delayed work and then calls soc_cleanup_card_resources(). Inside cleanup, snd_card_disc...
```diff diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index e5ac8ae1665d..cf826c2a8b59 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2121,6 +2121,9 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card) for_each_card_rtds(card, rtd) if (rtd->initialized) snd_soc_link...
3c99c9f0ed60582c1c9852b685d78d5d3a50de63
Analyze and fix the following issue in the Linux kernel code: ASoC: soc-core: drop delayed_work_pending() check before flush
Problem Details: The delayed_work_pending() check before flush_delayed_work() in soc_free_pcm_runtime() is unnecessary and racy. flush_delayed_work() is safe to call unconditionally - it is a no-op when no work is pending. Remove the check. The original check was added by commit 9c9b65203492 ("ASoC: core: only flush i...
```diff diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d0fffef65daf..e5ac8ae1665d 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -462,8 +462,7 @@ static void soc_free_pcm_runtime(struct snd_soc_pcm_runtime *rtd) list_del(&rtd->list); - if (delayed_work_pending(&rtd->delayed_work))...
0111d600f0f456d09eb0ff6ac217fa5f30ae79ab
Analyze and fix the following issue in the Linux kernel code: PCI: of: Reduce severity of missing of_root error message
Problem Details: Arm64 kernels are frequently built dual ACPI/DT, and then boot in ACPI mode. In this case, there won't be an of_root, except for rare DT described PCIe boards. As a result, users in the common case see this high priority worrying message, despite the machine working as expected. Reduce this message t...
```diff diff --git a/drivers/pci/of.c b/drivers/pci/of.c index 9f8eb5df279e..0eba56e0ebcd 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -775,7 +775,7 @@ void of_pci_make_host_bridge_node(struct pci_host_bridge *bridge) /* Check if there is a DT root node to attach the created node */ if (!of_root) { - ...
d0d727746944096a6681dc6adb5f123fc5aa018d
Analyze and fix the following issue in the Linux kernel code: drm/bridge: ti-sn65dsi83: halve horizontal syncs for dual LVDS output
Problem Details: Dual LVDS output (available on the SN65DSI84) requires HSYNC_PULSE_WIDTH and HORIZONTAL_BACK_PORCH to be divided by two with respect to the values used for single LVDS output. While not clearly stated in the datasheet, this is needed according to the DSI Tuner [0] output. It also makes sense intuitive...
```diff diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c index d2a81175d279..17a885244e1e 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c @@ -517,6 +517,7 @@ static void sn65dsi83_atomic_pre_enable(struct drm_bridge *bridge, ...
2f22702dc0fee06a240404e0f7ead5b789b253d8
Analyze and fix the following issue in the Linux kernel code: drm/bridge: ti-sn65dsi83: fix CHA_DSI_CLK_RANGE rounding
Problem Details: The DSI frequency must be in the range: (CHA_DSI_CLK_RANGE * 5 MHz) <= DSI freq < ((CHA_DSI_CLK_RANGE + 1) * 5 MHz) So the register value should point to the lower range value, but DIV_ROUND_UP() rounds the division to the higher range value, resulting in an excess of 1 (unless the frequency is an ...
```diff diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c index f6736b4457bb..d2a81175d279 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c @@ -351,9 +351,9 @@ static u8 sn65dsi83_get_dsi_range(struct sn65dsi83 *ctx, * DSI_CLK = ...
959d3f7565352fab844ae73a722631c5f615427f
Analyze and fix the following issue in the Linux kernel code: x86/virt/sev: Drop support for SNP hotplug
Problem Details: During an SNP_INIT(_EX), the SEV firmware checks that all CPUs have the SNP syscfg bit set, and fails if they do not. As such, it does not make sense to have offline CPUs: the firmware will fail initialization because of the offlined ones that the kernel did not initialize. Further, there is a bug: du...
```diff diff --git a/arch/x86/virt/svm/sev.c b/arch/x86/virt/svm/sev.c index a4f3a364fb65..f404c609582c 100644 --- a/arch/x86/virt/svm/sev.c +++ b/arch/x86/virt/svm/sev.c @@ -130,33 +130,20 @@ static unsigned long snp_nr_leaked_pages; #undef pr_fmt #define pr_fmt(fmt) "SEV-SNP: " fmt -static int __mfd_enable(unsign...
652a3017c485937cdb0706aa54f9dc74312c97a7
Analyze and fix the following issue in the Linux kernel code: crypto: arm64/aes-neonbs - Move key expansion off the stack
Problem Details: aesbs_setkey() and aesbs_cbc_ctr_setkey() allocate struct crypto_aes_ctx on the stack. On arm64, the kernel-mode NEON context is also stored on the stack, causing the combined frame size to exceed 1024 bytes and triggering -Wframe-larger-than= warnings. Allocate struct crypto_aes_ctx on the heap inste...
```diff diff --git a/arch/arm64/crypto/aes-neonbs-glue.c b/arch/arm64/crypto/aes-neonbs-glue.c index cb87c8fc66b3..00530b291010 100644 --- a/arch/arm64/crypto/aes-neonbs-glue.c +++ b/arch/arm64/crypto/aes-neonbs-glue.c @@ -76,19 +76,24 @@ static int aesbs_setkey(struct crypto_skcipher *tfm, const u8 *in_key, unsign...
3b4a3a00de8770f3a60c1fa483921ce37415132d
Analyze and fix the following issue in the Linux kernel code: scripts: kconfig: merge_config.sh: fix unexpected operator warning
Problem Details: Fix a warning for: $ ./scripts/kconfig/merge_config.sh .config extra.config Using .config as base Merging extra.config ./scripts/kconfig/merge_config.sh: 384: [: false: unexpected operator The shellcheck report is also attached: if [ "$STRICT" == "true" ] && [ "$STRICT_MODE_VIOLATED" == "true" ]; th...
```diff diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh index 735e1de450c6..073c6bec5245 100755 --- a/scripts/kconfig/merge_config.sh +++ b/scripts/kconfig/merge_config.sh @@ -381,7 +381,7 @@ END { STRICT_MODE_VIOLATED=true fi -if [ "$STRICT" == "true" ] && [ "$STRICT_MODE_VIOLATED" ...
a76e30c2479ce6ffa2aa6c8a8462897afc82bc90
Analyze and fix the following issue in the Linux kernel code: kbuild: Delete .builtin-dtbs.S when running make clean
Problem Details: The makefile tries to delete a file named ".builtin-dtb.S" but the file created by scripts/Makefile.vmlinux is actually called ".builtin-dtbs.S". Fixes: 654102df2ac2a ("kbuild: add generic support for built-in boot DTBs") Cc: stable@vger.kernel.org Signed-off-by: Charles Mirabile <cmirabil@redhat.com>...
```diff diff --git a/Makefile b/Makefile index 2b15f0b4a0cb..2317618fd074 100644 --- a/Makefile +++ b/Makefile @@ -1650,7 +1650,7 @@ CLEAN_FILES += vmlinux.symvers modules-only.symvers \ modules.builtin.ranges vmlinux.o.map vmlinux.unstripped \ compile_commands.json rust/test \ rust-project.j...
8238cb69c01fe4dbb4e3be277fff3ed680ac0108
Analyze and fix the following issue in the Linux kernel code: PCI: Make reset_subordinate hotplug safe
Problem Details: Use the slot reset method when resetting the bridge if the bus contains hot plug slots. This fixes spurious hot plug events that are triggered by the secondary bus reset that bypasses the slot's detection disabling. Resetting a bridge's subordinate bus can be done like this: # echo 1 > /sys/bus/pci...
```diff diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index aaf92195da32..a2f8a5d6190f 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -553,7 +553,6 @@ static ssize_t reset_subordinate_store(struct device *dev, const char *buf, size_t count) { struct pci_dev *pdev = to_pci...
102c8b26b54e363f85c4c86099ca049a0a76bb58
Analyze and fix the following issue in the Linux kernel code: PCI: Allow all bus devices to use the same slot
Problem Details: A PCIe hotplug slot applies to the entire secondary bus. Thus, pciehp only allocates a single hotplug_slot for the bridge to that bus. The existing PCI slot, though, would only match to functions on device 0, meaning any devices beyond that, e.g., ARI functions, are not matched to any slot even though ...
```diff diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index 1e9158d7bac7..2cafd3b26f34 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c @@ -79,7 +79,8 @@ static int init_slot(struct controller *ctrl) snprintf(name, SLOT_NAME_SIZE, "%u", PSN(ct...
0a8b8af896e0ef83e188e1fe20f98f2bbb1c2459
Analyze and fix the following issue in the Linux kernel code: block: fix zone write plugs refcount handling in disk_zone_wplug_schedule_bio_work()
Problem Details: The function disk_zone_wplug_schedule_bio_work() always takes a reference on the zone write plug of the BIO work being scheduled. This ensures that the zone write plug cannot be freed while the BIO work is being scheduled but has not run yet. However, this unconditional reference taking is fragile sinc...
```diff diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 6e3ef181e837..7aae3c236cad 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -1154,13 +1154,17 @@ static void disk_zone_wplug_schedule_bio_work(struct gendisk *disk, lockdep_assert_held(&zwplug->lock); /* - * Take a reference on the zone wr...
b7d4ffb510373cc6ecf16022dd0e510a023034fb
Analyze and fix the following issue in the Linux kernel code: block: fix zone write plug removal
Problem Details: Commit 7b295187287e ("block: Do not remove zone write plugs still in use") modified disk_should_remove_zone_wplug() to add a check on the reference count of a zone write plug to prevent removing zone write plugs from a disk hash table when the plugs are still being referenced by BIOs or requests in-fli...
```diff diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 9d1dd6ccfad7..6e3ef181e837 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -99,17 +99,17 @@ static inline unsigned int disk_zone_wplugs_hash_size(struct gendisk *disk) * being executed or the zone write plug bio list is not empty. * - BL...
85c9f3a2b805eb96d899da7bcc38a16459aa3c16
Analyze and fix the following issue in the Linux kernel code: lib/crc: tests: Make crc_kunit test only the enabled CRC variants
Problem Details: Like commit 4478e8eeb871 ("lib/crypto: tests: Depend on library options rather than selecting them") did with the crypto library tests, make crc_kunit depend on the code it tests rather than selecting it. This follows the standard convention for KUnit and fixes an issue where enabling KUNIT_ALL_TESTS ...
```diff diff --git a/lib/crc/Kconfig b/lib/crc/Kconfig index 70e7a6016de3..9ddfd1a29757 100644 --- a/lib/crc/Kconfig +++ b/lib/crc/Kconfig @@ -99,13 +99,8 @@ config CRC_OPTIMIZATIONS config CRC_KUNIT_TEST tristate "KUnit tests for CRC functions" if !KUNIT_ALL_TESTS - depends on KUNIT + depends on KUNIT && (CRC7 ||...
5e07ce466356d9833757b2d6c0380b6ee7b11a77
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: Use AES-CMAC library in aes_s2v()
Problem Details: Now that AES-CMAC has a library API, convert aes_s2v() to use it instead of a "cmac(aes)" crypto_shash. The result is faster and simpler code. It's also more reliable, since with the library the only step that can fail is preparing the key. In contrast, crypto_shash_digest(), crypto_shash_init(), cr...
```diff diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig index 0afbe4f4f976..d6bc295e23a1 100644 --- a/net/mac80211/Kconfig +++ b/net/mac80211/Kconfig @@ -8,7 +8,6 @@ config MAC80211 select CRYPTO_AES select CRYPTO_CCM select CRYPTO_GCM - select CRYPTO_CMAC select CRC32 help This option enables th...
58286738b159ca93d41438a6ddcc2ea5333191b4
Analyze and fix the following issue in the Linux kernel code: lib/crypto: arm64/aes: Migrate optimized CBC-based MACs into library
Problem Details: Instead of exposing the arm64-optimized CMAC, XCBC-MAC, and CBC-MAC code via arm64-specific crypto_shash algorithms, instead just implement the aes_cbcmac_blocks_arch() library function. This is much simpler, it makes the corresponding library functions be arm64-optimized, and it fixes the longstandin...
```diff diff --git a/arch/arm64/crypto/Kconfig b/arch/arm64/crypto/Kconfig index 81ed892b3b72..82794afaffc9 100644 --- a/arch/arm64/crypto/Kconfig +++ b/arch/arm64/crypto/Kconfig @@ -144,7 +144,7 @@ config CRYPTO_AES_ARM64_CE_CCM select CRYPTO_ALGAPI select CRYPTO_AES_ARM64_CE_BLK select CRYPTO_AEAD - select CRYP...
f8f08d7cc43237e91e3aedf7b67d015d24c38fcc
Analyze and fix the following issue in the Linux kernel code: crypto: arm64/aes - Fix 32-bit aes_mac_update() arg treated as 64-bit
Problem Details: Since the 'enc_after' argument to neon_aes_mac_update() and ce_aes_mac_update() has type 'int', it needs to be accessed using the corresponding 32-bit register, not the 64-bit register. The upper half of the corresponding 64-bit register may contain garbage. Fixes: 4860620da7e5 ("crypto: arm64/aes - ...
```diff diff --git a/arch/arm64/crypto/aes-modes.S b/arch/arm64/crypto/aes-modes.S index 0e834a2c062c..e793478f37c1 100644 --- a/arch/arm64/crypto/aes-modes.S +++ b/arch/arm64/crypto/aes-modes.S @@ -838,7 +838,7 @@ AES_FUNC_START(aes_mac_update) encrypt_block v0, w2, x1, x7, w8 eor v0.16b, v0.16b, v4.16b cmp w3...
7137cbf2b5c9feb6302d6da116eab2047c5f05d2
Analyze and fix the following issue in the Linux kernel code: crypto: aes - Add cmac, xcbc, and cbcmac algorithms using library
Problem Details: Update the "aes" module to implement "cmac(aes)", "xcbc(aes)", and "cbcmac(aes)" algorithms using the corresponding library functions, and register these with the crypto_shash API. Each algorithm is included only if the corresponding existing kconfig option is enabled. This allows the architecture-op...
```diff diff --git a/crypto/Kconfig b/crypto/Kconfig index b4bb85e8e226..c977d40f906d 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -361,6 +361,8 @@ config CRYPTO_AES tristate "AES (Advanced Encryption Standard)" select CRYPTO_ALGAPI select CRYPTO_LIB_AES + select CRYPTO_LIB_AES_CBC_MACS if CRYPTO_CMAC || C...
785d4625d3e05bb0ac536ff4fd74d096cfe51714
Analyze and fix the following issue in the Linux kernel code: io_uring/bpf_filter: use bpf_prog_run_pin_on_cpu() to prevent migration
Problem Details: Since the caller, __io_uring_run_bpf_filters(), doesn't prevent migration, it should use the migration disabling variant for running the BPF program. Fixes: d42eb05e60fe ("io_uring: add support for BPF filtering for opcode restrictions") Signed-off-by: Jens Axboe <axboe@kernel.dk>
```diff diff --git a/io_uring/bpf_filter.c b/io_uring/bpf_filter.c index 28a23e92ee81..9cc44764e0ac 100644 --- a/io_uring/bpf_filter.c +++ b/io_uring/bpf_filter.c @@ -85,7 +85,7 @@ int __io_uring_run_bpf_filters(struct io_bpf_filter __rcu **filters, do { if (filter == &dummy_filter) return -EACCES; - ret = bp...
981b080a79724738882b0af1c5bb7ade30d94f24
Analyze and fix the following issue in the Linux kernel code: spi: fsl-qspi: Use reinit_completion() for repeated operations
Problem Details: The driver currently calls init_completion() during every spi_mem_op. Tchnically it may work, but it's not the recommended pattern. According to the kernel documentation: Calling init_completion() on the same completion object twice is most likely a bug as it re-initializes the queue to an empty queue...
```diff diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c index a223b4bc6e63..57358851029b 100644 --- a/drivers/spi/spi-fsl-qspi.c +++ b/drivers/spi/spi-fsl-qspi.c @@ -633,7 +633,7 @@ static int fsl_qspi_do_op(struct fsl_qspi *q, const struct spi_mem_op *op) void __iomem *base = q->iobase; int er...
68c8c93fdb0de7e528dc3dfb1d17eb0f652259b8
Analyze and fix the following issue in the Linux kernel code: spi: nxp-fspi: Use reinit_completion() for repeated operations
Problem Details: The driver currently calls init_completion() during every spi_mem_op. Tchnically it may work, but it's not the recommended pattern. According to the kernel documentation: Calling init_completion() on the same completion object twice is most likely a bug as it re-initializes the queue to an empty queue...
```diff diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c index 320b3d93df57..1e36ae084dd8 100644 --- a/drivers/spi/spi-nxp-fspi.c +++ b/drivers/spi/spi-nxp-fspi.c @@ -996,7 +996,7 @@ static int nxp_fspi_do_op(struct nxp_fspi *f, const struct spi_mem_op *op) reg = reg | FSPI_IPRXFCR_CLR; fspi_wri...
40f9bc646db5aa89fb85f2cda1e55a2bf9d6a30c
Analyze and fix the following issue in the Linux kernel code: spi: nxp-xspi: Use reinit_completion() for repeated operations
Problem Details: The driver currently calls init_completion() during every spi_mem_op. Tchnically it may work, but it's not the recommended pattern. According to the kernel documentation: Calling init_completion() on the same completion object twice is most likely a bug as it re-initializes the queue to an empty queue...
```diff diff --git a/drivers/spi/spi-nxp-xspi.c b/drivers/spi/spi-nxp-xspi.c index 06fcdf22990b..385302a6e62f 100644 --- a/drivers/spi/spi-nxp-xspi.c +++ b/drivers/spi/spi-nxp-xspi.c @@ -958,7 +958,7 @@ static int nxp_xspi_do_op(struct nxp_xspi *xspi, const struct spi_mem_op *op) writel(reg, base + XSPI_RBCT); } ...
ed0313223ce6514dbd39c049e25f702980d7e3cc
Analyze and fix the following issue in the Linux kernel code: ASoC: codecs: wcd9335: Remove potential undefined behavior in wcd9335_slimbus_irq()
Problem Details: If 'port_id' is negative, the shift counts in wcd9335_slimbus_irq() also become negative, resulting in undefined behavior due to shift out of bounds. That appears to be not possible, but with UBSAN enabled, Clang's range analysis isn't always able to determine that and generates undefined behavior. A...
```diff diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c index 640e43ee1975..e3ca5ca6de3d 100644 --- a/sound/soc/codecs/wcd9335.c +++ b/sound/soc/codecs/wcd9335.c @@ -3907,7 +3907,7 @@ static irqreturn_t wcd9335_slimbus_irq(int irq, void *data) { struct wcd9335_codec *wcd = data; unsigned long ...
111e2863372c322e836e0c896f6dd9cf4ee08c71
Analyze and fix the following issue in the Linux kernel code: spi: rockchip-sfc: Fix double-free in remove() callback
Problem Details: The driver uses devm_spi_register_controller() for registration, which automatically unregisters the controller via devm cleanup when the device is removed. The manual call to spi_unregister_controller() in the remove() callback can lead to a double-free. And to make sure controller is unregistered be...
```diff diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c index 2990bf85ee47..174995042f53 100644 --- a/drivers/spi/spi-rockchip-sfc.c +++ b/drivers/spi/spi-rockchip-sfc.c @@ -711,7 +711,7 @@ static int rockchip_sfc_probe(struct platform_device *pdev) } } - ret = devm_spi_register_cont...
2f1763f62909ccb6386ac50350fa0abbf5bb16a9
Analyze and fix the following issue in the Linux kernel code: HID: wacom: fix out-of-bounds read in wacom_intuos_bt_irq
Problem Details: The wacom_intuos_bt_irq() function processes Bluetooth HID reports without sufficient bounds checking. A maliciously crafted short report can trigger an out-of-bounds read when copying data into the wacom structure. Specifically, report 0x03 requires at least 22 bytes to safely read the processed data...
```diff diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 9b2c710f8da1..da1f0ea85625 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1208,10 +1208,20 @@ static int wacom_intuos_bt_irq(struct wacom_wac *wacom, size_t len) switch (data[0]) { case 0x04: + if (len < 32) { + ...
bfb18fd193e2413f02ad934e46887f415f0ce4ec
Analyze and fix the following issue in the Linux kernel code: drm/bridge: cadence: cdns-mhdp8546-core: Reduce log level for DPCD read/write
Problem Details: Reduce the log level for cdns_mhdp_dpcd_read and cdns_mhdp_dpcd_write errors in cdns_mhdp_transfer function as in case of failure, there is flooding of these prints along with other indicators like EDID failure logs which are fairly intuitive in themselves rendering these error logs useless. Also, the ...
```diff diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index 89cf8cb37cd3..945bb47c172b 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -778,7 +778,7 @@ static ssize_t cd...
4a8edd658489ec2a3d7e20482fa9e8d366153d8d
Analyze and fix the following issue in the Linux kernel code: drm/bridge: cadence: cdns-mhdp8546-core: Handle HDCP state in bridge atomic check
Problem Details: Now that we have DRM_BRIDGE_ATTACH_NO_CONNECTOR framework, handle the HDCP state change in bridge atomic check as well to enable correct functioning for HDCP in both DRM_BRIDGE_ATTACH_NO_CONNECTOR and !DRM_BRIDGE_ATTACH_NO_CONNECTOR case. Without this patch, when using DRM_BRIDGE_ATTACH_NO_CONNECTOR f...
```diff diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index 3f5cc4e90927..c7cd0234d168 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -2123,6 +2123,10 @@ static int cdn...
6dbff34016052b099558b76632e4983e2df13fed
Analyze and fix the following issue in the Linux kernel code: drm/bridge: cadence: cdns-mhdp8546-core: Add mode_valid hook to drm_bridge_funcs
Problem Details: Add cdns_mhdp_bridge_mode_valid() to check if specific mode is valid for this bridge or not. In the legacy usecase with !DRM_BRIDGE_ATTACH_NO_CONNECTOR we were using the hook from drm_connector_helper_funcs but with DRM_BRIDGE_ATTACH_NO_CONNECTOR we need to have mode_valid() in drm_bridge_funcs. Witho...
```diff diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index 3379194e4ea6..3f5cc4e90927 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -2162,6 +2162,25 @@ static const s...
43d6508ddbf9fb974fbc359a033154f78c9d4c8b
Analyze and fix the following issue in the Linux kernel code: drm/bridge: cadence: cdns-mhdp8546-core: Set the mhdp connector earlier in atomic_enable()
Problem Details: In case if we get errors in cdns_mhdp_link_up() or cdns_mhdp_reg_read() in atomic_enable, we will go to cdns_mhdp_modeset_retry_fn() and will hit NULL pointer while trying to access the mutex. We need the connector to be set before that. Unlike in legacy cases with flag !DRM_BRIDGE_ATTACH_NO_CONNECTOR,...
```diff diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index 9392c226ff5b..3379194e4ea6 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -740,7 +740,7 @@ static void cdns_...
878004e2852bc22ce0687c5597d6fe3909fb59f3
Analyze and fix the following issue in the Linux kernel code: iopoll: fix function parameter names in read_poll_timeout_atomic()
Problem Details: Correct the function parameter names to avoid kernel-doc warnings and to emphasize this function is atomic (non-sleeping). Warning: include/linux/iopoll.h:169 function parameter 'sleep_us' not described in 'read_poll_timeout_atomic' Warning: ../include/linux/iopoll.h:169 function parameter 'sleep_be...
```diff diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h index bdd2e0652bc3..53edd69acb9b 100644 --- a/include/linux/iopoll.h +++ b/include/linux/iopoll.h @@ -159,7 +159,7 @@ * * This macro does not rely on timekeeping. Hence it is safe to call even when * timekeeping is suspended, at the expense of ...
dc6b431f18cfb1e8cc7da45c16ccf371bcd636d5
Analyze and fix the following issue in the Linux kernel code: scripts: generate_rust_analyzer.py: rename cfg to generated_cfg
Problem Details: This variable is for the cfg from generated files. It's also easy to confuse with the `cfg` parameter in append_crate(), so rename it. [ Changed title to include script extension. - Tamir ] Signed-off-by: Eliot Courtney <ecourtney@nvidia.com> Reviewed-by: Tamir Duberstein <tamird@kernel.org> Link: ht...
```diff diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py index 024e71a742e0..2977dfff76b3 100755 --- a/scripts/generate_rust_analyzer.py +++ b/scripts/generate_rust_analyzer.py @@ -58,12 +58,12 @@ def generate_crates( core_edition: str, ) -> List[Crate]: # Generate the confi...
9b4744d8eda2824041064a5639ccbb079850914d
Analyze and fix the following issue in the Linux kernel code: scripts: generate_rust_analyzer.py: avoid FD leak
Problem Details: Use `pathlib.Path.read_text()` to avoid leaking file descriptors. Fixes: 8c4555ccc55c ("scripts: add `generate_rust_analyzer.py`") Cc: stable@vger.kernel.org Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com> Reviewed-by: Fiona Behrens <me@kloenk.dev> Reviewed-by: Trevor Gross <tmgross@umich.e...
```diff diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py index 38e834bd209e..024e71a742e0 100755 --- a/scripts/generate_rust_analyzer.py +++ b/scripts/generate_rust_analyzer.py @@ -313,9 +313,10 @@ def generate_crates( def is_root_crate(build_file: pathlib.Path, target: str) -> ...
36c619f6bd793493294becb10a02fea370b67a91
Analyze and fix the following issue in the Linux kernel code: scripts: generate_rust_analyzer.py: define scripts
Problem Details: Add IDE support for host-side scripts written in Rust. This support has been missing since these scripts were initially added in commit 9a8ff24ce584 ("scripts: add `generate_rust_target.rs`"), thus add it. Change the existing instance of extension stripping to `pathlib.Path.stem` to maintain code cons...
```diff diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py index 7becc2698c14..38e834bd209e 100755 --- a/scripts/generate_rust_analyzer.py +++ b/scripts/generate_rust_analyzer.py @@ -299,6 +299,18 @@ def generate_crates( "kernel", [core, macros, build_error, pin_init, ffi, bindi...
b6b592275aeff184aa82fcf6abccd833fb71b393
Analyze and fix the following issue in the Linux kernel code: hfsplus: fix uninit-value by validating catalog record size
Problem Details: Syzbot reported a KMSAN uninit-value issue in hfsplus_strcasecmp(). The root cause is that hfs_brec_read() doesn't validate that the on-disk record size matches the expected size for the record type being read. When mounting a corrupted filesystem, hfs_brec_read() may read less data than expected. For...
```diff diff --git a/fs/hfsplus/bfind.c b/fs/hfsplus/bfind.c index 336d654861c5..9a55fa6d5294 100644 --- a/fs/hfsplus/bfind.c +++ b/fs/hfsplus/bfind.c @@ -287,3 +287,54 @@ out: fd->bnode = bnode; return res; } + +/** + * hfsplus_brec_read_cat - read and validate a catalog record + * @fd: find data structure + * @e...