Skip to content

Increase max number of input pins to 22 - #64

Open
brniederberger wants to merge 1 commit into
leifliddy:masterfrom
brniederberger:Increase-auto_cfg_max_ins
Open

Increase max number of input pins to 22#64
brniederberger wants to merge 1 commit into
leifliddy:masterfrom
brniederberger:Increase-auto_cfg_max_ins

Conversation

@brniederberger

Copy link
Copy Markdown

Driver crashing on Ubuntu 26.04 Kernel 7.0.

The driver compiles correctly but when loaded, the input pin auto config reports 22 pins but the maximum allowable number is 18 causing an out of bounds stack trace upon access when UBSAN (UndefinedBehaviorSanitizer) is enabled like in Ubuntu 26.04.

Patch modifies hda_auto_parser.h to increase AUTO_CFG_MAX_INS to 22 to allow for the additional pins. AUTO_CFG_MAX_INS is 8 for kernel 5.0 - 5.12, and 18 for kernel 5.13+. The sed edit will work for either value and allows driver to load.

Example error before modification:
------------[ cut here ]------------
UBSAN: array-index-out-of-bounds in /build/linux-zi5WOl/linux-7.0.0/sound/hda/codecs/generic.c:1510:24
index 21 is out of range for type 'auto_pin_cfg_item [18]'
CPU: 3 UID: 0 PID: 1300 Comm: modprobe Tainted: G OE 7.0.0-29-generic #29-Ubuntu PREEMPT(lazy)
Tainted: [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
Hardware name: Apple Inc. MacBook10,1/Mac-EE2EBD4B90B839A8, BIOS 529.140.2.0.0 06/23/2024
Call Trace:
show_stack+0x49/0x60
dump_stack_lvl+0x5f/0x90
dump_stack+0x10/0x18
ubsan_epilogue+0x9/0x39
etc.

@leifliddy

Copy link
Copy Markdown
Owner

I see that your commit increases the AUTO_CFG_MAX_INS value from 18 --> 22

-#define AUTO_CFG_MAX_INS 18
+#define AUTO_CFG_MAX_INS 22

On my system, I never received any "UBSAN: array-index-out-of-bounds in ....index 21 is out of range for type....'auto_pin_cfg_item [18]'" error messages.

**I'm runing Fedora 44 w/ kernel 7.1.9-200.fc44.x86_64 (MacBook 9,1)

When I apply your PR, system sound (ie speaker + headphone audio) stops working for me.

I can't approve a PR that breaks the functionality this project was meant to fix.

Perhaps you can find out why your system requires the value of AUTO_CFG_MAX_INS to be set to 22.
Is this an Ubuntu-specific thing? Are you running a custom-system of sorts?
We need to find what's different with your system and then create a conditional statement that checks for that condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants