Skip to content

Commit

Permalink
libata: zpodd: small read overflow in eject_tray()
Browse files Browse the repository at this point in the history
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: 2133420 ("libata: handle power transition of ODD")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
Cc: [email protected]
  • Loading branch information
Dan Carpenter authored and htejun committed May 29, 2018
1 parent 4544e40 commit 18c9a99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ata/libata-zpodd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 18c9a99

Please sign in to comment.