| To: | Dave Chinner <david@xxxxxxxxxxxxx>, Brian Foster <bfoster@xxxxxxxxxx>, xfs@xxxxxxxxxxx |
|---|---|
| Subject: | [PATCH v2 2/5] xfs: Plug memory leak in xfs_attrmulti_attr_set |
| From: | Andreas Gruenbacher <agruenba@xxxxxxxxxx> |
| Date: | Fri, 30 Oct 2015 16:05:05 +0100 |
| Cc: | Andreas Gruenbacher <agruenba@xxxxxxxxxx> |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <1446217508-22157-1-git-send-email-agruenba@xxxxxxxxxx> |
| References: | <1446217508-22157-1-git-send-email-agruenba@xxxxxxxxxx> |
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 <agruenba@xxxxxxxxxx>
---
fs/xfs/xfs_ioctl.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index ea7d85a..e939c20 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -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
--
2.5.0
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH v2 1/5] xfs: Validate the length of on-disk ACLs, Andreas Gruenbacher |
|---|---|
| Next by Date: | [PATCH v2 3/5] xfs: SGI ACLs: Fix caching and mode setting, Andreas Gruenbacher |
| Previous by Thread: | [PATCH v2 1/5] xfs: Validate the length of on-disk ACLs, Andreas Gruenbacher |
| Next by Thread: | [PATCH v2 3/5] xfs: SGI ACLs: Fix caching and mode setting, Andreas Gruenbacher |
| Indexes: | [Date] [Thread] [Top] [All Lists] |