nvidia-331-uvm 331.20-0ubuntu1: nvidia-331-uvm kernel module failed to build [error: incompatible types when assigning to type ‘uid_t’ from type ‘kuid_t’]

Bug #1252664 reported by dino99
210
This bug affects 45 people
Affects Status Importance Assigned to Milestone
nvidia-graphics-drivers-331-updates (Ubuntu)
Fix Released
Undecided
Alberto Milone

Bug Description

Retry to install that package after having upgraded the apport package (dpkg-divert 'not found' fix)
and got that problem.

ProblemType: Package
DistroRelease: Ubuntu 14.04
Package: nvidia-331-uvm 331.20-0ubuntu1
ProcVersionSignature: Ubuntu 3.12.0-2.7-generic 3.12.0
Uname: Linux 3.12.0-2-generic i686
NonfreeKernelModules: nvidia
ApportVersion: 2.12.7-0ubuntu1
Architecture: i386
DKMSKernelVersion: 3.12.0-2-generic
Date: Tue Nov 19 10:12:54 2013
DuplicateSignature: dkms:nvidia-331-uvm:331.20-0ubuntu1:/var/lib/dkms/nvidia-331-uvm/331.20/build/nvidia_uvm_lite.c:1326:37: error: incompatible types when assigning to type ‘uid_t’ from type ‘kuid_t’
InstallationDate: Installed on 2013-10-25 (24 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release i386 (20131021.1)
PackageVersion: 331.20-0ubuntu1
SourcePackage: nvidia-graphics-drivers-331
Title: nvidia-331-uvm 331.20-0ubuntu1: nvidia-331-uvm kernel module failed to build
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
dino99 (9d9) wrote :
tags: removed: need-duplicate-check
Changed in nvidia-graphics-drivers-331 (Ubuntu):
status: New → Confirmed
summary: nvidia-331-uvm 331.20-0ubuntu1: nvidia-331-uvm kernel module failed to
- build
+ build [error: incompatible types when assigning to type ‘uid_t’ from
+ type ‘kuid_t’]
Revision history for this message
Mwahal (mwahal) wrote :

It works in 3.11.10 kernel.

Revision history for this message
Robin (robingape) wrote :

The module that fails to build is the uvm module. The nvidia-331-updates-331 module seems to build quite successfully, and produce the correct module.

affects: nvidia-graphics-drivers-331 (Ubuntu) → nvidia-graphics-drivers-331-updates (Ubuntu)
Revision history for this message
Robin (robingape) wrote :

Here is a recent make log from an affected machine. Is there any other diagnositic info that would help to resolve this issue?

Revision history for this message
Robin (robingape) wrote :

The uvm module is the one that fails to build.

Revision history for this message
dino99 (9d9) wrote :

Support for the latest kernels has been added with 331.20-0ubuntu8 driver into Trusty.

Changed in nvidia-graphics-drivers-331-updates (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Joseph Yasi (joe-yasi) wrote :

The buildfix_kernel_3.12.patch breaks building on vanilla 3.12 kernels. The module builds fine without it on 3.12.6

In file included from /var/lib/dkms/nvidia-331-updates-uvm/331.20/build/nvidia_uvm_common.h:49:0,
                 from /var/lib/dkms/nvidia-331-updates-uvm/331.20/build/nvidia_uvm_lite.c:26:
/var/lib/dkms/nvidia-331-updates-uvm/331.20/build/nvidia_uvm_lite.c: In function ‘uvmlite_open’:
/var/lib/dkms/nvidia-331-updates-uvm/331.20/build/nvidia_uvm_linux.h:395:70: error: request for member ‘val’ in something not a structure or union
     (((typeof(*current->cred) __force __kernel *)current->cred)->euid.val)
                                                                      ^
/var/lib/dkms/nvidia-331-updates-uvm/331.20/build/nvidia_uvm_lite.c:1326:39: note: in expansion of macro ‘NV_CURRENT_EUID’
     pUvmPrivate->processRecord.euid = NV_CURRENT_EUID();
                                       ^
make[3]: *** [/var/lib/dkms/nvidia-331-updates-uvm/331.20/build/nvidia_uvm_lite.o] Error 1

Revision history for this message
Joseph Yasi (joe-yasi) wrote :

So it looks like the buildfix_kernel_3.12.patch is missing a check for CONFIG_UIDGID_STRICT_TYPE_CHECKS. The change to kuid_t only happens if that config flag is enabled.

Revision history for this message
Joseph Yasi (joe-yasi) wrote :
Revision history for this message
Joseph Yasi (joe-yasi) wrote :

I dug through git, and kuid_t/kgid_t were introduced in kernel 3.5. The proper thing to do is to call __kuid_val(uid) to convert to uid_t on these kernels. The bug isn't a problem introduced with kernel 3.12. It is a problem with all kernels compiled with CONFIG_UIDGID_STRICT_TYPE_CHECKS. This patch should fix the problem for both cases.

Revision history for this message
Alberto Milone (albertomilone) wrote :

Nice catch.

While we're at it, instead of checking the kernel version, we can simply do #ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS and use __kuid_val (which in turn only does "return uid.val")

Changed in nvidia-graphics-drivers-331-updates (Ubuntu):
status: Fix Released → In Progress
assignee: nobody → Alberto Milone (albertomilone)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nvidia-graphics-drivers-331-updates - 331.20-0ubuntu9

---------------
nvidia-graphics-drivers-331-updates (331.20-0ubuntu9) trusty; urgency=low

  * debian/dkms_nvidia_uvm/patches/buildfix_kernel_3.12.patch:
    - Apparently the kuid change doesn't affect only Linux >= 3.12.
      Let's check CONFIG_UIDGID_STRICT_TYPE_CHECKS and act
      accordingly (LP: #1252664).
      Thanks to Joseph Yasi for spotting the problem and
      suggesting a fix.
 -- Alberto Milone <email address hidden> Thu, 09 Jan 2014 12:31:09 +0100

Changed in nvidia-graphics-drivers-331-updates (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Joseph Yasi (joe-yasi) wrote :

So the reason I decided to check for kernel version instead of CONFIG_UIDGID_STRICT_TYPE_CHECKS was for possible future proofing. If the kernel in the future fragments with yet another config option for kuid_t, they would likely implement another __kuid_val function for that, and the patch would still work. Granted, we aren't guaranteed that something else won't break in a kernel API change, so it probably doesn't matter.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.