diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-01-10 12:01:14 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-01-10 12:01:14 +0800 |
commit | 7785301d9209cf083369c6f088cd1d48ec417863 (patch) | |
tree | 693ad3a1ebdc818a37abebbd8257820604ea8a35 /block | |
parent | 19192a140ad72b5bd0d57620bfe236bc03561bb6 (diff) | |
parent | f02e043c5ee3014ba0fbae38e699008385c99d7b (diff) |
Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
Diffstat (limited to 'block')
-rw-r--r-- | block/bsg.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/block/bsg.c b/block/bsg.c index d214e929ce18..b9a53615bdef 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -655,6 +655,9 @@ bsg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) dprintk("%s: write %Zd bytes\n", bd->name, count); + if (unlikely(segment_eq(get_fs(), KERNEL_DS))) + return -EINVAL; + bsg_set_block(bd, file); bytes_written = 0; |