From owner-svn-src-stable@freebsd.org Sat Apr 7 00:23:50 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33A75F93CE4; Sat, 7 Apr 2018 00:23:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D860E7DDFF; Sat, 7 Apr 2018 00:23:49 +0000 (UTC) (envelope-from brooks@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 D319F19334; Sat, 7 Apr 2018 00:23:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w370NnhJ079398; Sat, 7 Apr 2018 00:23:49 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w370Nn4J079397; Sat, 7 Apr 2018 00:23:49 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804070023.w370Nn4J079397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 7 Apr 2018 00:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332161 - stable/11/sys/dev/sbni X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/dev/sbni X-SVN-Commit-Revision: 332161 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.25 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, 07 Apr 2018 00:23:50 -0000 Author: brooks Date: Sat Apr 7 00:23:49 2018 New Revision: 332161 URL: https://svnweb.freebsd.org/changeset/base/332161 Log: MFC r331651-r331653 r331651: Copy flags over ifr_union directly rather than via casts through ifr_data. No functional change in practice. If the sbni driver supported 64-bit big-endian system, this would be an ABI changes, but it is i386-only. The old version leaked a word of stack on 64-bit systems. This eliminates the only assignment to ifr_data. r331652: Revert r331651 to recommit with proper commit metadata. r331653: Copy flags over ifr_union directly rather than via casts through ifr_data. No functional change in practice. If the sbni driver supported 64-bit big-endian system, this would be an ABI changes, but it is i386-only. The old version leaked a word of stack on 64-bit systems. This eliminates the only assignment to ifr_data. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14874 Modified: stable/11/sys/dev/sbni/if_sbni.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sbni/if_sbni.c ============================================================================== --- stable/11/sys/dev/sbni/if_sbni.c Sat Apr 7 00:04:28 2018 (r332160) +++ stable/11/sys/dev/sbni/if_sbni.c Sat Apr 7 00:23:49 2018 (r332161) @@ -1144,7 +1144,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t flags.fixed_rxl = (sc->delta_rxl == 0); flags.fixed_rate = 1; SBNI_UNLOCK(sc); - ifr->ifr_data = *(caddr_t*) &flags; + bcopy(&flags, &ifr->ifr_ifru, sizeof(flags)); break; case SIOCGINSTATS: @@ -1163,7 +1163,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t error = priv_check(td, PRIV_DRIVER); if (error) break; - flags = *(struct sbni_flags*)&ifr->ifr_data; + bcopy(&ifr->ifr_ifru, &flags, sizeof(flags)); SBNI_LOCK(sc); if (flags.fixed_rxl) { sc->delta_rxl = 0;