[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YE9ZGl9jlnDz1OBP@grain>
Date: Mon, 15 Mar 2021 15:54:50 +0300
From: Cyrill Gorcunov <gorcunov@...il.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Alexey Dobriyan <adobriyan@...il.com>, akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org, security@...nel.org
Subject: Re: [PATCH] prctl: fix PR_SET_MM_AUXV kernel stack leak
On Mon, Mar 15, 2021 at 01:08:03PM +0100, Oleg Nesterov wrote:
> On 03/14, Alexey Dobriyan wrote:
> >
> > prctl(PR_SET_MM, PR_SET_MM_AUXV, addr, 1);
> >
> > will copy 1 byte from userspace to (quite big) on-stack array
> > and then stash everything to mm->saved_auxv.
>
> I too don't understand, memcpy(mm->saved_auxv, user_auxv, len) will
> copy 1 byte...
Indeed. I overlooked that we pass @len when copying. I should
not reply at night :(
>
> And why task_lock(current) ? What does it try to protect?
As far as I remember this was related to reading from procfs
at time the patch was written for first time. Looks like this
not relevant anymore and could be dropped.
Powered by blists - more mailing lists