<div dir="ltr"><div>To: <a href="mailto:1130057@bugs.debian.org">1130057@bugs.debian.org</a><br><br>Hello,<br><br>I am providing a detailed root cause analysis for this bug based on<br>direct inspection of the 550.163.01 source on a Debian trixie system.<br><br>== ROOT CAUSE ==<br><br>The problem is in conftest.sh, in the vm_area_struct_has_const_vm_flags<br>detection block (line 6529).<br><br>The conftest detects NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS by compiling:<br><br>    #include <linux/mm_types.h><br>    int conftest_vm_area_struct_has_const_vm_flags(void) {<br>        return offsetof(struct vm_area_struct, __vm_flags);<br>    }<br><br>In kernel 6.19, __vm_flags was removed from the vm_area_struct union,<br>so this compile test fails and NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS<br>is left undefined.<br><br>With that macro undefined, nv-mm.h evaluates nv_vm_flags_set() and<br>nv_vm_flags_clear() as follows:<br><br>    static inline void nv_vm_flags_set(struct vm_area_struct *vma,<br>                                       vm_flags_t flags)<br>    {<br>    #if !NV_CAN_CALL_VMA_START_WRITE<br>        nv_vma_start_write(vma);<br>        ACCESS_PRIVATE(vma, __vm_flags) |= flags;   /* FAILS on 6.19 */<br>    #elif defined(NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS)<br>        vm_flags_set(vma, flags);                   /* correct for 6.19 */<br>    #else<br>        vma->vm_flags |= flags;<br>    #endif<br>    }<br><br>NV_CAN_CALL_VMA_START_WRITE is defined in nv-mm.h based on whether<br>NV_IS_EXPORT_SYMBOL_GPL___vma_start_write is set. On Debian kernels<br>__vma_start_write is GPL-only, so NV_IS_EXPORT_SYMBOL_GPL___vma_start_write<br>is never set, NV_CAN_CALL_VMA_START_WRITE is always 0, and the first<br>branch is always taken — hitting the now-missing __vm_flags field.<br><br>The correct branch for kernel 6.19 is the second one (vm_flags_set),<br>but it is never reached because NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS<br>is undefined.<br><br>== FIX ==<br><br>Add a second compile test in the same case block in conftest.sh,<br>immediately after the existing one and before the ;; terminator.<br>The second test checks for vm_flags_set(). If it compiles, it defines<br>NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS to 1, overriding the previous<br>#undef. This is safe because append_conftest() writes sequentially<br>to stdout and the C preprocessor uses the last definition.<br><br>--- a/conftest.sh<br>+++ b/conftest.sh<br>@@ -6542,6 +6542,13 @@ vm_area_struct_has_const_vm_flags)<br>             }"<br>             compile_check_conftest "$CODE" \<br>                 "NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS" "" "types"<br>+            CODE="<br>+            #include <linux/mm_types.h><br>+            #include <linux/mm.h><br>+            void conftest_vm_flags_set_exists(struct vm_area_struct *vma) {<br>+                vm_flags_set(vma, (vm_flags_t)0);<br>+            }"<br>+            compile_check_conftest "$CODE" \<br>+                "NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS" "1" "types"<br>         ;;<br><br>== AFFECTED ==<br><br>nvidia-kernel-dkms 550.163.01-4 on Linux 6.19.6+deb14-amd64.<br>Linux <= 6.18 unaffected.<br><br>== NOTE ==<br><br>The 550 branch is required for Maxwell (GTX 900) and Pascal (GTX 1000)<br>GPUs which are not supported by the 575+ driver.<br><br>Regards</div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div style="text-align:left"></div></div></div></div>