projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e30e636
)
configfs: fix memleak in configfs_release_bin_file
author
Chung-Chiang Cheng
<shepjeng@gmail.com>
Fri, 18 Jun 2021 07:59:25 +0000
(15:59 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:48 +0000
(16:56 +0200)
[ Upstream commit
3c252b087de08d3cb32468b54a158bd7ad0ae2f7
]
When reading binary attributes in progress, buffer->bin_buffer is setup in
configfs_read_bin_file() but never freed.
Fixes:
03607ace807b4
("configfs: implement binary attributes")
Signed-off-by: Chung-Chiang Cheng <cccheng@synology.com>
[hch: move the vfree rather than duplicating it]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/configfs/file.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/configfs/file.c
b/fs/configfs/file.c
index da8351d1e455209150954bf6cc002e5643d97870..4d0825213116a4ca800172ebdd1d21babc948aff 100644
(file)
--- a/
fs/configfs/file.c
+++ b/
fs/configfs/file.c
@@
-482,13
+482,13
@@
static int configfs_release_bin_file(struct inode *inode, struct file *file)
buffer->bin_buffer_size);
}
up_read(&frag->frag_sem);
- /* vfree on NULL is safe */
- vfree(buffer->bin_buffer);
- buffer->bin_buffer = NULL;
- buffer->bin_buffer_size = 0;
- buffer->needs_read_fill = 1;
}
+ vfree(buffer->bin_buffer);
+ buffer->bin_buffer = NULL;
+ buffer->bin_buffer_size = 0;
+ buffer->needs_read_fill = 1;
+
configfs_release(inode, file);
return 0;
}