From owner-svn-src-stable@freebsd.org Sat Jan 11 03:15:13 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CBE01FBE7D; Sat, 11 Jan 2020 03:15:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47vlN12LkLz4TVW; Sat, 11 Jan 2020 03:15:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BBAF24450; Sat, 11 Jan 2020 03:15:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00B3FD3V075107; Sat, 11 Jan 2020 03:15:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00B3FDCu075106; Sat, 11 Jan 2020 03:15:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001110315.00B3FDCu075106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Jan 2020 03:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356626 - in stable: 11/lib/libc/secure 12/lib/libc/secure X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libc/secure 12/lib/libc/secure X-SVN-Commit-Revision: 356626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 03:15:13 -0000 Author: kevans Date: Sat Jan 11 03:15:12 2020 New Revision: 356626 URL: https://svnweb.freebsd.org/changeset/base/356626 Log: MFC r356355: ssp: knock out some trivial warnings that come up with WARNS=6 A future commit will rebuild this as part of libssp. The exact warnings are fairly trivially fixed: - No previous declaration for __stack_chk_guard - idx is the wrong type, nitems yields a size_t - Casting away volatile on the tmp_stack_chk_guard directly is a no-no. Modified: stable/12/lib/libc/secure/stack_protector.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libc/secure/stack_protector.c Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libc/secure/stack_protector.c ============================================================================== --- stable/12/lib/libc/secure/stack_protector.c Sat Jan 11 01:56:57 2020 (r356625) +++ stable/12/lib/libc/secure/stack_protector.c Sat Jan 11 03:15:12 2020 (r356626) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); __attribute__((__constructor__, __used__)); #endif +extern long __stack_chk_guard[8]; extern int __sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen); @@ -73,8 +74,8 @@ __guard_setup(void) { static const int mib[2] = { CTL_KERN, KERN_ARND }; volatile long tmp_stack_chk_guard[nitems(__stack_chk_guard)]; - size_t len; - int error, idx; + size_t idx, len; + int error; if (__stack_chk_guard[0] != 0) return; @@ -84,7 +85,8 @@ __guard_setup(void) * data into a temporal array, then do manual volatile copy to * not allow optimizer to call memcpy() behind us. */ - error = _elf_aux_info(AT_CANARY, (void *)tmp_stack_chk_guard, + error = _elf_aux_info(AT_CANARY, + __DEQUALIFY(void *, tmp_stack_chk_guard), sizeof(tmp_stack_chk_guard)); if (error == 0 && tmp_stack_chk_guard[0] != 0) { for (idx = 0; idx < nitems(__stack_chk_guard); idx++) {