提交 78a089d0 编写于 作者: L Linus Torvalds

Merge tag 'lsm-pr-20221031' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm

Pull LSM fix from Paul Moore:
 "A single patch to the capabilities code to fix a potential memory leak
  in the xattr allocation error handling"

* tag 'lsm-pr-20221031' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm:
  capabilities: fix potential memleak on error path from vfs_getxattr_alloc()
...@@ -401,8 +401,10 @@ int cap_inode_getsecurity(struct user_namespace *mnt_userns, ...@@ -401,8 +401,10 @@ int cap_inode_getsecurity(struct user_namespace *mnt_userns,
&tmpbuf, size, GFP_NOFS); &tmpbuf, size, GFP_NOFS);
dput(dentry); dput(dentry);
if (ret < 0 || !tmpbuf) if (ret < 0 || !tmpbuf) {
return ret; size = ret;
goto out_free;
}
fs_ns = inode->i_sb->s_user_ns; fs_ns = inode->i_sb->s_user_ns;
cap = (struct vfs_cap_data *) tmpbuf; cap = (struct vfs_cap_data *) tmpbuf;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册