[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160928090446.039994816@linuxfoundation.org>
Date: Wed, 28 Sep 2016 11:05:04 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Phil Turnbull <phil.turnbull@...cle.com>,
Christoph Hellwig <hch@....de>
Subject: [PATCH 4.7 22/69] configfs: Return -EFBIG from configfs_write_bin_file.
4.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Phil Turnbull <phil.turnbull@...cle.com>
commit 42857cf512cb34c2c8cb50f1e766689d979d64e0 upstream.
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@...cle.com>
Signed-off-by: Christoph Hellwig <hch@....de>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
fs/configfs/file.c | 1 +
1 file changed, 1 insertion(+)
--- a/fs/configfs/file.c
+++ b/fs/configfs/file.c
@@ -333,6 +333,7 @@ configfs_write_bin_file(struct file *fil
if (bin_attr->cb_max_size &&
*ppos + count > bin_attr->cb_max_size) {
len = -EFBIG;
+ goto out;
}
tbuf = vmalloc(*ppos + count);
Powered by blists - more mailing lists