]>
Commit | Line | Data |
---|---|---|
8007d563 GKH |
1 | From 18c9a99bce2a57dfd7e881658703b5d7469cc7b9 Mon Sep 17 00:00:00 2001 |
2 | From: Dan Carpenter <dan.carpenter@oracle.com> | |
3 | Date: Tue, 29 May 2018 12:13:24 +0300 | |
4 | Subject: libata: zpodd: small read overflow in eject_tray() | |
5 | ||
6 | From: Dan Carpenter <dan.carpenter@oracle.com> | |
7 | ||
8 | commit 18c9a99bce2a57dfd7e881658703b5d7469cc7b9 upstream. | |
9 | ||
10 | We read from the cdb[] buffer in ata_exec_internal_sg(). It has to be | |
11 | ATAPI_CDB_LEN (16) bytes long, but this buffer is only 12 bytes. | |
12 | ||
13 | Fixes: 213342053db5 ("libata: handle power transition of ODD") | |
14 | Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> | |
15 | Signed-off-by: Tejun Heo <tj@kernel.org> | |
16 | Cc: stable@vger.kernel.org | |
17 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
18 | ||
19 | --- | |
20 | drivers/ata/libata-zpodd.c | 2 +- | |
21 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
22 | ||
23 | --- a/drivers/ata/libata-zpodd.c | |
24 | +++ b/drivers/ata/libata-zpodd.c | |
25 | @@ -34,7 +34,7 @@ struct zpodd { | |
26 | static int eject_tray(struct ata_device *dev) | |
27 | { | |
28 | struct ata_taskfile tf; | |
29 | - static const char cdb[] = { GPCMD_START_STOP_UNIT, | |
30 | + static const char cdb[ATAPI_CDB_LEN] = { GPCMD_START_STOP_UNIT, | |
31 | 0, 0, 0, | |
32 | 0x02, /* LoEj */ | |
33 | 0, 0, 0, 0, 0, 0, 0, |