]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
dentry name snapshots
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 7 Jul 2017 18:51:19 +0000 (14:51 -0400)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Mon, 31 Jul 2017 16:09:05 +0000 (13:09 -0300)
commit5e6758877e190a09ec19781abb37eeb209c0c4a4
tree0774e942ff9c9717c22a8bfdc6ea4151b2021aa6
parent6123bc7ffc3bde577e56d67e48192a15fa3a644d
dentry name snapshots

take_dentry_name_snapshot() takes a safe snapshot of dentry name;
if the name is a short one, it gets copied into caller-supplied
structure, otherwise an extra reference to external name is grabbed
(those are never modified).  In either case the pointer to stable
string is stored into the same structure.

dentry must be held by the caller of take_dentry_name_snapshot(),
but may be freely dropped afterwards - the snapshot will stay
until destroyed by release_dentry_name_snapshot().

Intended use:
struct name_snapshot s;

take_dentry_name_snapshot(&s, dentry);
...
access s.name
...
release_dentry_name_snapshot(&s);

Replaces fsnotify_oldname_...(), gets used in fsnotify to obtain the name
to pass down with event.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
(cherry picked from commit 49d31c2f389acfe83417083e1208422b4091cd9e)
CVE-2017-7533
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
fs/dcache.c
fs/debugfs/inode.c
fs/namei.c
fs/notify/fsnotify.c
include/linux/dcache.h
include/linux/fsnotify.h