mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Len Baker <len.baker@gmx.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Len Baker <len.baker@gmx.com>, Kees Cook <keescook@chromium.org>,
	Michael Straube <straube.linux@gmail.com>,
	Lee Jones <lee.jones@linaro.org>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: [PATCH 0/2] staging/rtl8192u: Prefer kcalloc over open coded arithmetic
Date: Sun, 22 Aug 2021 16:28:18 +0200	[thread overview]
Message-ID: <20210822142820.5109-1-len.baker@gmx.com> (raw)

The main reason of this patch serie is to avoid dynamic size
calculations (especially multiplication) in memory allocator function
arguments due to the risk of them overflowing. This could lead to values
wrapping around and a smaller allocation being made than the caller was
expecting. Using those allocations could lead to linear overflows of
heap memory and other misbehaviors.

However, there is a previous patch to avoid CamelCase in the name of
variables.

Len Baker (2):
  staging/rtl8192u: Avoid CamelCase in names of variables
  staging/rtl8192u: Prefer kcalloc over open coded arithmetic

 drivers/staging/rtl8192u/r819xU_phy.c | 92 +++++++++++++--------------
 1 file changed, 44 insertions(+), 48 deletions(-)

--
2.25.1


             reply	other threads:[~2021-08-22 14:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-22 14:28 Len Baker [this message]
2021-08-22 14:28 ` [PATCH 1/2] staging/rtl8192u: Avoid CamelCase in names of variables Len Baker
2021-08-22 15:02   ` Kees Cook
2021-08-23  8:54     ` Dan Carpenter
2021-08-22 14:28 ` [PATCH 2/2] staging/rtl8192u: Prefer kcalloc over open coded arithmetic Len Baker
2021-08-22 14:59   ` Kees Cook
2021-08-22 15:41     ` Len Baker

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=20210822142820.5109-1-len.baker@gmx.com \
    --to=len.baker@gmx.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=straube.linux@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®