From owner-svn-ports-head@FreeBSD.ORG Sat Nov 15 16:45:11 2014 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8C1496C; Sat, 15 Nov 2014 16:45:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AD08C44; Sat, 15 Nov 2014 16:45:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAFGjBqY008942; Sat, 15 Nov 2014 16:45:11 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAFGjBau008941; Sat, 15 Nov 2014 16:45:11 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201411151645.sAFGjBau008941@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Sat, 15 Nov 2014 16:45:11 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r372606 - head/x11/nvidia-driver X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2014 16:45:11 -0000 Author: danfe Date: Sat Nov 15 16:45:10 2014 New Revision: 372606 URL: https://svnweb.freebsd.org/changeset/ports/372606 QAT: https://qat.redports.org/buildarchive/r372606/ Log: - 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 [*] Modified: head/x11/nvidia-driver/Makefile Modified: head/x11/nvidia-driver/Makefile ============================================================================== --- head/x11/nvidia-driver/Makefile Sat Nov 15 16:26:32 2014 (r372605) +++ head/x11/nvidia-driver/Makefile Sat Nov 15 16:45:10 2014 (r372606) @@ -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 &/' \