All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Kees Cook <keescook@chromium.org>,
	Allen Pais <apais@linux.microsoft.com>,
	Romain Perier <romain.perier@gmail.com>,
	Chen Lin <chen.lin5@zte.com.cn>,
	Ivan Safonov <insafonov@gmail.com>, Arnd Bergmann <arnd@arndb.de>,
	"David S. Miller" <davem@davemloft.net>,
	Abheek Dhawan <adawesomeguy222@gmail.com>,
	Colin Ian King <colin.king@canonical.com>,
	Ashish Kalra <eashishkalra@gmail.com>,
	linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-hardening@vger.kernel.org
Subject: [PATCH 0/2] staging: wlan-ng: Avoid duplicate header in tx/rx frames
Date: Thu, 19 Aug 2021 10:45:35 -0700	[thread overview]
Message-ID: <20210819174537.3499227-1-keescook@chromium.org> (raw)

Hi,

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.

In this case, there is a lot of redundant struct member declarations,
and everything can be made smaller, more description, and drop a
field-spanning memcpy() call all at the same time. The result is no
warning from the future FORTIFY_SOURCE and identical machine code.

Thanks,

-Kees

Kees Cook (2):
  staging: wlan-ng: Remove pointless a3/a4 union
  staging: wlan-ng: Avoid duplicate header in tx/rx frames

 drivers/staging/wlan-ng/hfa384x.h      | 19 ++--------
 drivers/staging/wlan-ng/hfa384x_usb.c  | 13 ++++---
 drivers/staging/wlan-ng/p80211conv.c   | 48 +++++++++++++-------------
 drivers/staging/wlan-ng/p80211conv.h   |  2 +-
 drivers/staging/wlan-ng/p80211hdr.h    | 30 +++++-----------
 drivers/staging/wlan-ng/p80211mgmt.h   | 24 ++++++-------
 drivers/staging/wlan-ng/p80211netdev.c | 12 +++----
 drivers/staging/wlan-ng/p80211netdev.h |  2 +-
 drivers/staging/wlan-ng/prism2sta.c    |  6 ++--
 9 files changed, 64 insertions(+), 92 deletions(-)

-- 
2.30.2


             reply	other threads:[~2021-08-19 17:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 17:45 Kees Cook [this message]
2021-08-19 17:45 ` [PATCH 1/2] staging: wlan-ng: Remove pointless a3/a4 union Kees Cook
2021-08-19 17:45 ` [PATCH 2/2] staging: wlan-ng: Avoid duplicate header in tx/rx frames Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210819174537.3499227-1-keescook@chromium.org \
    --to=keescook@chromium.org \
    --cc=adawesomeguy222@gmail.com \
    --cc=apais@linux.microsoft.com \
    --cc=arnd@arndb.de \
    --cc=chen.lin5@zte.com.cn \
    --cc=colin.king@canonical.com \
    --cc=davem@davemloft.net \
    --cc=eashishkalra@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=insafonov@gmail.com \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=romain.perier@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.