]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.18.114/libata-zpodd-small-read-overflow-in-eject_tray.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.18.114 / libata-zpodd-small-read-overflow-in-eject_tray.patch
CommitLineData
8007d563
GKH
1From 18c9a99bce2a57dfd7e881658703b5d7469cc7b9 Mon Sep 17 00:00:00 2001
2From: Dan Carpenter <dan.carpenter@oracle.com>
3Date: Tue, 29 May 2018 12:13:24 +0300
4Subject: libata: zpodd: small read overflow in eject_tray()
5
6From: Dan Carpenter <dan.carpenter@oracle.com>
7
8commit 18c9a99bce2a57dfd7e881658703b5d7469cc7b9 upstream.
9
10We read from the cdb[] buffer in ata_exec_internal_sg(). It has to be
11ATAPI_CDB_LEN (16) bytes long, but this buffer is only 12 bytes.
12
13Fixes: 213342053db5 ("libata: handle power transition of ODD")
14Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
15Signed-off-by: Tejun Heo <tj@kernel.org>
16Cc: stable@vger.kernel.org
17Signed-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,