public inbox for linux-hardening@vger.kernel.org
 help / color / mirror / Atom feed
From: Francis Laniel <laniel_francis@privacyrequired.com>
To: Kees Cook <keescook@chromium.org>
Cc: linux-hardening@vger.kernel.org, dja@axtens.net
Subject: Re: [RFC PATCH v4 0/5] Fortify strscpy()
Date: Wed, 18 Nov 2020 11:41:13 +0100	[thread overview]
Message-ID: <4657036.ZfE1bQA0bl@machine> (raw)
In-Reply-To: <202011171404.2CFCB24344@keescook>

Le mardi 17 novembre 2020, 23:06:07 CET Kees Cook a écrit :
> On Mon, Nov 16, 2020 at 03:50:07PM +0100, laniel_francis@privacyrequired.com 
wrote:
> > This patch set answers to this issue:
> > https://github.com/KSPP/linux/issues/46
> > 
> > I based my modifications on top of two patches from Daniel Axtens which
> > modify calls to __builtin_object_size to ensure the true size of char *
> > are returned and not the surrounding structure size.
> > 
> > To sum up, in my first patch I implemented a fortified version of strscpy.
> > This new version ensures the following before calling vanilla strscpy:
> > 1. There is no read overflow because we either size is smaller than src
> > length or we shrink size to src length by calling fortified strnlen.
> > 2. There is no write overflow because we either failed during compilation
> > or at runtime by checking that size is smaller than dest size.
> > The second patch brings a new file in LKDTM driver to test this new
> > version. The test ensures the fortified version still returns the same
> > value as the vanilla one while panic'ing when there is a write overflow.
> > The third just corrects some typos in LKDTM related file.
> > 
> > If you see any problem or way to improve the code, feel free to share it.
> 
> Thanks! This looks really good. You can drop the "RFC" parts, and for
> v5, please use
> 
> 	To: Andrew Morton <akpm@linux-foundation.org>
> 
> and add to Cc:
> 
> 	linux-mm@kvack.org
> 	linux-kernel@vger.kernel.org
> 
> I think going via -mm is the most sensible, since that's where the other
> fortify pieces landed.

You are welcome and thank you for the reviews!
I rebase it on Linus Torvalds' tree and I send the V5.




      reply	other threads:[~2020-11-18 10:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 14:50 [RFC PATCH v4 0/5] Fortify strscpy() laniel_francis
2020-11-16 14:50 ` [PATCH v4 1/5] string.h: detect intra-object overflow in fortified string functions laniel_francis
2020-11-16 14:50 ` [PATCH v4 2/5] lkdtm: tests for FORTIFY_SOURCE laniel_francis
2020-11-16 14:50 ` [RFC PATCH v4 3/5] string.h: Add FORTIFY coverage for strscpy() laniel_francis
2020-11-17 22:02   ` Kees Cook
2020-11-16 14:50 ` [RFC PATCH v4 4/5] Add new file in LKDTM to test fortified strscpy laniel_francis
2020-11-17 22:04   ` Kees Cook
2020-11-16 14:50 ` [RFC PATCH v4 5/5] Correct wrong filenames in comment laniel_francis
2020-11-17 22:06 ` [RFC PATCH v4 0/5] Fortify strscpy() Kees Cook
2020-11-18 10:41   ` Francis Laniel [this message]

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=4657036.ZfE1bQA0bl@machine \
    --to=laniel_francis@privacyrequired.com \
    --cc=dja@axtens.net \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    /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