Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3337306imu; Sun, 11 Nov 2018 12:40:42 -0800 (PST) X-Google-Smtp-Source: AJdET5fXOy37onvE92ZFpr320Igx+PJLYL0fEeFX1bDQcs4Byn2zUu4oXWZ3sl7pI9l++4UbTMBM X-Received: by 2002:a62:d703:: with SMTP id b3-v6mr17704957pfh.90.1541968842117; Sun, 11 Nov 2018 12:40:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968842; cv=none; d=google.com; s=arc-20160816; b=tbcxCgv7p+V6fhfpG8w5Sg0O89cCe01u70VuwCilSkyREcMTAFalIID8SQL7UWzQYs 6IXo7toA9ry+hjJqC0lZcY8aSdMhsBn7nTDbh9dZPZNC1cHn7hPg7lWCYAY9+JmU3aCb Q0Aqa/0XyqFpsgPVcF4BwzFKDSoSbqN5a1/XEq9pmShwiB7Vl3K9vH/ykTkV0iFLW6Cj CkDE7bDUwvUCdXar1a0BT5PX3ya5qWSZvda6eIIXAgCWkFM7vYljmkFYxSPk4LFy15Ni yiVnVnTXw9VD+5T18LOvaV26L8GjXWdnHWB0rJjRAeuIEwINF6+2868/Zht2OSt3fj15 RqMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=Dg+o1J5xMqPeKmMG2mhlVrbmpopnxI2cHSwUzxd2Q1w=; b=C/kwFRnTkGC4mw1TgebP166fWOCSOz4td+6wCY5SXNsdl5sTETpQlllhmcrHiPwbQG 739ek8W3yHJ1/Dflld272f/P2KruzJtcIzJSfU9EC/fAxnRj4hx0jlrDcfktCSuIpqG/ mHTFX5/CUrQ/sp6/NolzLxERUV1Iu7bL02dF5Js/PRvFEPOsnDqwrE3GRPO0TYVyAjzo /GJKnvCSxtsbFNDXYIB4rsuDSU1LWOakbhSZdOpEMLivFNMkGNPptRUXKpd2dTrr3l6C GQxbgVODfm0970JtlQDdcun3t3Gt5Sn44TQToVvx3VlLTi3BV/gSP3pWYkj27ugNgBvV 3mGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10si16032442pgg.510.2018.11.11.12.40.26; Sun, 11 Nov 2018 12:40:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730449AbeKLG3i (ORCPT + 99 others); Mon, 12 Nov 2018 01:29:38 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:49508 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729973AbeKLFsH (ORCPT ); Mon, 12 Nov 2018 00:48:07 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsT-0000lM-C6; Sun, 11 Nov 2018 19:58:37 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsQ-0001UK-HG; Sun, 11 Nov 2018 19:58:34 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Tejun Heo" , "Dan Carpenter" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 094/366] libata: zpodd: small read overflow in eject_tray() In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter 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 Signed-off-by: Tejun Heo Signed-off-by: Ben Hutchings --- drivers/ata/libata-zpodd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/ata/libata-zpodd.c +++ b/drivers/ata/libata-zpodd.c @@ -34,7 +34,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,