Files
twx-linux/drivers/scsi
Al Viro a975e8e81e Fix missing sanity check in /dev/sg
commit 137d01df51 upstream.

What happens is that a write to /dev/sg is given a request with non-zero
->iovec_count combined with zero ->dxfer_len.  Or with ->dxferp pointing
to an array full of empty iovecs.

Having write permission to /dev/sg shouldn't be equivalent to the
ability to trigger BUG_ON() while holding spinlocks...

Found by Dmitry Vyukov and syzkaller.

[ The BUG_ON() got changed to a WARN_ON_ONCE(), but this fixes the
  underlying issue.  - Linus ]

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-23 17:44:35 +01:00
..
2017-02-14 15:25:35 -08:00
2016-07-20 17:38:35 -06:00
2016-09-29 21:57:08 -04:00
2016-05-10 22:01:07 -04:00
2016-10-14 16:26:31 -04:00
2016-09-26 20:49:25 -04:00
2016-09-26 20:49:25 -04:00
2016-11-28 15:51:31 -05:00
2017-02-23 17:44:35 +01:00
2016-09-04 01:28:08 -04:00