[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202003251544.7ECB392A7@keescook>
Date: Wed, 25 Mar 2020 15:54:09 -0700
From: Kees Cook <keescook@...omium.org>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: Vlastimil Babka <vbabka@...e.cz>,
Luis Chamberlain <mcgrof@...nel.org>,
Iurii Zaikin <yzaikin@...gle.com>,
linux-kernel@...r.kernel.org, linux-api@...r.kernel.org,
linux-mm@...ck.org, Ivan Teterevkov <ivan.teterevkov@...anix.com>,
Michal Hocko <mhocko@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Matthew Wilcox <willy@...radead.org>,
"Guilherme G . Piccoli" <gpiccoli@...onical.com>
Subject: Re: [RFC v2 1/2] kernel/sysctl: support setting sysctl parameters
from kernel command line
On Wed, Mar 25, 2020 at 05:20:40PM -0500, Eric W. Biederman wrote:
> Hmm. There is a big gotcha in here and I think it should be mentioned.
> This code only works because no one has done set_fs(KERNEL_DS). Which
> means this only works with strings that are kernel addresses essentially
> by mistake. A big fat comment documenting why it is safe to pass in
> kernel addresses to a function that takes a "char __user*" pointer
> would be very good.
Yeah, I was going to mention this too just now as I went looking through
one of the handlers and was reminded that the args are marked __user. :P
I suspect we might need to add some __force __user markings or something
(with a comment as you say above), to keep sparse from going crazy. :)
--
Kees Cook
Powered by blists - more mailing lists