tcmu: prevent corruption when invalid data page requested
authorMike Christie <mchristi@redhat.com>
Tue, 19 Dec 2017 10:03:54 +0000 (04:03 -0600)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 12 Jan 2018 23:07:29 +0000 (15:07 -0800)
commitc1c390ba53195aef36e94b2354bc0e603057c293
tree102298e922af8367d4e0c5355ae42333a6ee216e
parent9960f85181dd08cda03fddcf0bc8d81190bec4eb
tcmu: prevent corruption when invalid data page requested

We will always have a page mapped for cmd data if it is
valid command. If the mapping does not exist then something
bad happened in userspace and it should not proceed. This
has us return VM_FAULT_SIGBUS when this happens instead of
returning a freshly allocated paged. The latter can cause
corruption because userspace might write the pages data
overwriting valid data or return it to the initiator.

Signed-off-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_user.c