OSDN Git Service
(root)
/
sagit-ice-cold
/
kernel_xiaomi_msm8998.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mwifiex: Fix possible buffer overflows in mwifiex_ret_wmm_get_status()
[sagit-ice-cold/kernel_xiaomi_msm8998.git]
/
block
/
bsg.c
diff --git
a/block/bsg.c
b/block/bsg.c
index
d214e92
..
b9a5361
100644
(file)
--- 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);
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;
bsg_set_block(bd, file);
bytes_written = 0;