leifliddy / macbook12-audio-driver

WIP audio driver for the cs4208 codec found in the 12" MacBook (MacBook9,1, MacBook10,1).
89 stars 9 forks source link

Build Fails on Recent Linux Kernel #29

Closed x5444 closed 5 months ago

x5444 commented 6 months ago

Just a quick note, as of recently (Kernel 6.8.0 maybe?) the build fails because strlcpy is no longer defined.

I don't have time to fix this properly, replacing one instance of strlcpy with strcpy is enough to make it build and work again.

My best guess is some include was removed from the original source file in the kernel that the patch is injected into. I didn't investigate it and I'm not going to.

diff --git a/patch_cirrus/patch_cirrus_a1534_pcm.h b/patch_cirrus/patch_cirrus_a1534_pcm.h index 9ecaaa9..d8b853e 100644 --- a/patch_cirrus/patch_cirrus_a1534_pcm.h +++ b/patch_cirrus/patch_cirrus_a1534_pcm.h @@ -120,7 +120,7 @@ static void cs_4208_fill_pcm_stream_name(char str, size_t len, const char sfx,

if (*str) return;

  • strlcpy(str, chip_name, len);
  • strcpy(str, chip_name);

    / drop non-alnum chars after a space / for (p = strchr(str, ' '); p; p = strchr(p + 1, ' ')) {

Note that this likely introduces a buffer overflow vulnerability in the kernel.

leifliddy commented 6 months ago

Thanks. I'll look into it this week.

leifliddy commented 5 months ago

Issue was resolved with: https://github.com/leifliddy/macbook12-audio-driver/commit/ef570d7a4f5c4b0c188725e73429cb5d86e0c551