summaryrefslogtreecommitdiffstats
path: root/fs/sysfs/file.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-05-21 18:59:25 +0900
committerLinus Torvalds <torvalds@linux-foundation.org>2014-05-21 18:59:25 +0900
commit439c6109922c8faa920c9b8680d63937189d6915 (patch)
tree686ad57dd77b9a462044e218b411ad9cdad63fb9 /fs/sysfs/file.c
parent957cf2582adf2a2164bbbd87036138221c5c118a (diff)
parentf5c16f29bf5e57ba4051fc7785ba7f035f798c71 (diff)
downloadop-kernel-dev-439c6109922c8faa920c9b8680d63937189d6915.zip
op-kernel-dev-439c6109922c8faa920c9b8680d63937189d6915.tar.gz
Merge tag 'driver-core-3.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core fixes from Greg KH: "Here are two driver core (well, sysfs) fixes for 3.15-rc6 that resolve some reported issues and a regression from 3.13" * tag 'driver-core-3.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: sysfs: make sure read buffer is zeroed kernfs, sysfs, cgroup: restrict extra perm check on open to sysfs
Diffstat (limited to 'fs/sysfs/file.c')
-rw-r--r--fs/sysfs/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 28cc1acd..e9ef59b 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -47,12 +47,13 @@ static int sysfs_kf_seq_show(struct seq_file *sf, void *v)
ssize_t count;
char *buf;
- /* acquire buffer and ensure that it's >= PAGE_SIZE */
+ /* acquire buffer and ensure that it's >= PAGE_SIZE and clear */
count = seq_get_buf(sf, &buf);
if (count < PAGE_SIZE) {
seq_commit(sf, -1);
return 0;
}
+ memset(buf, 0, PAGE_SIZE);
/*
* Invoke show(). Control may reach here via seq file lseek even
OpenPOWER on IntegriCloud