aboutsummaryrefslogtreecommitdiffstats
path: root/x11/nvidia-driver
diff options
context:
space:
mode:
authordanfe <danfe@FreeBSD.org>2014-11-16 00:45:10 +0800
committerdanfe <danfe@FreeBSD.org>2014-11-16 00:45:10 +0800
commitd187b3160e6e50da92a263c684cd87bf818adb4e (patch)
tree1031ab8a6fee85fa56a5fe8a2937d46fc48e03d0 /x11/nvidia-driver
parent7e5d6580d01e1321ae6ac828c5a26b9c5a66c408 (diff)
downloadfreebsd-ports-gnome-d187b3160e6e50da92a263c684cd87bf818adb4e.tar.gz
freebsd-ports-gnome-d187b3160e6e50da92a263c684cd87bf818adb4e.tar.zst
freebsd-ports-gnome-d187b3160e6e50da92a263c684cd87bf818adb4e.zip
- Stop trying to adopt cap_rights_t type change in FreeBSD src SVN r255219
as recent driver versions are already account for it; this unbreaks the build for 304.xx branch [*] - Simplify patching for stack buffer overflow in nvidia_sysctl_bus_type(): NVidia really screwed up fixing it since it was reported. Originally, they were sprintf(bus_type, "PCI-E")ing to a 4-character buffer allocated on stack (304.88 and earlier); later they've replaced the buffer with a char * pointer, but left one sprintf() into it (304.108 and above, up to 304.121); then finally fixed it for real in 304.123. Given versions are only for 304.xx branch; others retained the same bugs during this time frame. Fix it across the gang by simply extending bus_type[4] (if found) to eight bytes instead of employing complex NVVERSION checks: this should now be no-op for newer versions, but good enough for older ones (e.g. for 173.14.35, 96.xx, and 71.xx) PR: 194866, 194958 [*]
Diffstat (limited to 'x11/nvidia-driver')
-rw-r--r--x11/nvidia-driver/Makefile14
1 files changed, 2 insertions, 12 deletions
diff --git a/x11/nvidia-driver/Makefile b/x11/nvidia-driver/Makefile
index e974dd4712bc..0e3cb84c3614 100644
--- a/x11/nvidia-driver/Makefile
+++ b/x11/nvidia-driver/Makefile
@@ -180,12 +180,6 @@ post-patch: .SILENT
${REINPLACE_CMD} -e '/kmem_/s/kernel_map/kernel_arena/' \
${WRKSRC}/src/nvidia_subr.c
.endif
-# Adopt to cap_rights_t type change in FreeBSD src SVN r255219
-.if ${OSVERSION} > 1000052 && ${NVVERSION} < 331.067
- ${REINPLACE_CMD} -e 's/u_long cmd;/& cap_rights_t rights;/ ; \
- s/CAP_IOCTL/cap_rights_init(\&rights, &)/' \
- ${WRKSRC}/src/nvidia_linux.c
-.endif
# Argument count of vm_map_find() changed in FreeBSD src SVN r255426
.if ${OSVERSION} > 1000054 && ${NVVERSION} < 304.123 # < 331.067
${REINPLACE_CMD} -e 's/virtual_address, size,/& 0,/' \
@@ -198,12 +192,8 @@ post-patch: .SILENT
${WRKSRC}/src/nvidia_sysctl.c
.endif
# Fix stack buffer overflow in nvidia_sysctl_bus_type()
-.if ${NVVERSION} < 304.123 # < 319.023
- ${REINPLACE_CMD} -E '/bus_type\[4\]/d ; \
- s/sprintf\(bus_type, (".+")/return SYSCTL_OUT(req, \1, sizeof(\1)/ ; \
- /return SYSCTL_OUT\(req, bus_type/d' \
- ${WRKSRC}/src/nvidia_sysctl.c
-.endif
+ ${REINPLACE_CMD} -e 's/8 bus_type\[4\]/8 bus_type[8]/' \
+ ${WRKSRC}/src/nvidia_sysctl.c
# Unbreak the build of 173.14.xx legacy series on recent -CURRENT
.if ${NVVERSION} < 195.022 && ${NVVERSION} >= 169.004
${REINPLACE_CMD} -E 's/os_(alloc|free)_contig_pages/NV_API_CALL &/' \