Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4956899pxv; Tue, 27 Jul 2021 22:46:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4sUKyf7/EqcvjOX/xReuWJ4lG1G0zGAt98QdUQ54kAIWPjidgm8SGrl05+D9x7XldZ3nJ X-Received: by 2002:a02:a595:: with SMTP id b21mr24722497jam.122.1627451215551; Tue, 27 Jul 2021 22:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627451215; cv=none; d=google.com; s=arc-20160816; b=SVTFh1rU7FZa5d2URXHqsYbXGSmElMxTGNX/6Rpz4EGBE3zaRMl3hijFFVB5aagYfz YmoK1+9keoQEfXtCIpHn/CJIzmWhEgoYkYDfOfwT0gpc5CijT5MMM0OWpaJksDYmkJrf oSOrr1XsP2CSLx0G2OMwFCjU6NCglS5mmAX3XACeZTr4TDFnFm6clTsR5k4zZW7QtIwu KR8DyQZ4L9gQ4LLIh3bgg0EK2v6UcKhG18SJlQmZf0lyH324vjFinlxa/AaF4b9GTKko 5zlYUC1ki/dHhticpbA2WpB6y/rkEI2AHQaQZwnzhEeW6a8Bfn4ZOHGR8CY1wStJpU0d FEiQ== 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=VB398ruaATolEYiSRB7ksOByl+NtOrmxCsuI6mYg1yI=; b=nMagf67wTDrpyuqfCRpEXunQnsBNI+ObLWjask0g6mcSzHQab3ObbKDdxq7aJNVJOF vnaW0I7TsSe3mlODEHgZGYg4a40fMD8hn4Ks+AbjzTYW2WvY6YVES69eqSvVNbdtzw5p lJL/rUGjK3IQ5VUadlSYciJrknj/Ydce/fzy9AfPo8gI3oj+7Wuw4UEPxoI/nwcoVilG 2eowtOxEovqFE5PKPFxNZB8qz9gYwdPvFMNG/jIZMjUi9hrWzcENJqIsE5xHkmvWDb7U cRx+8erxWilYS9KrnGW6wj5F/tPH7kJmOIvT/y3o2BY+W6bgE7t+Y/MFORBI9Tzn6zQs UKuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=F6DkcU1t; 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 p3si5526092ilm.66.2021.07.27.22.46.39; Tue, 27 Jul 2021 22:46:55 -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=F6DkcU1t; 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 S234208AbhG1FqD (ORCPT + 99 others); Wed, 28 Jul 2021 01:46:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:48448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232796AbhG1FqC (ORCPT ); Wed, 28 Jul 2021 01:46:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B91F460BD3; Wed, 28 Jul 2021 05:46:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627451161; bh=5TT6vhaZMFh6Ixag3Q3JIRBCGhLz9P43hbzx09FExmY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=F6DkcU1tItDCras3BrqzN0yT/k/efCY4jZ2AcBGGFZyCnArMJpoDY48G8teXgWArj OKxwCtiqpI560i3ebuU+kJI+rT9CPwa7B3UNyA1ll/SaFemqgmowNM0f+E1SaNF/Qw 1NRg4+x5zFU1vDWXNXSDvARVwD9VpVh6Su5E+9ks= Date: Wed, 28 Jul 2021 07:45:59 +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 08/64] staging: rtl8192u: Use struct_group() for memcpy() region Message-ID: References: <20210727205855.411487-1-keescook@chromium.org> <20210727205855.411487-9-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210727205855.411487-9-keescook@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, Jul 27, 2021 at 01:57:59PM -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 > rtl_80211_hdr_4addr, and members qui, qui_type, qui_subtype, version, > and ac_info in struct ieee80211_qos_information_element, 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 and qui. Additionally replace zero sized > arrays with flexible arrays in struct ieee_param. > > "pahole" shows no size nor member offset changes to struct > rtl_80211_hdr_4addr nor struct ieee80211_qos_information_element. "objdump > -d" shows no meaningful object code changes (i.e. only source line number > induced differences and optimizations). > > Signed-off-by: Kees Cook Acked-by: Greg Kroah-Hartman