Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4957087pxv; Tue, 27 Jul 2021 22:47:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzb/g2jga3GSk4rO9EDKMjpgVwZxvxHgTJNfj3D4GkuG9BwaVzREkULuOtdiNs2mFNIZ/u+ X-Received: by 2002:a5d:8b03:: with SMTP id k3mr21599231ion.203.1627451236415; Tue, 27 Jul 2021 22:47:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627451236; cv=none; d=google.com; s=arc-20160816; b=uCd8/vVheiLv38cvVfuTgTlIicaz+A4Ln1ZnOzqFqpuegla/W+fvBDM5r7JVClHQso CAa6iGRWlWBaJ9szJpy5QL17PHXq3MH13GiWOGR+kv/ZFyg7DYl2bM+Xj8UTBh3AIQlB cw4YGcdugl+WM/jof3T/P6Fu/nl9pslbbNf2cxAyCIxFhTKbRep/EGXZEvAE9iUUoaun 4cneFQluQxYZGdJ63X88eIZveTZ3gH+JlTatMGWjR/Tv/nhfrxHWdouzvqiOz2cJtbg1 pX2fLhCNE4KAOnbn1Xwz1xZoQKqElI46BeM3PMEbL2XVLNnOfJbElTqZmxPgMOfTU8A6 AGyA== 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=m/oGyw9PfUxPOtsb/j+8QS2GuwmwKah47oriAntVGbs=; b=XiAkFyxvHqqY5bEpjzeP/b6E/F1VSmh/98O59DkiVEzWLoNUWujEMYV4YHmeoN6Olj W9L5XwrquQhhXIsEYMT8PeqKfHWFQKRhr190DBa1qeBMJUdHcuYxVGmqv2Q0WJSc65/5 XDIbm6kU9Jfc75CTzOtLOlUKDp/0tgRNfAYhFTwENsReH7tkHFGSwhld5C12rwKseeS+ Kb62pSXNM8dALKNXV4R+tnK5W4uGIDAoGMAa18vap51d5oC363mVnC3KinYfD8lSVK4y oZxYqRa47b3VekM5kNCZdJ4iBhKVSb8Px9gBfCH3LuHpyIm8fgn0GkO7XY4F0QuFkl/0 xjQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mTu0LkN+; 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 v18si6329431ilc.155.2021.07.27.22.47.05; Tue, 27 Jul 2021 22:47:16 -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=mTu0LkN+; 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 S234265AbhG1Fpw (ORCPT + 99 others); Wed, 28 Jul 2021 01:45:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:48184 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233751AbhG1Fpu (ORCPT ); Wed, 28 Jul 2021 01:45:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D74CB60F91; Wed, 28 Jul 2021 05:45:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627451149; bh=zklXSglKzRovjPembkNEGUc2Sg0e8OpQIEb1zbmPiY8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mTu0LkN+HjpKbvRjkcugi/HAWS+cQ9ElSsonRdt+Pv9CMbs9mHGqBTfJXMppe8P+8 27QM654pxifW89ApqFgJkzaGjUdQkTDZaHYB4N4mj8gWJ2/tu+jP6ASQ+/rHf6i2IR 5umYkopMaIPQhOYee5KBr4PvFmBK15Ucv7HJHuuk= Date: Wed, 28 Jul 2021 07:45:47 +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 24/64] staging: wlan-ng: Use struct_group() for memcpy() region Message-ID: References: <20210727205855.411487-1-keescook@chromium.org> <20210727205855.411487-25-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210727205855.411487-25-keescook@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, Jul 27, 2021 at 01:58:15PM -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() in struct hfa384x_tx_frame around members > frame_control, duration_id, address[1-4], and sequence_control, 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 frame_control. > > "pahole" shows no size nor member offset changes to struct > hfa384x_tx_frame. "objdump -d" shows no meaningful object code changes > (i.e. only source line number induced differences.) > > Signed-off-by: Kees Cook > --- > drivers/staging/wlan-ng/hfa384x.h | 16 +++++++++------- > drivers/staging/wlan-ng/hfa384x_usb.c | 4 +++- > 2 files changed, 12 insertions(+), 8 deletions(-) Acked-by: Greg Kroah-Hartman