All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "configfs: Return -EFBIG from configfs_write_bin_file." has been added to the 4.7-stable tree
@ 2016-09-27 15:04 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-09-27 15:04 UTC (permalink / raw)
  To: phil.turnbull, gregkh, hch; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    configfs: Return -EFBIG from configfs_write_bin_file.

to the 4.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     configfs-return-efbig-from-configfs_write_bin_file.patch
and it can be found in the queue-4.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 42857cf512cb34c2c8cb50f1e766689d979d64e0 Mon Sep 17 00:00:00 2001
From: Phil Turnbull <phil.turnbull@oracle.com>
Date: Thu, 15 Sep 2016 12:20:12 -0400
Subject: configfs: Return -EFBIG from configfs_write_bin_file.

From: Phil Turnbull <phil.turnbull@oracle.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@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.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);


Patches currently in stable-queue which might be from phil.turnbull@oracle.com are

queue-4.7/configfs-return-efbig-from-configfs_write_bin_file.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-27 15:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-27 15:04 Patch "configfs: Return -EFBIG from configfs_write_bin_file." has been added to the 4.7-stable tree gregkh

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.