Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 434244 - x11-drivers/nvidia-drivers-173* and hardened-sources
Summary: x11-drivers/nvidia-drivers-173* and hardened-sources
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jeroen Roovers (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-09-07 19:56 UTC by Martin Väth
Modified: 2019-01-16 10:20 UTC (History)
5 users (show)

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


Attachments
Patch to make nvidia-drivers-173* work with hardened-sources (nvidia-drivers-grsecurity.patch,1.66 KB, patch)
2012-09-07 19:56 UTC, Martin Väth
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Väth 2012-09-07 19:56:58 UTC
Created attachment 323160 [details, diff]
Patch to make nvidia-drivers-173* work with hardened-sources

As requested in bug 385837, I open a new bug:

With the attached patch, the nvidia-drivers 173 series compiles (and runs)
with hardened-sources (many versions of both packages were tested already).
It should be possible to use the patch unconditionally (although this is not
well-tested).
Comment 1 Rick Farina (Zero_Chaos) gentoo-dev 2012-11-20 02:45:33 UTC
The current stable version all work with hardened-sources, is this really needed?
Comment 2 Martin Väth 2012-11-22 19:15:29 UTC
(In reply to comment #1)
> The current stable version all work with hardened-sources

Sorry for my late reply: I was rather busy and wanted to verify
before I answer.

I tested with sys-kernel/hardened-sources-3.6.7 and
x11-drivers/nvidia-drivers-3.6.7:

It compiles without patches, but when you start X with
pax security features enabled in the kernel (I did not test
which ones are the responsible ones), X does not start:
htop shows a dead process without a name, and dmesg contains:

PAX: kernel memory leak attempt detected from [...] (nv_stack_t) (15 bytes)
...
Comment 3 Martin Väth 2012-11-22 19:16:33 UTC
(In reply to comment #2)
>> x11-drivers/nvidia-drivers-3.6.7:

I meant x11-drivers/nvidia-drivers-173.14.36
Comment 4 Magnus Granberg gentoo-dev 2013-01-12 13:43:39 UTC
Maybe close this bug? For 3** series of drivers have the needed patches.
Comment 5 Rick Farina (Zero_Chaos) gentoo-dev 2013-01-12 14:45:27 UTC
Current drivers compile and function, X use flag is masked for a reason. People seem to be discussing the unmasking of the X flag over at bug #433121 but I wouldn't hold my breath on that being "officially support" (but that bug might help you get it working.
Comment 6 Martin Väth 2013-01-12 17:29:59 UTC
(In reply to comment #5)
> Current drivers compile and function

This bug is not about "current drivers" but about the 173-* series which is needed if you do not have a brand new nvidia card. And that driver compiles but does not work with pax enabled unless you use a patch like the attached one.
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2013-01-12 18:37:22 UTC
Comment on attachment 323160 [details, diff]
Patch to make nvidia-drivers-173* work with hardened-sources

/home/jer/portage/x11-drivers/nvidia-drivers-173.14.36/work/usr/src/nv/nv.c: In function ‘nvidia_init_module’:
/home/jer/portage/x11-drivers/nvidia-drivers-173.14.36/work/usr/src/nv/nv.c:1384:5: error: ‘SLAB_USERCOPY’ undeclared (first use in this function)
/home/jer/portage/x11-drivers/nvidia-drivers-173.14.36/work/usr/src/nv/nv.c:1384:5: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [/home/jer/portage/x11-drivers/nvidia-drivers-173.14.36/work/usr/src/nv/nv.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [_module_/home/jer/portage/x11-drivers/nvidia-drivers-173.14.36/work/usr/src/nv] Error 2
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[1]: *** [module] Error 1
make: *** [module] Error 2
emake failed

This apparently won't compile against non-hardened sources. We could muck about with USE flags and kernel checks and such, or do one better and have the patch perform the magic.
Comment 8 Rick Farina (Zero_Chaos) gentoo-dev 2013-01-12 19:37:57 UTC
> This apparently won't compile against non-hardened sources. We could muck
> about with USE flags and kernel checks and such, or do one better and have
> the patch perform the magic.

Jer,
Do to very similar issues the 3xx patch is conditionally applied based on the pax_kernel use flag. If you want to write a patch that doesn't require conditional application that's fine with me, but I see very little reason for that amount of effort.

Xarthisius,
If we have a patch that helps users and doesn't hurt anyone else (because we are conditionally applying the patch or the code only activates on hardened) would you consider adding it even though we "technically don't support running X on binary drivers in hardened".  Personally I see no downside to accepting this patch, however, the drivers are yours to command...
Comment 9 Rick Farina (Zero_Chaos) gentoo-dev 2013-01-12 19:38:45 UTC
Second half of comment 8 to Cardoe as well ^^
Comment 10 Magnus Granberg gentoo-dev 2018-10-12 01:24:49 UTC
I think this can be close
Comment 11 Jeroen Roovers (RETIRED) gentoo-dev 2019-01-16 10:20:54 UTC
(In reply to Magnus Granberg from comment #10)
> I think this can be close