diff options
author | Stefan Weinhuber <wein@de.ibm.com> | 2013-11-19 14:15:57 +0100 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-11-20 09:04:54 +0100 |
commit | 26a35f373fbe6f21e8ad5ca4de1c01021e38fe2f (patch) | |
tree | 1e0ac74c9336553c6dfd86cdcbf86c7ba969379e /drivers/s390 | |
parent | aa7e04b3808614980d474735cdb0bf35ac5cdf26 (diff) |
s390/dasd: validate request size before building CCW/TCW request
An I/O request that does not read or write full blocks cannot be
translated into a correct CCW or TCW program and should be rejected
right away. In particular the code that creates TCW requests will not
notice this problem and create broken TCWs that will be rejected by
the hardware.
Signed-off-by: Stefan Weinhuber <wein@de.ibm.com>
Reference-ID: RQM1956
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/block/dasd_eckd.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index cee7e2708a1..95e45782692 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -3224,6 +3224,8 @@ static struct dasd_ccw_req *dasd_eckd_build_cp(struct dasd_device *startdev, fcx_multitrack = private->features.feature[40] & 0x20; data_size = blk_rq_bytes(req); + if (data_size % blksize) + return ERR_PTR(-EINVAL); /* tpm write request add CBC data on each track boundary */ if (rq_data_dir(req) == WRITE) data_size += (last_trk - first_trk) * 4; |