OSDN Git Service

dump_common_audit_data(): fix racy accesses to ->d_name
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 5 Jan 2021 19:43:46 +0000 (14:43 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Jan 2021 17:22:37 +0000 (18:22 +0100)
commitfda4bb55c45bd9fdf490c39c3e567f0cea931e54
treec561858756f0791f8c90954d3127b54c95b02778
parentde581e41716795ce93506f3e5b0200048aa4439c
dump_common_audit_data(): fix racy accesses to ->d_name

commit d36a1dd9f77ae1e72da48f4123ed35627848507d upstream.

We are not guaranteed the locking environment that would prevent
dentry getting renamed right under us.  And it's possible for
old long name to be freed after rename, leading to UAF here.

Cc: stable@kernel.org # v2.6.2+
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/lsm_audit.c