[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200402191936.GA3243295@kroah.com>
Date: Thu, 2 Apr 2020 21:19:36 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Pavel Machek <pavel@...x.de>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Maciej Żenczykowski <maze@...gle.com>,
John Stultz <john.stultz@...aro.org>,
Alexander Potapenko <glider@...gle.com>,
Alistair Delva <adelva@...gle.com>,
Daniel Borkmann <daniel@...earbox.net>,
Yonghong Song <yhs@...com>
Subject: Re: [PATCH 4.19 105/116] bpf: Explicitly memset the bpf_attr
structure
On Thu, Apr 02, 2020 at 08:53:21PM +0200, Pavel Machek wrote:
> Hi!
>
> > From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> >
> > commit 8096f229421f7b22433775e928d506f0342e5907 upstream.
> >
> > For the bpf syscall, we are relying on the compiler to properly zero out
> > the bpf_attr union that we copy userspace data into. Unfortunately that
> > doesn't always work properly, padding and other oddities might not be
> > correctly zeroed, and in some tests odd things have been found when the
> > stack is pre-initialized to other values.
> >
> > Fix this by explicitly memsetting the structure to 0 before using
> > it.
>
> Is not that a gcc bug?
No.
> I mean, that's seriously unhelpful behaviour from security
> perspective.
I totally agree, and it is something we have been playing whack-a-mole
over for a number of years now.
Nothing new, but we do have a config option to zero out the stack all
the time if you are feeling paranoid and can take the performance hit.
> Is there any reason to believe this is not causing problems elsewhere?
It probably is, please feel free to audit and fix up the remaining
issues that you find.
thanks,
greg k-h
Powered by blists - more mailing lists