Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 482784 - x11-drivers/nvidia-drivers-319.49: failed patch: nvidia-drivers-pax-const.patch
Summary: x11-drivers/nvidia-drivers-319.49: failed patch: nvidia-drivers-pax-const.patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jeroen Roovers (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-28 09:52 UTC by Alex Efros
Modified: 2014-10-19 14:29 UTC (History)
3 users (show)

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


Attachments
Patch for nvidia-drivers-319.49.ebuild (nvidia-drivers-319.49.ebuild.patch,500 bytes, patch)
2013-08-28 18:33 UTC, Norman Shulman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Efros 2013-08-28 09:52:53 UTC
patching file kernel/nv-procfs.c
Hunk #1 FAILED at 707.
Comment 1 Norman Shulman 2013-08-28 18:33:30 UTC
Created attachment 357266 [details, diff]
Patch for nvidia-drivers-319.49.ebuild

Don't apply nvidia-drivers-pax-const.patch

This seems to solve the problem.
Comment 2 Alex Efros 2013-08-28 19:09:14 UTC
(In reply to Norman Shulman from comment #1)
> Don't apply nvidia-drivers-pax-const.patch
> This seems to solve the problem.

Works for me, thanks!
Comment 3 Norman Shulman 2013-08-28 22:03:15 UTC
I suspect nvidia-drivers-325.08.ebuild also has this problem:

nshulman@nvshp:/usr/portage/x11-drivers/nvidia-drivers
$ grep nvidia-drivers-pax-const.patch nvidia-drivers-325.*.ebuild
nvidia-drivers-325.08.ebuild:		epatch "${FILESDIR}"/nvidia-drivers-pax-const.patch

nvidia-drivers-325.15.ebuild has been fixed (bug #479944).
Comment 4 Stefan Reimer 2013-08-29 16:31:23 UTC
Same here. 

Removing the nvidia-drivers-pax-const.patch fixes 319.49.
Nvidia cleanup up their act a bit ;)
Comment 5 PaX Team 2013-11-26 20:20:48 UTC
331.20 will need this: http://www.grsecurity.net/~paxguy1/nvidia-drivers-331.20-pax-constify.patch
Comment 6 Norman Shulman 2013-11-26 20:57:09 UTC
This patch lets the drivers build, but rebooting my system caused it to freeze very early in the EFI boot. Turned out the EFI part of the BIOS was corrupted.

After reinstalling the BIOS, the system booted up, but froze with a black screen after bring up the network interfaces.

I've downgraded nvidia-drivers to 325.15.

Now I see there are new versions of app-emulation/emul-linux-x86-xlibs, so I'm screwing up my courage for another try (I want the latest chromium).
Comment 7 Alex Efros 2013-11-26 21:03:34 UTC
I've patched 331.20 this way: https://bugs.gentoo.org/show_bug.cgi?id=490232#c5
Comment 8 PaX Team 2013-11-26 21:20:04 UTC
that's another way to go (albeit with a binary module, security is out of the window so why bother with the complex way), but that patch itself is incomplete, there's a memset on that same constified structure in nvUvmInterfaceDeRegisterUvmOps which would need open/close calls around it as well. i say stick to my patch instead, it's more likely to apply for future drivers and you don't really gain/lose any security either way.
Comment 9 Norman Shulman 2013-11-26 22:14:23 UTC
(In reply to Norman Shulman from comment #6)

Turns out my problem was because I didn't realize that 331.20.ebuild was no longer applying the pax-usercopy.patch, and now relies on epatch_user for all patching.

Appending the 331.13-pax-usercopy.patch to my __no_const patch solved the problem.
Comment 10 Anthony Basile gentoo-dev 2014-10-17 20:29:30 UTC
Sorry for coming late to this, but has this been upstreamed?  Can we close this bug as resolved?
Comment 11 PaX Team 2014-10-17 21:21:23 UTC
(In reply to Anthony Basile from comment #10)
> Sorry for coming late to this, but has this been upstreamed?  Can we close
> this bug as resolved?

upstream to me or nvidia? ;)

i've had a patch out for 337.12 [1] for some time now which works even with the latest 343.22.

[1] https://www.grsecurity.net/~paxguy1/nvidia-drivers-337.12-pax-constify.patch
Comment 12 Anthony Basile gentoo-dev 2014-10-18 01:22:41 UTC
(In reply to PaX Team from comment #11)
> (In reply to Anthony Basile from comment #10)
> > Sorry for coming late to this, but has this been upstreamed?  Can we close
> > this bug as resolved?
> 
> upstream to me or nvidia? ;)
> 
> i've had a patch out for 337.12 [1] for some time now which works even with
> the latest 343.22.
> 
> [1]
> https://www.grsecurity.net/~paxguy1/nvidia-drivers-337.12-pax-constify.patch

I meant to you :)

I'm going to reassign this to jer the nvidia-drivers maintainer.  Your patch could be added contingent on USE=pax_kernel.

@jer your call.
Comment 13 Jeroen Roovers (RETIRED) gentoo-dev 2014-10-18 20:46:11 UTC
So this patch should work for everything >331 it seems.
Comment 14 Anthony Basile gentoo-dev 2014-10-18 21:05:12 UTC
(In reply to Jeroen Roovers from comment #13)
> So this patch should work for everything >331 it seems.

That is my understanding.