]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: fix potential bad pointer deref in async dirops cb's
authorJeff Layton <jlayton@kernel.org>
Wed, 8 Apr 2020 12:41:38 +0000 (08:41 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 13 Apr 2020 17:33:47 +0000 (19:33 +0200)
commite7609d63b57058c517bafad830abbb432759ca71
tree81df5b30d09f3b0360216ef0842dc0e26c7c77f7
parentd392cf53b7e57e326c537a033263643434ef7f12
ceph: fix potential bad pointer deref in async dirops cb's

The new async dirops callback routines can pass ERR_PTR values to
ceph_mdsc_free_path, which could cause an oops. Make ceph_mdsc_free_path
ignore ERR_PTR values. Also, ensure that the pr_warn messages look sane
even if ceph_mdsc_build_path fails.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/dir.c
fs/ceph/file.c
fs/ceph/mds_client.h