linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: Kees Cook <keescook@chromium.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH] mempool: Use kmalloc_size_roundup() to match ksize() usage
Date: Mon, 24 Oct 2022 20:03:34 +0200	[thread overview]
Message-ID: <a9c6c111-d92f-f76f-1b7a-f6220d755eeb@kernel.org> (raw)
In-Reply-To: <202210182235.3B19DFCB28@keescook>

On 10/19/22 07:37, Kees Cook wrote:
> On Tue, Oct 18, 2022 at 03:51:37PM -0700, Andrew Morton wrote:
>> On Tue, 18 Oct 2022 02:03:29 -0700 Kees Cook <keescook@chromium.org> wrote:
>> 
>> > Round up allocations with kmalloc_size_roundup() so that mempool's use
>> > of ksize() is always accurate and no special handling of the memory is
>> > needed by KASAN, UBSAN_BOUNDS, nor FORTIFY_SOURCE.
>> 
>> Confused.  If the special handling is not needed, why doesn't the patch
>> removed the no longer needed special handling?
> 
> The special handling is in the ksize() implementation, so it can't be
> removed[1] until all the ksize()-affected users are updated to see their
> true allocation sizes first.
> 
> [1] https://lore.kernel.org/lkml/20220923202822.2667581-16-keescook@chromium.org/

But in the previous version I was wondering if we can just stop doing
ksize()-like poison handling in mempool completely, if no mempool consumers
call ksize() to expand their use of the allocated objects. You seemed to
agree but this version is uncahnged?

https://lore.kernel.org/all/f4fc52c4-7c18-1d76-0c7a-4058ea2486b9@suse.cz/




  reply	other threads:[~2022-10-24 18:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18  9:03 [PATCH] mempool: Use kmalloc_size_roundup() to match ksize() usage Kees Cook
2022-10-18 22:51 ` Andrew Morton
2022-10-19  5:37   ` Kees Cook
2022-10-24 18:03     ` Vlastimil Babka (SUSE) [this message]
2022-10-25 22:55       ` 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=a9c6c111-d92f-f76f-1b7a-f6220d755eeb@kernel.org \
    --to=vbabka@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).