Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 593624 - x11-drivers/nvidia-drivers-370.28 has an outdated pax_kernel patch
Summary: x11-drivers/nvidia-drivers-370.28 has an outdated pax_kernel patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-13 00:59 UTC by Romain Bezut
Modified: 2019-01-16 10:32 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Example pax patch for nvidia-drivers-370.28 (nvidia-drivers-370.28-pax.patch,21.27 KB, patch)
2016-09-13 00:59 UTC, Romain Bezut
Details | Diff
Example pax patch for nvidia-drivers-370.28 v2 (nvidia-drivers-370.28-pax.patch,15.29 KB, patch)
2016-09-13 01:11 UTC, Romain Bezut
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Romain Bezut 2016-09-13 00:59:54 UTC
Created attachment 445556 [details, diff]
Example pax patch for nvidia-drivers-370.28

The last version of nvidia-drivers (with pax_kernel use flag) tries to apply an outdated pax patch, resulting in compilation errors due to driver internal changes.


I've attached an example patch for 370.28 I made that makes it compiles again.
While this patch is not perfect (and I may still have missed some subtleties), it works fine for me on Kernel 4.6.4 with grsec.

In nvidia/nv-modeset-interface.c I had to fix nvidia_get_rm_ops by setting its structure as non-const (and then cast it as const), due to the introduction .allow_write_combining, written at runtime.

Separating const data from non-const data probably requires a some additional work, that's why I fixed it the dirty way...

Regards,

Romain
Comment 1 Romain Bezut 2016-09-13 01:11:46 UTC
Created attachment 445558 [details, diff]
Example pax patch for nvidia-drivers-370.28 v2

Patch seems much more similar to the previous ones this way.
Comment 2 Lagu 2016-10-17 13:24:41 UTC
Hi, i can confirm this, i have the same problem, sadly seems the patch don't works in hardened 4.7.7 (or the problem is other)

[32;01m * [39;49;00mPackage:    x11-drivers/nvidia-drivers-370.28
[32;01m * [39;49;00mRepository: Local-X
[32;01m * [39;49;00mMaintainer: jer@gentoo.org hardened@gentoo.org
[32;01m * [39;49;00mUSE:        X abi_x86_64 acpi amd64 compat driver elibc_glibc gtk3 kernel_linux kms multilib pax_kernel tools userland_GNU uvm wayland
[32;01m * [39;49;00mFEATURES:   preserve-libs sandbox userpriv usersandbox
 [32;01m*[0m Determining the location of the kernel source code
 [32;01m*[0m Found kernel source directory:
 [32;01m*[0m     /usr/src/linux
 [32;01m*[0m Found kernel object directory:
 [32;01m*[0m     /lib/modules/4.7.7-hardened/build
 [32;01m*[0m Found sources for kernel version:
 [32;01m*[0m     4.7.7-hardened

x86_64-pc-linux-gnu-ld -r -o /var/tmp/portage/x11-drivers/nvidia-drivers-370.28/work/kernel/nvidia-modeset/nv-modeset-interface.o /var/tmp/portage/x11-drivers/nvidia-drivers-370.28/work/kernel/nvidia-modeset/nvidia-modeset-linux.o
make -f /usr/src/linux-4.7.7-hardened/scripts/Makefile.modpost
  find /var/tmp/portage/x11-drivers/nvidia-drivers-370.28/work/kernel/.tmp_versions -name '*.mod' | xargs -r grep -h '\.ko$' | sort -u | sed 's/\.ko$/.o/' | scripts/mod/modpost -m  -i ./Module.symvers -I /var/tmp/portage/x11-drivers/nvidia-drivers-370.28/work/kernel/Module.symvers  -o /var/tmp/portage/x11-drivers/nvidia-drivers-370.28/work/kernel/Module.symvers -S  -w  -s -T -
FATAL: modpost: GPL-incompatible module nvidia-drm.ko uses GPL-only symbol 'mutex_destroy'
/usr/src/linux-4.7.7-hardened/scripts/Makefile.modpost:91: recipe for target '__modpost' failed
make[3]: *** [__modpost] Error 1
/usr/src/linux-4.7.7-hardened/Makefile:1468: recipe for target 'modules' failed
make[2]: *** [modules] Error 2
make[2]: Leaving directory '/usr/src/linux-4.7.7-hardened'
Makefile:150: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-4.7.7-hardened'
Makefile:81: recipe for target 'modules' failed
make: *** [modules] Error 2
 [31;01m*[0m ERROR: x11-drivers/nvidia-drivers-370.28::Local-X failed (compile phase):
 [31;01m*[0m   emake failed
 [31;01m*[0m 

Thx. Cya.
Comment 3 Lagu 2016-10-17 13:39:49 UTC
..., in hardened 4.7.2 the same....

check this
https://forums.gentoo.org/viewtopic-p-7964326.html?sid=13be43822269b3763ffda13b1892bc4d
Comment 4 Larry the Git Cow gentoo-dev 2019-01-16 10:32:22 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=421d7dc6fb791f8edde480dc6d989ade59c54710

commit 421d7dc6fb791f8edde480dc6d989ade59c54710
Author:     Jeroen Roovers <jer@gentoo.org>
AuthorDate: 2019-01-16 10:24:43 +0000
Commit:     Jeroen Roovers <jer@gentoo.org>
CommitDate: 2019-01-16 10:32:11 +0000

    x11-drivers/nvidia-drivers: Drop USE=pax_kernel
    
    Closes: https://bugs.gentoo.org/551366
    Closes: https://bugs.gentoo.org/593624
    Closes: https://bugs.gentoo.org/600156
    Closes: https://bugs.gentoo.org/629062
    Closes: https://bugs.gentoo.org/633738
    Closes: https://bugs.gentoo.org/650482
    Package-Manager: Portage-2.3.56, Repoman-2.3.12
    Signed-off-by: Jeroen Roovers <jer@gentoo.org>

 .../files/nvidia-drivers-331.13-pax-usercopy.patch |  52 ---
 .../files/nvidia-drivers-337.12-pax-constify.patch |  25 --
 .../files/nvidia-drivers-375.20-pax.patch          | 406 ---------------------
 x11-drivers/nvidia-drivers/metadata.xml            |   4 -
 .../nvidia-drivers/nvidia-drivers-340.107.ebuild   |  12 +-
 .../nvidia-drivers/nvidia-drivers-390.87.ebuild    |  11 +-
 .../nvidia-drivers/nvidia-drivers-410.93.ebuild    |   9 +-
 .../nvidia-drivers/nvidia-drivers-415.25.ebuild    |   9 +-
 .../nvidia-drivers/nvidia-drivers-415.27.ebuild    |   9 +-
 9 files changed, 7 insertions(+), 530 deletions(-)