ROCK-Kernel-Driver icon indicating copy to clipboard operation
ROCK-Kernel-Driver copied to clipboard

Support for Linux kernel >= 6.8.0-44

Open SamuelMarks opened this issue 1 year ago • 4 comments

Related https://github.com/ROCm/ROCm/issues/3701 and thanks to @kswit for the reference and @alain-bkr for the solution.

I have guarded the code so it doesn't break older kernel versions.

Checking https://packages.ubuntu.com/noble/all/linux-headers-6.8.0-41/download, particularly the Makefile it is not clear what the version is. I can add a runtime uname usage if you like. On my 6.8.0-41 for example, /usr/include/linux/version.h contains #define LINUX_VERSION_CODE 395276. In Alpine in Docker with 6.6-r0 of linux-headers apk on that same base, I get #define LINUX_VERSION_CODE 394752. Pretty sure this version restriction in the PR is sufficient, but keep this comment in mind; happy to change the version.

SamuelMarks avatar Sep 15 '24 21:09 SamuelMarks

i wonder if this is a ubuntu specific problem, as they choose 6.8 kernel (sadly not a LTS one) , picked some patch in -44 and thus break their partner's code !

The bug is also reported on ubuntu, as it is their change that caused the bug in 6.8.0 (but this will need to be fixed for future kernels)

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2080823

alain-bkr avatar Sep 16 '24 07:09 alain-bkr

Thanks for submitting this, though I wonder if this will still work with distributions outside of Ubuntu. I admit I don't know much about kernel development.

Wedge009 avatar Sep 17 '24 05:09 Wedge009

https://github.com/torvalds/linux/commit/5a507b7d2be15fddb95bf8dee01110b723e2bcd9 is where the change happened. It is additionally a security issue, see CVE-2024-39498, which makes me think this will be backported to older kernels.

The real question is what value of LINUX_VERSION_CODE should be used; or if a uname check should be added. Would prefer not to add the uname check because of the overhead that incurs. Alternatively this could be guarded a different way, e.g., at the Makefile level with a .patch file.

SamuelMarks avatar Sep 17 '24 16:09 SamuelMarks

We've got a KCL-based solution coming in the next release. I'll leave this open for now in case people want it as a workaround

kentrussell avatar Sep 19 '24 18:09 kentrussell