Skip to contentSkip to conversation

ALSA: usb-audio: Prevent excessive number of frames

PATCH New Sasha Levin 1 participant 10 messages Jan 20

Subsystems (6)
Stable branch Sound RISC-V NVMe +2 more subsystems
lore
Share & tools
lore

Sasha Levin

author maintainer
#0 lore raw

PATCH 1/1 ALSA: usb-audio: Prevent excessive number of frames

From: Edward Adam Davis <[email protected]>

[ Upstream commit ef5749ef8b307bf8717945701b1b79d036af0a15 ]

In this case, the user constructed the parameters with maxpacksize 40 for rate 22050 / pps 1000, and packsize[0] 22 packsize[1] 23. The buffer size for each data URB is maxpacksize * packets, which in this example is 40 * 6 = 240; When the user performs a write operation to send audio data into the ALSA PCM playback stream, the calculated number of frames is packsize[0] * packets = 264, which exceeds the allocated URB buffer size, triggering the out-of-bounds (OOB) issue reported by syzbot [1].

Added a check for the number of single data URB frames when calculating the number of frames to prevent [1].

[1]

BUG: KASAN: slab-out-of-bounds in copy_to_urb+0x261/0x460 sound/usb/pcm.c:1487
Write of size 264 at addr ffff88804337e800 by task syz.0.17/5506
Call Trace:
 copy_to_urb+0x261/0x460 sound/usb/pcm.c:1487
 prepare_playback_urb+0x953/0x13d0 sound/usb/pcm.c:1611
 prepare_outbound_urb+0x377/0xc50 sound/usb/endpoint.c:333

---

LLM Generated explanations, may be completely bogus:

Good. max_urb_frames has been in the kernel since 2013. Now let me understand the vulnerability better and confirm the fix is appropriate:

## Summary of Analysis

### 1. COMMIT MESSAGE ANALYSIS

The commit message clearly describes:
- A **KASAN-detected slab-out-of-bounds write** in copy_to_urb() at sound/usb/pcm.c:1487
- The root cause: User-controllable parameters can create a scenario where packsize[0] * packets = 264 exceeds the URB buffer size of maxpacksize * packets = 240
- The fix: Add a check to prevent frames + counts from exceeding ep->max_urb_frames
- It has **"Reported-by: syzbot"** and **"Tested-by: syzbot"** tags, confirming this is a real bug that's been reproduced and verified as fixed

### 2. CODE CHANGE ANALYSIS

**The bug mechanism:**
1. URB buffer is allocated as maxsize * packets (e.g., 40 * 6 = 240 bytes)
2. The loop iterates through ctx->packets (e.g., 6 packets)
3. For each packet, snd_usb_endpoint_next_packet_size() returns a count (e.g., alternating 22 and 23 frames)
4. The accumulated frames variable sums up: 22 + 23 + 22 + 23 + ... = potentially 264 frames
5. This exceeds the 240-byte buffer, causing the OOB write in copy_to_urb()

**The fix:**

```c
- if (counts < 0)
+                       if (counts < 0 || frames + counts >=
ep->max_urb_frames)
                                break;
```

This adds a bounds check that stops the loop if adding the next packet's frames would exceed max_urb_frames. This is a **defensive check** that ensures the total frames never exceed what the allocated buffer can hold.

### 3. CLASSIFICATION

- **Type:** Security fix - heap buffer overflow (OOB write)
- **Category:** Memory safety bug fix
- **Severity:** HIGH - This is a write-based memory corruption that could lead to privilege escalation or kernel crash

### 4. SCOPE AND RISK ASSESSMENT

- **Lines changed:** 1 line (just adds an additional condition to an existing check)
- **Files touched:** 1 file (sound/usb/pcm.c)
- **Complexity:** Minimal - straightforward bounds check
- **Risk of regression:** Very low - this only adds a safety check to break out of a loop early; it doesn't change any other behavior
- **Subsystem:** USB audio (widely used for USB headsets, microphones, DACs)

### 5. USER IMPACT

- **Affected users:** Anyone using USB audio devices
- **Attack surface:** This can be triggered through the ALSA PCM interface, which is accessible to local users. The fuzzer found this through the OSS compatibility layer.
- **Severity if bug hits:** Kernel memory corruption, potential for code execution or denial of service

### 6. STABILITY INDICATORS

- **Reported-by: syzbot** - Found by continuous kernel fuzzing
- **Tested-by: syzbot** - Verified by the automated test infrastructure
- **Signed-off-by: Takashi Iwai** - The USB audio maintainer accepted and merged this

### 7. DEPENDENCY CHECK

The fix uses ep->max_urb_frames, which has existed since kernel 3.12 (2013). The code path being fixed (the lowlatency playback mode with snd_usb_endpoint_next_packet_size taking 4 args including avail) was introduced in v5.16. The fix should cleanly apply to any kernel with this code path (5.16+).

## Conclusion

This commit is an **excellent candidate for stable backport**:

1. ✅ **Fixes a real, serious bug**: KASAN-detected heap buffer overflow (OOB write)
2. ✅ **Security relevant**: Memory corruption that could lead to privilege escalation
3. ✅ **Small and surgical**: Single line change with minimal risk
4. ✅ **Obviously correct**: Simple bounds check that prevents writing past allocated buffer
5. ✅ **Well tested**: Verified by syzbot, accepted by the USB audio maintainer
6. ✅ **No new features**: Pure bug fix
7. ✅ **Clear scope**: Only affects USB audio playback URB preparation

The fix prevents a heap buffer overflow that was found by syzkaller. The change is minimal (adding one condition to an existing check), low-risk, and obviously correct. It protects against a real security vulnerability that could be exploited by local users.

**YES**

 sound/usb/pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/pcm.c +1 -1
index 54d01dfd820fa..263abb36bb2d1 100644
@@ -1553,7 +1553,7 @@ static int prepare_playback_urb(struct snd_usb_substream *subs,
 
 		for (i = 0; i < ctx->packets; i++) {
 			counts = snd_usb_endpoint_next_packet_size(ep, ctx, i, avail);
-			if (counts < 0)
+			if (counts < 0 || frames + counts >= ep->max_urb_frames)
 				break;
 			/* set up descriptor */
 			urb->iso_frame_desc[i].offset = frames * stride;
Signature · 1 line
2.51.0
author maintainer
#1 lore raw

PATCH 1/1 ASoC: amd: yc: Fix microphone on ASUS M6500RE

From: Radhi Bajahaw <[email protected]>

[ Upstream commit 8e29db1b08808f709231e6fd4c79dcdee5b17a17 ]

Add DMI match for ASUSTeK COMPUTER INC. M6500RE to enable the internal microphone.

---

LLM Generated explanations, may be completely bogus:

## Comprehensive Analysis

### 1. COMMIT MESSAGE ANALYSIS

The commit message is clear and straightforward:
- **Subject**: "ASoC: amd: yc: Fix microphone on ASUS M6500RE"
- **Description**: Adds a DMI match for a specific ASUS laptop model to enable the internal microphone
- **Keywords**: "Fix" indicates this is addressing a bug (non-working microphone)
- **Tags**: Has proper Signed-off-by and Link tags, reviewed by Mark Brown (ASoC maintainer)

The commit addresses a real user-facing issue: the internal microphone doesn't work on this specific laptop without this DMI quirk entry.

### 2. CODE CHANGE ANALYSIS

The diff shows:
- **Single file changed**: sound/soc/amd/yc/acp6x-mach.c
- **Change type**: Addition of a new DMI match entry to the yc_acp_quirk_table[] array
- **Lines added**: 7 lines (a new table entry)
- **Lines removed**: 0

The actual change is:

```c
{
    .driver_data = &acp6x_card,
    .matches = {
        DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."),
        DMI_MATCH(DMI_PRODUCT_NAME, "M6500RE"),
    }
},
```

This is identical in structure to the existing entries for other ASUS models (M6400RC, M3402RA, M6500RC, M6501RM, E1404FA, E1504FA, etc.). The pattern is well-established.

### 3. CLASSIFICATION

This falls squarely into the **QUIRKS and WORKAROUNDS** exception category:
- It's a DMI-based hardware quirk for a specific laptop model
- The driver already exists and is functional
- This just adds hardware identification to enable proper audio configuration
- It's analogous to adding a new PCI/USB device ID to an existing driver

This is **NOT** adding a new feature - it's enabling existing functionality on hardware that needs explicit enumeration.

### 4. SCOPE AND RISK ASSESSMENT

**Risk: VERY LOW**
- **Scope**: Extremely minimal - 7 lines added to a quirk table
- **Isolation**: The change only affects ASUS M6500RE laptops - no other systems are impacted
- **Pattern**: Follows exact same pattern as dozens of other entries in the same table
- **No logic changes**: No behavioral changes to the driver code itself
- **No dependencies**: Self-contained change

Looking at the file, there are already many ASUS laptop entries in this table (M3402RA, M6400RC, M6500RC, M6501RM, etc.). The M6500RE is just another variant in the same product family.

### 5. USER IMPACT

**Impact: HIGH for affected users, ZERO risk for others**
- Users with ASUS M6500RE laptops currently have non-working internal microphones
- This is a significant functional issue (broken audio input)
- The fix enables basic hardware functionality that users expect
- No impact whatsoever on other systems (DMI match is very specific)

### 6. STABILITY INDICATORS

- **Maintainer review**: Signed off by Mark Brown, the ASoC subsystem maintainer
- **Well-tested pattern**: This exact quirk table pattern has been used hundreds of times
- **Low complexity**: The change is purely data (no code logic)

### 7. DEPENDENCY CHECK

- **No dependencies**: This is a standalone quirk entry
- **Code exists in stable**: The yc_acp_quirk_table and acp6x_card have been in the kernel since the Yellow Carp (AMD Rembrandt) audio support was added
- **Clean backport**: Will apply cleanly to any stable tree that has this driver

### Summary

This commit is a textbook example of what SHOULD be backported to stable:

1. **Fixes a real bug**: Non-working microphone on a specific laptop
2. **Obviously correct**: Follows established pattern exactly
3. **Small and contained**: 7 lines, single file, data-only change
4. **No new features**: Enables existing driver for additional hardware
5. **Zero risk of regression**: Only affects the specific ASUS M6500RE model
6. **Tested**: Presumably by the author who owns this hardware
7. **Maintainer approved**: Reviewed and merged by Mark Brown

This matches the "hardware quirks/workarounds" exception to the stable rules. These DMI/PCI/USB ID additions are routinely backported because they fix real hardware issues with essentially zero risk.

**YES**

 sound/soc/amd/yc/acp6x-mach.c | 7 +++++++
 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
index bf4d9d3365617..0294177acc663 100644
@@ -416,6 +416,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "M6500RC"),
 		}
 	},
+	{
+		.driver_data = &acp6x_card,
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "M6500RE"),
+		}
+	},
 	{
 		.driver_data = &acp6x_card,
 		.matches = {
Signature · 1 line
2.51.0
author maintainer
#2 lore raw

PATCH 1/1 ASoC: tlv320adcx140: Propagate error codes during probe

In reply to Sasha Levin

From: Dimitrios Katsaros <[email protected]>

[ Upstream commit d89aad92cfd15edbd704746f44c98fe687f9366f ]

When scanning for the reset pin, we could get an -EPROBE_DEFER. The driver would assume that no reset pin had been defined, which would mean that the chip would never be powered.

Now we both respect any error we get from devm_gpiod_get_optional. We also now properly report the missing GPIO definition when 'gpio_reset' is NULL.

---

LLM Generated explanations, may be completely bogus:

This confirms my analysis. In adcx140_reset(), the code checks if (adcx140->gpio_reset). An error pointer like -EPROBE_DEFER evaluates to TRUE (non-zero), so if the original code allowed an error pointer to be stored, this function would try to use an invalid descriptor - leading to a crash or undefined behavior.

## Analysis Summary

### 1. COMMIT MESSAGE ANALYSIS
- The commit message clearly explains the bug: -EPROBE_DEFER was being swallowed when getting the reset GPIO
- The consequence is that "the chip would never be powered" - this is a real functionality bug
- The fix properly propagates errors and only logs "missing GPIO" when the GPIO is actually NULL

### 2. CODE CHANGE ANALYSIS
**The Bug:**
- devm_gpiod_get_optional() can return error pointers (e.g., -EPROBE_DEFER)
- The original code only logged a message when IS_ERR() was true, but continued execution
- If -EPROBE_DEFER was returned, the driver would fail silently - the device would not work properly
- Worse, an error pointer would pass the if (adcx140->gpio_reset) check in adcx140_reset(), potentially causing crashes

**The Fix:**
- Properly returns errors from devm_gpiod_get_optional() using dev_err_probe()
- dev_err_probe() is the modern idiom that handles -EPROBE_DEFER cleanly (doesn't spam logs)
- The informational message is now correctly tied to !adcx140->gpio_reset (GPIO truly not defined)

### 3. CLASSIFICATION
- **Bug fix**: Yes - fixes improper error handling that causes device malfunction
- **Security**: No
- **New feature**: No - this is correcting existing broken behavior
- **Exception category**: Not a device ID/quirk/DT fix, but a standard bug fix

### 4. SCOPE AND RISK ASSESSMENT
- **Lines changed**: Only ~4 lines modified
- **Files touched**: 1 file (single audio codec driver)
- **Complexity**: Very low - straightforward error handling fix
- **Risk**: Very low - the change is localized and makes the code behave correctly
- **Subsystem**: ASoC codec driver (specific hardware, not core infrastructure)

### 5. USER IMPACT
- **Who is affected**: Users of TLV320ADCx140 family audio codecs (TI ADCs)
- **Severity**: Without this fix, the device may fail to initialize properly when GPIO provider isn't ready yet
- **Real-world impact**: The -EPROBE_DEFER case is common during early boot when GPIO controllers aren't yet initialized

### 6. STABILITY INDICATORS
- Has Signed-off-by from the patch author and subsystem maintainer (Mark Brown)
- Standard error handling pattern used in many other drivers

### 7. DEPENDENCY CHECK
- No dependencies on other commits
- The driver has existed since kernel 5.7 (added Feb 2020)
- This fix should apply cleanly to all stable kernels that have this driver

### Conclusion

This is an **excellent candidate for stable backport** because:
1. It fixes a real bug where -EPROBE_DEFER is swallowed, causing device initialization failure
2. The fix is small, surgical, and obviously correct
3. It uses the modern dev_err_probe() pattern that's standard across the kernel
4. Risk of regression is minimal - it only changes error handling to do the right thing
5. The bug has existed since the driver was introduced, affecting all users of this codec

**YES**

 sound/soc/codecs/tlv320adcx140.c | 3 +++
 1 file changed, 3 insertions(+)
sound/soc/codecs/tlv320adcx140.c +3 -0
index d594bf166c0e7..bcbc240248342 100644
@@ -1158,6 +1158,9 @@ static int adcx140_i2c_probe(struct i2c_client *i2c)
 	adcx140->gpio_reset = devm_gpiod_get_optional(adcx140->dev,
 						      "reset", GPIOD_OUT_LOW);
 	if (IS_ERR(adcx140->gpio_reset))
+		return dev_err_probe(&i2c->dev, PTR_ERR(adcx140->gpio_reset),
+				     "Failed to get Reset GPIO\n");
+	if (!adcx140->gpio_reset)
 		dev_info(&i2c->dev, "Reset GPIO not defined\n");
 
 	adcx140->supply_areg = devm_regulator_get_optional(adcx140->dev,
Signature · 1 line
2.51.0
author maintainer
#3 lore raw

PATCH 1/1 nvme-fc: release admin tagset if init fails

In reply to Sasha Levin

From: Chaitanya Kulkarni <[email protected]>

[ Upstream commit d1877cc7270302081a315a81a0ee8331f19f95c8 ]

nvme_fabrics creates an NVMe/FC controller in following path:

    nvmf_dev_write()
      -> nvmf_create_ctrl()
        -> nvme_fc_create_ctrl()
          -> nvme_fc_init_ctrl()

nvme_fc_init_ctrl() allocates the admin blk-mq resources right after nvme_add_ctrl() succeeds. If any of the subsequent steps fail (changing the controller state, scheduling connect work, etc.), we jump to the fail_ctrl path, which tears down the controller references but never frees the admin queue/tag set. The leaked blk-mq allocations match the kmemleak report seen during blktests nvme/fc.

Check ctrl->ctrl.admin_tagset in the fail_ctrl path and call nvme_remove_admin_tag_set() when it is set so that all admin queue allocations are reclaimed whenever controller setup aborts.

---

LLM Generated explanations, may be completely bogus:

This confirms the bug scenario in v6.6:
1. nvme_alloc_admin_tag_set() succeeds → admin tagset is allocated
2. nvme_change_ctrl_state() OR queue_delayed_work() fails
3. Code goes to fail_ctrl label
4. But fail_ctrl does NOT free the admin tagset → **MEMORY LEAK**

Now let me compile my analysis:

## ANALYSIS SUMMARY

### 1. COMMIT MESSAGE ANALYSIS
- **Subject:** "nvme-fc: release admin tagset if init fails"
- **Clear bug description:** The commit message clearly describes a memory leak scenario where admin blk-mq resources are not freed when controller initialization fails
- **Reported-by tag:** Yi Zhang from Red Hat reported this via kmemleak during blktests nvme/fc
- **Reviewed-by:** Justin Tee from Broadcom reviewed this
- **Testing evidence:** Discovered during blktests, so reproducible

### 2. CODE CHANGE ANALYSIS
The fix is a 2-line addition:

```c
if (ctrl->ctrl.admin_tagset)
    nvme_remove_admin_tag_set(&ctrl->ctrl);
```

**Bug mechanism:**
1. nvme_fc_init_ctrl() allocates admin tagset after nvme_init_ctrl() succeeds
2. If subsequent operations (state change, work scheduling) fail, code jumps to fail_ctrl
3. The fail_ctrl path tears down controller references but never frees the admin tagset
4. Result: Memory leak of blk-mq admin queue allocations

**Why the fix is correct:**
- The conditional check if (ctrl->ctrl.admin_tagset) ensures the cleanup only runs if the allocation occurred
- nvme_remove_admin_tag_set() properly cleans up all admin queue resources
- Placement is correct - before nvme_uninit_ctrl() which does the reference counting teardown

### 3. CLASSIFICATION
- **Type:** Bug fix (memory leak)
- **Category:** Resource leak in error path
- **Not a feature:** Does not add functionality, only fixes cleanup in error path

### 4. SCOPE AND RISK ASSESSMENT
- **Lines changed:** 2 lines added
- **Files changed:** 1 file (drivers/nvme/host/fc.c)
- **Complexity:** Very low - simple conditional cleanup
- **Risk:** Very low - only affects error path, adds proper cleanup that was missing
- **Subsystem:** NVMe FC driver, mature subsystem

### 5. USER IMPACT
- **Who is affected:** Users of NVMe over Fibre Channel
- **Severity:** Memory leak that can exhaust kernel memory over time with repeated connection failures
- **Reproducibility:** Reproducible via blktests nvme/fc
- **Discovery:** Found via kmemleak, indicating real-world impact

### 6. STABILITY INDICATORS
- **Reviewed-by:** Yes (Justin Tee from Broadcom)
- **Reported-by:** Yes (Yi Zhang from Red Hat)
- **Tested:** Implicitly through blktests discovery
- **Signed-off-by:** Keith Busch (NVMe maintainer)

### 7. DEPENDENCY CHECK
- **Function dependency:** Requires nvme_remove_admin_tag_set() which exists in kernels v6.1+
- **For v5.10/v5.15/v6.0:** Would need adaptation (manual cleanup instead of helper function)
- **Structural dependency:** The code structure (admin tagset allocation → fail_ctrl path) needs to exist

### BACKPORTABILITY

**For kernels 6.1.y and later (v6.1+):**
- The commit applies cleanly
- The nvme_remove_admin_tag_set() helper exists
- Low risk, high value fix

**For kernels 5.10.y, 5.15.y, 6.0.y:**
- Would require modification - the helper function doesn't exist
- The fix would need to manually call the cleanup functions instead
- The code structure is different (admin tagset allocation may happen in different location)

### CONCLUSION

This is a classic stable kernel material:
- ✅ Fixes a real bug (memory leak in error path)
- ✅ Small, surgical fix (2 lines)
- ✅ Obviously correct (adds missing cleanup)
- ✅ Low risk (only affects error path)
- ✅ Has been reviewed and tested
- ✅ Discovered via automated testing (blktests/kmemleak)

The fix is appropriate for backporting to stable kernels that have the required infrastructure (v6.1+). For older kernels (v5.10, v5.15, v6.0), a modified version would need to be crafted.

**YES**

 drivers/nvme/host/fc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/nvme/host/fc.c +2 -0
index 8324230c53719..bf78faf1a4ffa 100644
@@ -3584,6 +3584,8 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
 
 	ctrl->ctrl.opts = NULL;
 
+	if (ctrl->ctrl.admin_tagset)
+		nvme_remove_admin_tag_set(&ctrl->ctrl);
 	/* initiate nvme ctrl ref counting teardown */
 	nvme_uninit_ctrl(&ctrl->ctrl);
 
Signature · 1 line
2.51.0
author maintainer
#4 lore raw

PATCH 1/1 dmaengine: mmp_pdma: Fix race condition in mmp_pdma_residue()

In reply to Sasha Levin

From: Guodong Xu <[email protected]>

[ Upstream commit a143545855bc2c6e1330f6f57ae375ac44af00a7 ]

Add proper locking in mmp_pdma_residue() to prevent use-after-free when accessing descriptor list and descriptor contents.

The race occurs when multiple threads call tx_status() while the tasklet on another CPU is freeing completed descriptors:

CPU 0 CPU 1
----- -----
mmp_pdma_tx_status()
mmp_pdma_residue()
-> NO LOCK held

     list_for_each_entry(sw, ..)
                                   DMA interrupt
                                   dma_do_tasklet()
                                     -> spin_lock(&desc_lock)
                                        list_move(sw->node, ...)
                                        spin_unlock(&desc_lock)

| dma_pool_free(sw) <- FREED!
-> access sw->desc <- UAF!

This issue can be reproduced when running dmatest on the same channel with multiple threads (threads_per_chan > 1).

Fix by protecting the chain_running list iteration and descriptor access with the chan->desc_lock spinlock.

---

LLM Generated explanations, may be completely bogus:

This confirms the mmp_pdma_residue() function was added in 2014. The race condition has existed since then.

## Analysis Summary

### 1. COMMIT MESSAGE ANALYSIS

The commit message clearly describes:
- A **use-after-free (UAF) race condition** in mmp_pdma_residue()
- The race occurs between tx_status() (calling mmp_pdma_residue()) and the DMA tasklet (dma_do_tasklet())
- **Clear reproduction steps**: running dmatest with threads_per_chan > 1
- The CPU timeline diagram explicitly shows the race window between unlocked list iteration and descriptor free

Keywords: "Fix race condition", "use-after-free", "UAF"

### 2. CODE CHANGE ANALYSIS

**The bug:** mmp_pdma_residue() iterates over chan->chain_running list and accesses descriptor contents (sw->desc) without holding the desc_lock spinlock. Meanwhile, dma_do_tasklet() can:
1. Hold desc_lock
2. Move descriptors from chain_running to chain_cleanup via list_move()
3. Release desc_lock
4. Free the descriptor via dma_pool_free()

If mmp_pdma_residue() is iterating over the list when this happens, it can access freed memory (UAF).

**The fix:** Adds spin_lock_irqsave(&chan->desc_lock, flags) before the list_for_each_entry() loop and spin_unlock_irqrestore() at all exit points from the function. This is:
- Small (+6 lines, -0 lines of actual logic)
- Surgical - uses the existing desc_lock that already protects this list elsewhere
- Follows existing driver patterns (other list operations use this lock)

### 3. CLASSIFICATION

This is a **bug fix** for a **use-after-free vulnerability**. This is a serious memory safety issue:
- Can cause kernel crashes/panics
- Can lead to data corruption
- Potential security implications (UAF bugs are commonly exploitable)

### 4. SCOPE AND RISK ASSESSMENT

- **Lines changed**: ~10 lines (just adding lock/unlock around existing code)
- **Files touched**: 1 file
- **Complexity**: Very low - straightforward spinlock acquisition
- **Risk of regression**: Minimal - uses existing lock that is designed for this purpose
- **Potential issues**: Slightly increased lock contention when calling tx_status(), but this is necessary for correctness

### 5. USER IMPACT

- **Who is affected**: Users of MMP PDMA DMA controller (Marvell PXA/MMP platforms, SpacemiT K1)
- **Trigger conditions**: Multi-threaded DMA operations on same channel (common in dmatest, may occur in real workloads)
- **Severity**: High - UAF can cause kernel crashes or undefined behavior
- **Reproducibility**: Can be reproduced with dmatest (`threads_per_chan

Quoted 1 line

1`)

### 6. STABILITY INDICATORS

- Has proper sign-offs: Signed-off-by from author, forwarder, and DMA maintainer (Vinod Koul)
- Link to mailing list discussion included
- The existing lock (desc_lock) has been in the driver since the beginning
- The locking pattern matches other functions in the driver

### 7. DEPENDENCY CHECK

- No dependencies on other commits
- The affected code (mmp_pdma_residue()) has existed since 2014
- The desc_lock spinlock exists in all stable trees
- Should apply cleanly to any kernel from 3.15+ (when residue reporting was added)

**Note**: Recent mainline commits added SpacemiT K1 support with 64-bit operations (pdev->ops->get_desc_dst_addr, etc.), but the core logic and the race condition existed with the original 32-bit implementation too. For older stable trees (pre-6.x), minor context adjustments might be needed due to the pdev->ops-> refactoring, but the fix concept remains the same.

### Conclusion

This commit fixes a clear **use-after-free race condition** in the MMP PDMA driver. The bug:
- Can cause kernel crashes/panics
- Has existed since 2014 (when residue reporting was added)
- Is reproducible with standard kernel testing tools (dmatest)

The fix:
- Is small and surgical (~10 lines of spinlock additions)
- Uses existing infrastructure (the desc_lock already exists for this purpose)
- Follows existing driver patterns
- Has minimal regression risk

This is exactly the type of fix stable trees need: a clearly correct fix for a real bug that users can hit, with minimal risk of introducing new problems.

**YES**

 drivers/dma/mmp_pdma.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/dma/mmp_pdma.c +6 -0
index d07229a748868..481b58c414e47 100644
@@ -928,6 +928,7 @@ static unsigned int mmp_pdma_residue(struct mmp_pdma_chan *chan,
 {
 	struct mmp_pdma_desc_sw *sw;
 	struct mmp_pdma_device *pdev = to_mmp_pdma_dev(chan->chan.device);
+	unsigned long flags;
 	u64 curr;
 	u32 residue = 0;
 	bool passed = false;
@@ -945,6 +946,8 @@ static unsigned int mmp_pdma_residue(struct mmp_pdma_chan *chan,
 	else
 		curr = pdev->ops->read_src_addr(chan->phy);
 
+	spin_lock_irqsave(&chan->desc_lock, flags);
+
 	list_for_each_entry(sw, &chan->chain_running, node) {
 		u64 start, end;
 		u32 len;
@@ -989,6 +992,7 @@ static unsigned int mmp_pdma_residue(struct mmp_pdma_chan *chan,
 			continue;
 
 		if (sw->async_tx.cookie == cookie) {
+			spin_unlock_irqrestore(&chan->desc_lock, flags);
 			return residue;
 		} else {
 			residue = 0;
@@ -996,6 +1000,8 @@ static unsigned int mmp_pdma_residue(struct mmp_pdma_chan *chan,
 		}
 	}
 
+	spin_unlock_irqrestore(&chan->desc_lock, flags);
+
 	/* We should only get here in case of cyclic transactions */
 	return residue;
 }
Signature · 1 line
2.51.0
author maintainer
#5 lore raw

PATCH 1/1 ASoC: davinci-evm: Fix reference leak in davinci_evm_probe

In reply to Sasha Levin

From: Kery Qi <[email protected]>

[ Upstream commit 5b577d214fcc109707bcb77b4ae72a31cfd86798 ]

The davinci_evm_probe() function calls of_parse_phandle() to acquire device nodes for "ti,audio-codec" and "ti,mcasp-controller". These functions return device nodes with incremented reference counts.

However, in several error paths (e.g., when the second of_parse_phandle(), snd_soc_of_parse_card_name(), or devm_snd_soc_register_card() fails), the function returns directly without releasing the acquired nodes, leading to reference leaks.

This patch adds an error handling path 'err_put' to properly release the device nodes using of_node_put() and clean up the pointers when an error occurs.

---

LLM Generated explanations, may be completely bogus:

So the device_get_match_data() change landed in v6.10. For stable trees 6.9 and earlier, the code would use the older of_match_device() pattern, which might require a slightly different patch.

Let me analyze the full technical aspects of this fix:

## Technical Analysis

### The Bug
The davinci_evm_probe() function calls of_parse_phandle() twice:
1. dai->codecs->of_node = of_parse_phandle(np, "ti,audio-codec", 0);
2. dai->cpus->of_node = of_parse_phandle(np, "ti,mcasp-controller", 0);

of_parse_phandle() returns a device node with an incremented reference count. The kernel's device tree code uses reference counting to track how many pointers refer to each node. If references are not released with of_node_put(), the nodes can never be freed, causing a memory leak.

### Error Paths with the Leak
In the original code, if any of these fail after acquiring one or both nodes:
- Second of_parse_phandle() call fails → codecs->of_node leaked
- snd_soc_of_parse_card_name() fails → both nodes leaked
- devm_clk_get() returns -EPROBE_DEFER → both nodes leaked
- devm_kzalloc() fails → both nodes leaked
- of_property_read_u32() fails without mclk → both nodes leaked
- devm_snd_soc_register_card() fails → both nodes leaked

### The Fix
The fix:
1. Converts all early returns to goto err_put
2. Adds proper cleanup label that calls of_node_put() on both nodes
3. Nullifies the pointers after release (defensive programming)

### Impact Assessment
- **Severity**: Low to Medium. This is a memory leak, not a crash or data corruption. The leak only occurs on error paths during probe.
- **Scope**: The TI DAVINCI EVM audio driver. This is an older driver for TI DaVinci SoC platforms, a relatively niche embedded hardware.
- **Trigger**: The leak happens when probe fails - i.e., when there's something wrong with the device tree or when resources are unavailable.
- **User Impact**: Repeated probe failures (e.g., due to misconfiguration or module load/unload cycles) could accumulate leaked memory over time.

### Risk Assessment
- **Low risk**: The change is surgical - it only adds error handling paths
- **Well-understood pattern**: of_node_put() cleanup is a very common kernel pattern
- **Doesn't change success path behavior**: The normal successful probe path is unchanged except for adding return ret; instead of falling through

### Backport Considerations
- For stable kernels >= 6.10: The patch should apply cleanly (uses device_get_match_data())
- For stable kernels < 6.10: The patch would need adjustment since those use of_match_device() pattern instead

**Conclusion:**

This is a legitimate bug fix that addresses a memory leak in error paths. The fix is:
1. Small and contained
2. Uses a well-understood kernel pattern
3. Fixes a real resource leak bug
4. Low risk (only affects error paths)
5. Properly tested (merged by maintainer Mark Brown)

However, the bug is relatively minor:
- Only affects niche TI DAVINCI EVM hardware
- Only leaks memory on probe failure (error paths)
- The leak is small (device tree node references)

This type of reference leak fix is commonly backported to stable trees. The pattern is well-established and the fix is straightforward. The main concern is whether it will apply cleanly to older stable trees that don't have the device_get_match_data() change, but that's a backport logistics issue, not a reason to reject it.

**YES**

 sound/soc/ti/davinci-evm.c | 39 ++++++++++++++++++++++++++++++--------
 1 file changed, 31 insertions(+), 8 deletions(-)
sound/soc/ti/davinci-evm.c +31 -8
index 2a2f5bc95576e..a55a369ce71c2 100644
@@ -193,27 +193,32 @@ static int davinci_evm_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	dai->cpus->of_node = of_parse_phandle(np, "ti,mcasp-controller", 0);
-	if (!dai->cpus->of_node)
-		return -EINVAL;
+	if (!dai->cpus->of_node) {
+		ret = -EINVAL;
+		goto err_put;
+	}
 
 	dai->platforms->of_node = dai->cpus->of_node;
 
 	evm_soc_card.dev = &pdev->dev;
 	ret = snd_soc_of_parse_card_name(&evm_soc_card, "ti,model");
 	if (ret)
-		return ret;
+		goto err_put;
 
 	mclk = devm_clk_get(&pdev->dev, "mclk");
 	if (PTR_ERR(mclk) == -EPROBE_DEFER) {
-		return -EPROBE_DEFER;
+		ret = -EPROBE_DEFER;
+		goto err_put;
 	} else if (IS_ERR(mclk)) {
 		dev_dbg(&pdev->dev, "mclk not found.\n");
 		mclk = NULL;
 	}
 
 	drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
-	if (!drvdata)
-		return -ENOMEM;
+	if (!drvdata) {
+		ret = -ENOMEM;
+		goto err_put;
+	}
 
 	drvdata->mclk = mclk;
 
@@ -223,7 +228,8 @@ static int davinci_evm_probe(struct platform_device *pdev)
 		if (!drvdata->mclk) {
 			dev_err(&pdev->dev,
 				"No clock or clock rate defined.\n");
-			return -EINVAL;
+			ret = -EINVAL;
+			goto err_put;
 		}
 		drvdata->sysclk = clk_get_rate(drvdata->mclk);
 	} else if (drvdata->mclk) {
@@ -239,8 +245,25 @@ static int davinci_evm_probe(struct platform_device *pdev)
 	snd_soc_card_set_drvdata(&evm_soc_card, drvdata);
 	ret = devm_snd_soc_register_card(&pdev->dev, &evm_soc_card);
 
-	if (ret)
+	if (ret) {
 		dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
+		goto err_put;
+	}
+
+	return ret;
+
+err_put:
+	dai->platforms->of_node = NULL;
+
+	if (dai->cpus->of_node) {
+		of_node_put(dai->cpus->of_node);
+		dai->cpus->of_node = NULL;
+	}
+
+	if (dai->codecs->of_node) {
+		of_node_put(dai->codecs->of_node);
+		dai->codecs->of_node = NULL;
+	}
 
 	return ret;
 }
Signature · 1 line
2.51.0
author maintainer
#6 lore raw

PATCH 1/1 nvmet-tcp: fixup hang in nvmet_tcp_listen_data_ready()

In reply to Sasha Levin

From: Hannes Reinecke <[email protected]>

[ Upstream commit 2fa8961d3a6a1c2395d8d560ffed2c782681bade ]

When the socket is closed while in TCP_LISTEN a callback is run to flush all outstanding packets, which in turns calls nvmet_tcp_listen_data_ready() with the sk_callback_lock held. So we need to check if we are in TCP_LISTEN before attempting to get the sk_callback_lock() to avoid a deadlock.

---

LLM Generated explanations, may be completely bogus:

Let me understand the context of the commit better - it might be that the commit requires a minor adjustment for backport since it uses nvmet_wq but in the current tree (and stable trees), the workqueue is called nvmet_tcp_wq. Looking at the diff more carefully:

The diff shows:

```c
+       if (port)
                queue_work(nvmet_wq, &port->accept_work);
```

Wait, the space before queue_work in the diff context shows this is the EXISTING code (no + sign). But wait, looking at the current code:

```c
schedule_work(&port->accept_work);
```

So there's a discrepancy. The commit I'm analyzing might be from a tree where schedule_work was changed to queue_work(nvmet_wq, ...) in another commit.

For the purpose of backporting analysis, the KEY FIX is:
1. **Check sk->sk_state != TCP_LISTEN BEFORE acquiring the lock** - this is the essential fix for the deadlock
2. The change from schedule_work to queue_work(nvmet_wq, ...) is secondary

For stable backports, minor adjustments may be needed (using schedule_work instead of queue_work(nvmet_wq, ...)), but the core fix (early state check before lock acquisition) is applicable.

## SUMMARY

**What the commit fixes**: A deadlock that occurs when nvmet_tcp_listen_data_ready() is called during socket cleanup with sk_callback_lock already held. The fix checks the socket state before acquiring the lock.

**Why it matters for stable users**: This is a deadlock/hang that can occur during NVMe-over-TCP disconnect scenarios. Systems using NVMe- over-TCP will hang, requiring a hard reset.

**Meets stable kernel rules**:
- Obviously correct: Yes - simple early return check before lock acquisition
- Fixes a real bug: Yes - deadlock reported and reproduced via blktests
- Small scope: Yes - 10 lines changed in one function
- No new features: Correct - pure bug fix
- Tested: Yes - "Tested-by" tag from Red Hat QE

**Risk assessment**: Very low. The fix simplifies the logic and cannot cause regression.

**Dependencies/Backport notes**: The commit uses queue_work(nvmet_wq, ...) but older stable trees use schedule_work(&port->accept_work). A minor adjustment may be needed for clean backport, but the essential fix (early state check) applies cleanly.

**YES** - This is a clear deadlock fix that should be backported to stable kernels. The commit:
1. Fixes a real, reproducible deadlock
2. Is minimal and obviously correct
3. Has been tested and reviewed
4. Affects users of NVMe-over-TCP (a production storage protocol)
5. Has very low regression risk

**YES**

 drivers/nvme/target/tcp.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/nvme/target/tcp.c +4 -5
index 470bf37e5a637..2e9a3e698b700 100644
@@ -1992,14 +1992,13 @@ static void nvmet_tcp_listen_data_ready(struct sock *sk)
 
 	trace_sk_data_ready(sk);
 
+	if (sk->sk_state != TCP_LISTEN)
+		return;
+
 	read_lock_bh(&sk->sk_callback_lock);
 	port = sk->sk_user_data;
-	if (!port)
-		goto out;
-
-	if (sk->sk_state == TCP_LISTEN)
+	if (port)
 		queue_work(nvmet_wq, &port->accept_work);
-out:
 	read_unlock_bh(&sk->sk_callback_lock);
 }
 
Signature · 1 line
2.51.0
author maintainer
#7 lore raw

PATCH 1/1 ASoC: simple-card-utils: Check device node before overwrite direction

In reply to Sasha Levin

From: Shengjiu Wang <[email protected]>

[ Upstream commit 22a507d7680f2c3499c133f6384349f62f916176 ]

Even the device node don't exist, the graph_util_parse_link_direction() will overwrite the playback_only and capture_only to be zero. Which cause the playback_only and capture_only are not correct, so check device node exist or not before update the value.

---

LLM Generated explanations, may be completely bogus:

The commit seems to be describing a new patch to be analyzed. Based on my full analysis, let me now synthesize my evaluation:

## ANALYSIS SUMMARY

### 1. COMMIT MESSAGE ANALYSIS

The commit message describes a bug where:
- When a device node doesn't exist (is NULL), the graph_util_parse_link_direction() function still overwrites playback_only and capture_only to zero (false)
- This causes incorrect behavior when these flags should remain as they were set by previous calls

The commit has:
- **Acked-by:** from the subsystem maintainer (Kuninori Morimoto)
- **Signed-off-by:** from the maintainer (Mark Brown)

### 2. CODE CHANGE ANALYSIS

**The Bug:**
Looking at the function:

```c
void graph_util_parse_link_direction(struct device_node *np,
                    bool *playback_only, bool *capture_only)
{
    bool is_playback_only = of_property_read_bool(np, "playback-only");
    bool is_capture_only  = of_property_read_bool(np, "capture-only");

    if (playback_only)
        *playback_only = is_playback_only;
    if (capture_only)
        *capture_only = is_capture_only;
}
```

When np is NULL:
1. of_property_read_bool(NULL, ...) returns false (since NULL node has no properties)
2. The function unconditionally overwrites *playback_only = false and *capture_only = false

**Call Pattern (from simple-card.c and audio-graph-card.c):**

```c
graph_util_parse_link_direction(top,    &playback_only, &capture_only);
graph_util_parse_link_direction(node,   &playback_only, &capture_only);
graph_util_parse_link_direction(cpu,    &playback_only, &capture_only);
graph_util_parse_link_direction(codec,  &playback_only, &capture_only);
```

The intent is hierarchical: if top sets playback_only = true, it should remain true unless a lower-level node explicitly overrides it. But if cpu or codec is NULL, the current code wrongly resets playback_only to false.

**The Fix:**

```c
- if (playback_only)
+   if (np && playback_only)
        *playback_only = is_playback_only;
- if (capture_only)
+   if (np && capture_only)
        *capture_only = is_capture_only;
```

Adding np && check prevents the function from overwriting the values when np is NULL.

### 3. CLASSIFICATION

- **Bug fix:** Yes, clearly fixes a logic error
- **Security:** No security implications
- **Feature addition:** No

### 4. SCOPE AND RISK ASSESSMENT

- **Lines changed:** 2 (very minimal)
- **Files touched:** 1
- **Complexity:** Very low - adding a simple NULL check
- **Risk:** Very low - defensive programming that only affects behavior when np is NULL, which is already an edge case

### 5. USER IMPACT

- **Who is affected:** Users of ASoC simple-card and audio-graph-card drivers
- **Severity:** Audio routing could be incorrect (playback-only or capture-only configuration not being honored)
- **Visibility:** Users with device trees that set playback-only or capture-only on higher-level nodes where some lower-level nodes don't exist

### 6. STABILITY INDICATORS

- **Acked-by:** Kuninori Morimoto (maintainer of the code)
- **Signed-off-by:** Mark Brown (ASoC subsystem maintainer)

### 7. DEPENDENCY CHECK

- The function exists in stable trees starting from v6.10 (introduced in commit d29351e8c20d61)
- The fix applies cleanly and has no dependencies on other commits

### 8. FINAL ASSESSMENT

This is a clear, minimal, and well-reviewed bug fix that:
1. Fixes a real bug that causes incorrect audio configuration
2. Is small and surgical (2-line change with simple NULL check)
3. Has low regression risk (only affects edge case of NULL np)
4. Has been reviewed and acked by the appropriate maintainers
5. Would apply cleanly to stable trees (v6.10+) where this function exists

The fix is small, surgical, and meets all stable kernel criteria.

**YES**

 sound/soc/generic/simple-card-utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/generic/simple-card-utils.c +2 -2
index 355f7ec8943c2..bdc02e85b089f 100644
@@ -1179,9 +1179,9 @@ void graph_util_parse_link_direction(struct device_node *np,
 	bool is_playback_only = of_property_read_bool(np, "playback-only");
 	bool is_capture_only  = of_property_read_bool(np, "capture-only");
 
-	if (playback_only)
+	if (np && playback_only)
 		*playback_only = is_playback_only;
-	if (capture_only)
+	if (np && capture_only)
 		*capture_only = is_capture_only;
 }
 EXPORT_SYMBOL_GPL(graph_util_parse_link_direction);
Signature · 1 line
2.51.0
author maintainer
#8 lore raw

PATCH 1/1 ASoC: Intel: sof_sdw: Add new quirks for PTL on Dell with CS42L43

In reply to Sasha Levin

From: Deep Harsora <[email protected]>

[ Upstream commit 12cacdfb023d1b2f6c4e5af471f2d5b6f0cbf909 ]

Add missing quirks for some new Dell laptops using cs42l43's speaker outputs.

---

LLM Generated explanations, may be completely bogus:

### SUMMARY

**What problem does this commit solve?**
- It enables audio speaker functionality on new Dell laptops (Panther Lake platform, SKU 0DD6) using the CS42L43 codec with sidecar amplifiers
- Without this quirk, the speakers on these specific Dell laptops won't work properly

**Does it meet stable kernel rules?**
1. ✅ Obviously correct - follows exact same pattern as dozens of existing entries
2. ✅ Fixes a real bug - missing hardware support (no working speakers)
3. ✅ Important issue - users can't use their laptop speakers without it
4. ✅ Small and contained - 8 lines, single file, static data only
5. ✅ No new features - uses existing quirk infrastructure
6. ✅ Applies cleanly - follows existing patterns

**Risk vs benefit trade-off:**
- **Risk**: Near zero. The quirk only matches specific Dell hardware via DMI. Other systems are completely unaffected.
- **Benefit**: High for affected Dell users - working audio vs. broken audio

**Concerns:**
- This can only be backported to 6.12.y stable (where SOC_SDW_SIDECAR_AMPS exists)
- No dependencies within this commit - it's a self-contained table entry addition

**Conclusion:**
This is a textbook example of a hardware quirk addition that should be backported to stable. It's:
- A trivial, low-risk addition (static data in a quirk table)
- Enables hardware that wouldn't otherwise work
- Falls squarely into the "quirks and workarounds" exception category
- Follows the exact pattern of many other similar entries that have been added for Dell/Lenovo/ASUS/Google devices

The fix is small, surgical, and meets all stable kernel criteria for the quirk exception.

**YES**

 sound/soc/intel/boards/sof_sdw.c | 8 ++++++++
 1 file changed, 8 insertions(+)
sound/soc/intel/boards/sof_sdw.c +8 -0
index c013e31d098e7..92fac7ed782f7 100644
@@ -750,6 +750,14 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
 		.driver_data = (void *)(SOC_SDW_CODEC_SPKR),
 	},
 	/* Pantherlake devices*/
+	{
+		.callback = sof_sdw_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
+			DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0DD6")
+		},
+		.driver_data = (void *)(SOC_SDW_SIDECAR_AMPS),
+	},
 	{
 		.callback = sof_sdw_quirk_cb,
 		.matches = {
Signature · 1 line
2.51.0
author maintainer
#9 lore raw

PATCH 1/1 ALSA: hda/tas2781: Add newly-released HP laptop

In reply to Sasha Levin

From: Shenghao Ding <[email protected]>

[ Upstream commit 46b8d0888f01f250fbd24d00ff80b755c3c42cd4 ]

HP released the new laptop with the subid 0x103C.

---

LLM Generated explanations, may be completely bogus:

Now I have a complete picture. Let me summarize the analysis:

## Analysis Summary

### 1. COMMIT MESSAGE ANALYSIS

The commit is titled "ALSA: hda/tas2781: Add newly-released HP laptop" with subsystem ID 0x103C. This is a straightforward hardware enablement commit.

- No "Fixes:" tag (expected for commits requiring manual review)
- No "Cc: stable" tag (expected)
- The commit enables audio hardware for HP laptops with TAS2781 codec

### 2. CODE CHANGE ANALYSIS

The actual code change is extremely minimal:
1. **Copyright year update**: 2023 - 2025 → 2023 - 2026 (cosmetic, harmless)
2. **Addition of HP case in switch statement**: 3 lines added to recognize HP vendor ID 0x103C and set catlog_id = HP

The switch statement determines which EFI GUID to use for reading calibration data from UEFI. Without this case:
- HP laptops (subid 0x103C) fall into the default case and get catlog_id = LENOVO
- This means they use the LENOVO EFI GUID instead of the correct HP EFI GUID
- Calibration data wouldn't be found or would be incorrect

**Root cause**: Missing vendor ID case means the driver uses the wrong EFI GUID for calibration data, leading to audio calibration failures on HP laptops.

### 3. CLASSIFICATION

This is a **device ID/vendor ID addition** to an existing driver - one of the explicit exceptions listed in the stable kernel rules. This falls squarely into the "NEW DEVICE IDs" category:
- Adding a vendor/subsystem ID (0x103C for HP)
- The driver already exists and supports the TAS2781 codec
- HP support infrastructure (enum value, EFI GUID) already exists
- Only the vendor ID recognition is missing

### 4. SCOPE AND RISK ASSESSMENT

**Lines changed**: 4 (3 functional lines + 1 cosmetic copyright update) **Files touched**: 1 (tas2781_hda_i2c.c)
**Complexity**: Extremely low - simple switch case addition **Risk**: Minimal - only affects HP laptops (subid 0x103C); other laptops unaffected

### 5. USER IMPACT

- **Who is affected**: Users with HP laptops containing TAS2781 audio codecs
- **Severity**: Without this fix, HP laptop audio may not work properly due to incorrect calibration data retrieval
- **Impact of change**: Enables proper audio on new HP hardware

### 6. STABILITY INDICATORS

- Signed off by the original driver author (Shenghao Ding)
- Accepted by ALSA maintainer (Takashi Iwai)
- Simple, obvious change with clear purpose

### 7. DEPENDENCY CHECK

**Critical consideration**: The commit applies to file sound/hda/codecs/side-codecs/tas2781_hda_i2c.c which is a NEW location
- the file was moved in commit 6014e9021b28e ("ALSA: hda: Move codec drivers into sound/hda/codecs directory").

Checking stable trees:
- **6.16.y**: Has all infrastructure (HP enum, HP EFI GUID, file in old location sound/pci/hda/). The patch could apply with path adjustment.
- **6.15.y and older**: Do NOT have HP support infrastructure - the device_catlog_id enum only has LENOVO=0 and OTHERS. No HP enum value, no HP EFI GUID. **Backporting is NOT possible without significant additional commits.**

### 8. BACKPORT FEASIBILITY

For **6.16.y stable**: The commit should be backported, but requires path adjustment (sound/hda/codecs/side-codecs/ → sound/pci/hda/). All necessary infrastructure exists.

For **6.15.y and older**: NOT suitable for backport. Would require backporting the entire HP infrastructure:
- The HP enum value
- The HP EFI GUID
- Possibly other architectural changes

The commit itself is clearly stable-worthy (device ID addition to existing driver), but its applicability is limited to kernels that already have the HP support infrastructure.

### Conclusion

This commit is a textbook example of a stable-appropriate change: a simple vendor ID addition to an existing driver that enables hardware support. It's small (3 functional lines), obviously correct, low risk, and addresses a real user issue (HP laptops not working properly with TAS2781 audio).

However, the backport is only applicable to kernels 6.16+ where the HP infrastructure already exists. For older kernels, this would require additional prerequisite commits.

**YES**

 sound/hda/codecs/side-codecs/tas2781_hda_i2c.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c +4 -1
index f7a7f216d5865..3da1f138a191c 100644
@@ -2,7 +2,7 @@
 //
 // TAS2781 HDA I2C driver
 //
-// Copyright 2023 - 2025 Texas Instruments, Inc.
+// Copyright 2023 - 2026 Texas Instruments, Inc.
 //
 // Author: Shenghao Ding <[email protected]>
 // Current maintainer: Baojun Xu <[email protected]>
@@ -568,6 +568,9 @@ static int tas2781_hda_bind(struct device *dev, struct device *master,
 	case 0x1028:
 		tas_hda->catlog_id = DELL;
 		break;
+	case 0x103C:
+		tas_hda->catlog_id = HP;
+		break;
 	default:
 		tas_hda->catlog_id = LENOVO;
 		break;
Signature · 1 line
2.51.0