[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202104191630.F00A6AAF@keescook>
Date: Mon, 19 Apr 2021 16:36:12 -0700
From: Kees Cook <keescook@...omium.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
boris.ostrovsky@...cle.com, jgross@...e.com,
sstabellini@...nel.org, x86@...nel.org,
jani.nikula@...ux.intel.com, joonas.lahtinen@...ux.intel.com,
rodrigo.vivi@...el.com, chris@...is-wilson.co.uk,
intel-gfx@...ts.freedesktop.org, linux-mm@...ck.org, hch@....de
Subject: Re: [PATCH 4/7] mm: Introduce verify_page_range()
On Tue, Apr 13, 2021 at 08:54:06AM +0200, Peter Zijlstra wrote:
> On Mon, Apr 12, 2021 at 01:05:09PM -0700, Kees Cook wrote:
> > On Mon, Apr 12, 2021 at 10:00:16AM +0200, Peter Zijlstra wrote:
> > > +struct vpr_data {
> > > + int (*fn)(pte_t pte, unsigned long addr, void *data);
> > > + void *data;
> > > +};
> >
> > Eeerg. This is likely to become an attack target itself. Stored function
> > pointer with stored (3rd) argument.
>
> You got some further reading on that? How exactly are those exploited?
Sure, see "Executing code" in
https://googleprojectzero.blogspot.com/2017/05/exploiting-linux-kernel-via-packet.html
I killed the entire primitive (for timer_list)
https://outflux.net/blog/archives/2018/02/05/security-things-in-linux-v4-15/#v4.15-timer_list
but that was a lot of work, so I'm trying to avoid seeing more things
like it appear. :) (And I'm trying to get rid of similar APIs, like
tasklet.)
This new code is unlikely to ever be used as widely as timer_list,
but I just cringe when I see the code pattern. I'll understand if there
isn't a solution that doesn't require major refactoring, but I can
dream. :)
--
Kees Cook
Powered by blists - more mailing lists