All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] configfs: Return -EFBIG from configfs_write_bin_file.
@ 2016-09-15 16:20 Phil Turnbull
  2016-09-16 10:59 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Turnbull @ 2016-09-15 16:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: Christoph Hellwig, Joel Becker, Phil Turnbull

The check for writing more than cb_max_size bytes does not 'goto out' so
it is a no-op which allows users to vmalloc an arbitrary amount.

Fixes: 03607ace807b ("configfs: implement binary attributes")
Signed-off-by: Phil Turnbull <phil.turnbull@oracle.com>
---
 fs/configfs/file.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/configfs/file.c b/fs/configfs/file.c
index c30cf49b69d2..2c6312db8516 100644
--- a/fs/configfs/file.c
+++ b/fs/configfs/file.c
@@ -333,6 +333,7 @@ configfs_write_bin_file(struct file *file, const char __user *buf,
 		if (bin_attr->cb_max_size &&
 			*ppos + count > bin_attr->cb_max_size) {
 			len = -EFBIG;
+			goto out;
 		}
 
 		tbuf = vmalloc(*ppos + count);
-- 
2.9.0.rc2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] configfs: Return -EFBIG from configfs_write_bin_file.
  2016-09-15 16:20 [PATCH] configfs: Return -EFBIG from configfs_write_bin_file Phil Turnbull
@ 2016-09-16 10:59 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2016-09-16 10:59 UTC (permalink / raw)
  To: Phil Turnbull; +Cc: linux-kernel, Christoph Hellwig, Joel Becker

Thanks a lot Phil,

applied to the configfs for-next tree.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-16 10:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-15 16:20 [PATCH] configfs: Return -EFBIG from configfs_write_bin_file Phil Turnbull
2016-09-16 10:59 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.