diff options
| author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-05-29 12:13:24 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-06-26 07:51:27 +0800 |
| commit | 1b7fa3981be54fe6f071dea93b69d96755f323a1 (patch) | |
| tree | 351214fe2fa6e8f76210f9b5817e11191d82dcab | |
| parent | 8ae0b72896a7bbda41c29d5ca2102099cd0dd351 (diff) | |
| download | linux-1b7fa3981be54fe6f071dea93b69d96755f323a1.tar.gz linux-1b7fa3981be54fe6f071dea93b69d96755f323a1.tar.bz2 linux-1b7fa3981be54fe6f071dea93b69d96755f323a1.zip | |
libata: zpodd: small read overflow in eject_tray()
commit 18c9a99bce2a57dfd7e881658703b5d7469cc7b9 upstream.
We read from the cdb[] buffer in ata_exec_internal_sg(). It has to be
ATAPI_CDB_LEN (16) bytes long, but this buffer is only 12 bytes.
Fixes: 213342053db5 ("libata: handle power transition of ODD")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/ata/libata-zpodd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/libata-zpodd.c b/drivers/ata/libata-zpodd.c index de4ddd0e8550..b3ed8f9953a8 100644 --- a/drivers/ata/libata-zpodd.c +++ b/drivers/ata/libata-zpodd.c @@ -35,7 +35,7 @@ struct zpodd { static int eject_tray(struct ata_device *dev) { struct ata_taskfile tf; - static const char cdb[] = { GPCMD_START_STOP_UNIT, + static const char cdb[ATAPI_CDB_LEN] = { GPCMD_START_STOP_UNIT, 0, 0, 0, 0x02, /* LoEj */ 0, 0, 0, 0, 0, 0, 0, |
