[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202006031219.36197D0729@keescook>
Date: Wed, 3 Jun 2020 13:35:09 -0700
From: Kees Cook <keescook@...omium.org>
To: glider@...gle.com
Cc: miklos@...redi.hu, linux-unionfs@...r.kernel.org,
linux-kernel@...r.kernel.org, royyang@...gle.com,
stable@...r.kernel.org
Subject: Re: [PATCH] ovl: explicitly initialize error in ovl_copy_xattr()
On Wed, Jun 03, 2020 at 07:47:14PM +0200, glider@...gle.com wrote:
> Under certain circumstances (we found this out running Docker on a
> Clang-built kernel with CONFIG_INIT_STACK_ALL) ovl_copy_xattr() may
> return uninitialized value of |error| from ovl_copy_xattr().
> It is then returned by ovl_create() to lookup_open(), which casts it to
> an invalid dentry pointer, that can be further read or written by the
> lookup_open() callers.
>
> Signed-off-by: Alexander Potapenko <glider@...gle.com>
Link: https://bugs.chromium.org/p/chromium/issues/detail?id=1050405
Fixes: e4ad29fa0d22 ("ovl: use a minimal buffer in ovl_copy_xattr")
Cc: stable@...r.kernel.org
Reviewed-by: Kees Cook <keescook@...omium.org>
It seems the error isn't reported anywhere, so the value likely isn't
too important. -EINVAL seems sane to me.
Thought: should CONFIG_INIT_STACK_ALL=y disable uninitialized_var()?
$ git grep uninitialized_var | wc -l
300
We have evidence this is being used inappropriately and is masking bugs.
I would actually think it should should be removed globally, but it
seems especially important for CONFIG_INIT_STACK_ALL=y.
I've opened:
https://github.com/KSPP/linux/issues/81
--
Kees Cook
Powered by blists - more mailing lists