From: Shyam Saini <mayhs11saini@gmail.com>
To: Matthew Wilcox <willy@infradead.org>, Christopher Lameter <cl@linux.com>
Cc: linux-mm <linux-mm@kvack.org>,
Kernel Hardening <kernel-hardening@lists.openwall.com>,
Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] slab: Redefine ZERO_SIZE_PTR to include ERR_PTR range
Date: Sun, 20 Oct 2019 11:36:42 +0530 [thread overview]
Message-ID: <CAOfkYf765S3sef+gdN7h34iSCzxXxU6ifTb9572WksCqNXo0WA@mail.gmail.com> (raw)
In-Reply-To: <20191010174413.GT32665@bombadil.infradead.org>
Hi Matthew, Christopher,
> > > This will help error related to ERR_PTR stand out better.
> >
> > Maybe make ZERO_SIZE_PTR an ERRNO value instead? Then allow ERR_PTRs to be
> > used instead of ZERO_SIZE_PTRs
> >
> > ERRNO_ZERO_OBJECT
> >
> > or something like that?
>
> I was wondering about something like that too, but allocating zero bytes
> isn't actually an error, and if we have code that does something like:
>
> void *p = my_funky_alloc(size, ...);
>
> if (IS_ERR(p))
> return PTR_ERR(p);
>
> then we might get this errno returned to userspace.
>
> The change is definitely worth thinking about.
Any further comments on this ?
Please let me know.
Thanks!!
next prev parent reply other threads:[~2019-10-20 6:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20191010103151.7708-1-mayhs11saini@gmail.com>
2019-10-10 14:22 ` [PATCH] slab: Redefine ZERO_SIZE_PTR to include ERR_PTR range Christopher Lameter
2019-10-10 17:44 ` Matthew Wilcox
2019-10-10 18:35 ` Christopher Lameter
2019-10-20 6:06 ` Shyam Saini [this message]
2019-10-20 15:38 ` Jann Horn
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=CAOfkYf765S3sef+gdN7h34iSCzxXxU6ifTb9572WksCqNXo0WA@mail.gmail.com \
--to=mayhs11saini@gmail.com \
--cc=cl@linux.com \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.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).