Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4959534pxv; Tue, 27 Jul 2021 22:52:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoQn4x5qWRyN+4U4SpYL1wyvzNb9ino7TYW3X3sODYNh+kvzS76RECwx5xuVMuvXwmvUhr X-Received: by 2002:a17:906:4103:: with SMTP id j3mr25061361ejk.526.1627451567223; Tue, 27 Jul 2021 22:52:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627451567; cv=none; d=google.com; s=arc-20160816; b=KtCk7fUDVuCnxoAE6b6VB+uagqKsgaPjRBZefzGli2SYpk/Ij8J45QJ0jsOzOERSXs QWdtlkAIeAr35DWEHZnGHsXYSPsHoKEp6q4misj2cJJsp+dx+vpb5xuAAFp/5UIYhMIr ep7BPMGPjTPk8BD0kYGPS3qT2DN8GIAiprCsz7iSQIHw8mu0SPxhZXFwHM0ndv4NKNyG c0Og2uoYXAmD2JdM5wPh2M/0rPptQvTpWvzxC8xUojhho2+0X8mStDSwxqPEbyWtyzDT kMhlqYkAMLjIKiZHm80fajKE+nM/nz9O2pVR89kuOP0ciwPXrFBvt9WAG40VEhEp42Jt kdGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/29qfXWrwNbL8AkOZFd719LJBo2PXzLTWYUQn8/xpuI=; b=ujzRos8EdQCjJwlfLZfvHl5leKnG9gtNUXxWT/dqxYqYVFrKlPKY9pJ7nltH1RuzAA iNSvt6CaLsDBJuulS09c4OfhgVRomOWGaHsUrF6G1oQwE0QnCHfNIcuYbMB95ZW4lin+ WbOph+7SbDVLSs6bsl8LX4ylkC07jSdfl3iq877IfxX5cGdx6sDkpDQmnjuUehIgw34E aCIc2j30TeTFJAB5FKF5B1h6fjTBTLp9SfvfDgZjNo1VoEYdF8FEEoX3CutXzzlwsE1B z132X4h/jUUckFtYXhY/v77xGg8dNpi96Tb9W0vCdZZwGAQ4DzoDSE07xsMOxnAwMhmc Eh8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SIJyCaqr; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c8si2463778ede.304.2021.07.27.22.52.24; Tue, 27 Jul 2021 22:52:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SIJyCaqr; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233835AbhG1FwQ (ORCPT + 99 others); Wed, 28 Jul 2021 01:52:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:51204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229814AbhG1FwP (ORCPT ); Wed, 28 Jul 2021 01:52:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6233F60F91; Wed, 28 Jul 2021 05:52:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627451534; bh=nUOThSwtZ87Jw+CXwl+FwlWvYkHPkssRucboLcrmd90=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SIJyCaqr1xfetzHAZanMNRQYhPz2W7BVjUbvZ/cg0giNbNRbWYSfkr7AwWFywJ0T1 FPB4wjxunN/l1gFycsM1PXt+P8alzvfFDCE+mDoOQ5F/lLCJFjnF702h+O9qgMgRfo bcuZJkkCSMXuNuDrW+PLFHrtVDTjjQzHP3kojxD8= Date: Wed, 28 Jul 2021 07:52:11 +0200 From: Greg Kroah-Hartman To: Kees Cook Cc: linux-hardening@vger.kernel.org, "Gustavo A. R. Silva" , Keith Packard , Andrew Morton , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-staging@lists.linux.dev, linux-block@vger.kernel.org, linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH 10/64] lib80211: Use struct_group() for memcpy() region Message-ID: References: <20210727205855.411487-1-keescook@chromium.org> <20210727205855.411487-11-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210727205855.411487-11-keescook@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, Jul 27, 2021 at 01:58:01PM -0700, Kees Cook wrote: > In preparation for FORTIFY_SOURCE performing compile-time and run-time > field bounds checking for memcpy(), memmove(), and memset(), avoid > intentionally writing across neighboring fields. > > Use struct_group() around members addr1, addr2, and addr3 in struct > ieee80211_hdr so they can be referenced together. This will allow memcpy() > and sizeof() to more easily reason about sizes, improve readability, > and avoid future warnings about writing beyond the end of addr1. > > "pahole" shows no size nor member offset changes to struct ieee80211_hdr. > "objdump -d" shows no meaningful object code changes (i.e. only source > line number induced differences and optimizations). > > Signed-off-by: Kees Cook > --- > drivers/staging/rtl8723bs/core/rtw_security.c | 5 +++-- > drivers/staging/rtl8723bs/core/rtw_xmit.c | 5 +++-- > include/linux/ieee80211.h | 8 +++++--- > net/wireless/lib80211_crypt_ccmp.c | 3 ++- > 4 files changed, 13 insertions(+), 8 deletions(-) For the staging portion: Acked-by: Greg Kroah-Hartman