[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202011171404.2CFCB24344@keescook>
Date: Tue, 17 Nov 2020 14:06:07 -0800
From: Kees Cook <keescook@...omium.org>
To: laniel_francis@...vacyrequired.com
Cc: linux-hardening@...r.kernel.org, dja@...ens.net
Subject: Re: [RFC PATCH v4 0/5] Fortify strscpy()
On Mon, Nov 16, 2020 at 03:50:07PM +0100, laniel_francis@...vacyrequired.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@...ux-foundation.org>
and add to Cc:
linux-mm@...ck.org
linux-kernel@...r.kernel.org
I think going via -mm is the most sensible, since that's where the other
fortify pieces landed.
--
Kees Cook
Powered by blists - more mailing lists