mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 22:37:45 -04:00
xfs: Plug memory leak in xfs_attrmulti_attr_set
When setting attributes via XFS_IOC_ATTRMULTI_BY_HANDLE, the user-space buffer is copied into a new kernel-space buffer via memdup_user; that buffer then isn't freed. Signed-off-by: Andreas Gruenbacher <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
This commit is contained in:
1 parent
86a21c7974
commit
09cb22d2a5
1 file changed
+4
-1
+4
-1
@@ -482,6 +482,7 @@ xfs_attrmulti_attr_set(
|
||||
__uint32_t flags)
|
||||
{
|
||||
unsigned char *kbuf;
|
||||
int error;
|
||||
|
||||
if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
|
||||
return -EPERM;
|
||||
@@ -492,7 +493,9 @@ xfs_attrmulti_attr_set(
|
||||
if (IS_ERR(kbuf))
|
||||
return PTR_ERR(kbuf);
|
||||
|
||||
return xfs_attr_set(XFS_I(inode), name, kbuf, len, flags);
|
||||
error = xfs_attr_set(XFS_I(inode), name, kbuf, len, flags);
|
||||
kfree(kbuf);
|
||||
return error;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in new issue
Block a user