Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1644591
| From | Greg KH <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC 1/6] lib: vsprintf: additional kernel pointer filtering options |
| Date | 2017-05-18 16:20 +0200 |
| Message-ID | <tIurw-3RH-19@gated-at.bofh.it> (permalink) |
| References | <tDZcB-36m-1@gated-at.bofh.it> <tDZcB-36m-9@gated-at.bofh.it> <tHJiW-59w-27@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, May 16, 2017 at 01:58:11PM +0200, Petr Mladek wrote:
> On Fri 2017-05-05 21:06:56, Greg KH wrote:
> > From: Dave Weinstein <olorin@google.com>
> >
> > Add the kptr_restrict setting of 3 which results in both
> > %p and %pK values being replaced by zeros.
> >
> > Add an additional %pP value inspired by the Grsecurity
> > option which explicitly whitelists pointers for output.
> >
> > This patch is based on work by William Roberts
> > <william.c.roberts@intel.com>
> >
> > diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> > index e3bf4e0f10b5..f4e11dade1ab 100644
> > --- a/lib/vsprintf.c
> > +++ b/lib/vsprintf.c
> > @@ -395,6 +395,16 @@ struct printf_spec {
> > #define FIELD_WIDTH_MAX ((1 << 23) - 1)
> > #define PRECISION_MAX ((1 << 15) - 1)
> >
> > +int kptr_restrict __read_mostly;
> > +
> > +/*
> > + * Always cleanse %p and %pK specifiers
> > + */
> > +static inline int kptr_restrict_always_cleanse_pointers(void)
>
> The name of the function is very long and still confusing.
> It uses the word "always" but there are many types of pointers
> that are not cleared with this condition, for example %pP, %pa.
>
> Do we need this helper function at all? It is used
> a weird way, see below.
Thanks for the comments, I'll revise this for the next version, thanks
so much for the review, much appreciated.
thanks,
greg k-h
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [RFC 1/6] lib: vsprintf: additional kernel pointer filtering options Petr Mladek <pmladek@suse.com> - 2017-05-16 14:00 +0200 Re: [RFC 1/6] lib: vsprintf: additional kernel pointer filtering options Greg KH <gregkh@linuxfoundation.org> - 2017-05-18 16:20 +0200
csiph-web