aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/auditsc.c
diff options
context:
space:
mode:
authorGaosheng Cui <cuigaosheng1@huawei.com>2022-08-22 10:29:05 +0800
committerPaul Moore <paul@paul-moore.com>2022-08-22 18:50:06 -0400
commitad982c3be4e60c7d39c03f782733503cbd88fd2a (patch)
tree8aef373f519457b05afa7f6cf105ac2646a84324 /kernel/auditsc.c
parentLinux 6.0-rc2 (diff)
downloadlinux-dev-ad982c3be4e60c7d39c03f782733503cbd88fd2a.tar.xz
linux-dev-ad982c3be4e60c7d39c03f782733503cbd88fd2a.zip
audit: fix potential double free on error path from fsnotify_add_inode_mark
Audit_alloc_mark() assign pathname to audit_mark->path, on error path from fsnotify_add_inode_mark(), fsnotify_put_mark will free memory of audit_mark->path, but the caller of audit_alloc_mark will free the pathname again, so there will be double free problem. Fix this by resetting audit_mark->path to NULL pointer on error path from fsnotify_add_inode_mark(). Cc: stable@vger.kernel.org Fixes: 7b1293234084d ("fsnotify: Add group pointer in fsnotify_init_mark()") Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'kernel/auditsc.c')
0 files changed, 0 insertions, 0 deletions