]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commit
ovl: Fix info leak in ovl_lookup_temp()
authorRichard Weinberger <richard@nod.at>
Fri, 16 Sep 2016 09:45:24 +0000 (11:45 +0200)
committerIshan Mittal <imittal@nvidia.com>
Fri, 6 Jan 2017 10:15:35 +0000 (15:45 +0530)
commit16d99059526bc1007b71df067fb48f6177efcf40
tree8157366fd8cf068c9d167e09b00c216bfcb5ef05
parent5901f5f95b2f4563f37ebc71cdabbec7abcacb80
ovl: Fix info leak in ovl_lookup_temp()

commit 6a45b3628ce4dcf7498b39c87d475bab6e2a9b24 upstream.

The function uses the memory address of a struct dentry as unique id.
While the address-based directory entry is only visible to root it is IMHO
still worth fixing since the temporary name does not have to be a kernel
address.  It can be any unique number.  Replace it by an atomic integer
which is allowed to wrap around.

Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: e9be9d5e76e3 ("overlay filesystem")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/overlayfs/dir.c