diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-14 11:37:46 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-14 11:37:46 +0200 |
commit | d59fdcf2ac501de99c3dfb452af5e254d4342886 (patch) | |
tree | ad5e2efd6f8aacf2a08b1ed8a54ddf96642e83f3 /drivers/scsi/scsi_lib.c | |
parent | 2387ce57a8167490d3b34a7e1ffa9a64a1a76244 (diff) | |
parent | bce7f793daec3e65ec5c5705d2457b81fe7b5725 (diff) | |
download | kernel_samsung_aries-d59fdcf2ac501de99c3dfb452af5e254d4342886.zip kernel_samsung_aries-d59fdcf2ac501de99c3dfb452af5e254d4342886.tar.gz kernel_samsung_aries-d59fdcf2ac501de99c3dfb452af5e254d4342886.tar.bz2 |
Merge commit 'v2.6.26' into x86/core
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index a82d2fe..cbf55d5 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -207,6 +207,15 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, */ blk_execute_rq(req->q, NULL, req, 1); + /* + * Some devices (USB mass-storage in particular) may transfer + * garbage data together with a residue indicating that the data + * is invalid. Prevent the garbage from being misinterpreted + * and prevent security leaks by zeroing out the excess data. + */ + if (unlikely(req->data_len > 0 && req->data_len <= bufflen)) + memset(buffer + (bufflen - req->data_len), 0, req->data_len); + ret = req->errors; out: blk_put_request(req); |