From patchwork Fri Aug 4 10:51:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghava Aditya Renukunta X-Patchwork-Id: 9880193 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D5CA5602B8 for ; Fri, 4 Aug 2017 00:35:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE15F28385 for ; Fri, 4 Aug 2017 00:35:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF8B42897A; Fri, 4 Aug 2017 00:35:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00, DATE_IN_FUTURE_06_12, DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F9CC28385 for ; Fri, 4 Aug 2017 00:35:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751887AbdHDAe7 (ORCPT ); Thu, 3 Aug 2017 20:34:59 -0400 Received: from mail-dm3nam03on0082.outbound.protection.outlook.com ([104.47.41.82]:56580 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751877AbdHDAe6 (ORCPT ); Thu, 3 Aug 2017 20:34:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mscc365.onmicrosoft.com; s=selector1-microsemi-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=W6GDBbuui0EYmCcHk2NUV4YsLYPwyFfKEHZYrDr6Eig=; b=BbeiSt6OL5a78FpXthTy9Ni/F3np1kYFE7JfjwtmiJ8cwLqOEyiTIqrnG2Dzgi324N5T3+czeaarXfySSkh3n5rffaGhjLIhD+1XFoFaYYtjrSTsy0Qj9huhAc43cDoMZviUMZ1+i5Uo44nMd9AA+apSfMzUb5xzPzhwNHnTUJU= Received: from CY4PR02CA0021.namprd02.prod.outlook.com (10.169.188.31) by BY1PR02MB1210.namprd02.prod.outlook.com (10.162.108.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1304.22; Fri, 4 Aug 2017 00:34:55 +0000 Received: from BY2FFO11FD027.protection.gbl (2a01:111:f400:7c0c::181) by CY4PR02CA0021.outlook.office365.com (2603:10b6:903:18::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1304.22 via Frontend Transport; Fri, 4 Aug 2017 00:34:54 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; oracle.com; dkim=none (message not signed) header.d=none;oracle.com; dmarc=bestguesspass action=none header.from=microsemi.com; Received-SPF: Pass (protection.outlook.com: domain of microsemi.com designates 208.19.100.21 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.21; helo=avsrvexchhts1.microsemi.net; Received: from avsrvexchhts1.microsemi.net (208.19.100.21) by BY2FFO11FD027.mail.protection.outlook.com (10.1.15.216) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1282.16 via Frontend Transport; Fri, 4 Aug 2017 00:34:52 +0000 Received: from rslab209.pmc-sierra.bc.ca (10.181.72.13) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server id 14.3.351.0; Thu, 3 Aug 2017 17:34:50 -0700 Subject: [PATCH] aacraid: Fix out of bounds in aac_get_name_resp From: Raghava Aditya Renukunta To: , , CC: , David Carroll , , Date: Fri, 4 Aug 2017 03:51:41 -0700 Message-ID: <150184390108.30112.458253019139897272.stgit@rslab209.pmc-sierra.bc.ca> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:208.19.100.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39400400002)(39410400002)(39850400002)(39860400002)(39840400002)(39450400003)(2980300002)(438002)(189002)(199003)(68736007)(38730400002)(104016004)(72206003)(69596002)(230700001)(6666003)(50466002)(23676002)(54356999)(55016002)(50986999)(54906002)(7696004)(53936002)(5660300001)(9686003)(575784001)(86362001)(103116003)(77096006)(8676002)(47776003)(4326008)(83506001)(106466001)(356003)(8936002)(626005)(305945005)(53416004)(81166006)(478600001)(189998001)(33646002)(4001350100001)(2906002)(97736004)(81156014)(2201001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR02MB1210; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD027; 1:YF69PjeoLkKlVLiwgStyXjFLnZk6Z8JSX1I+0yJvRP18RI3bT9jDi+XBwNlV67xb/Hsp7qtqDnlZdpmiF5ktpa98WAMOZuq6uBbPonKxpFwKQzoGLA0ZqhYyVY08NTYTkuofgL7ADXC3lkMnKxu8ndGCL8ArXqIthP9GcxEAhz33nNQJa7WI4ISbufHMOediz21AFqjgaw10cfLJ79+gkkk9GQaXUc42A9USuoWIV8i6aWggcb3KHhU70sk0GvJ55UAxwm/SaBGY2dPxtaPAZH96OZ8erPXvBQNWM4P2XU2aTzzoQ15vSO9QhRRVwjzV/V8yu59qoweKafI+/AzUWKN/tRDEHK0XCZzP0a/Wk2uMf2hE9oPtU0n2RB6/ea35XZ+MtqJ5LB62ODClYMPTk6+EN+/92GVYNAuzJe63RCx0dNw4f7/EXAIQzcttqDKXNaYo1hnB5/twutQwIl5BFfoeS5HUYo4ocQtWwtTcfPLpssvQz/josVVWzjkZg0oks+wIsBxKl61IsD+PrELMkdAaqxgBBoekpwjRzEr48nAUhWVLidnnh/IJqtDmVAgKRIEZJE1LdvH96zIDGUPk9YdhwyNkQqlQQoayG8iWpM6cH309JvFV8uZdhRt1ufST6W4OuFyMp6WF98Bovmc4YwnQ5ryomAAuzkbo83iB+7dMc87saeWbCSAese0FsnFFH5PweFW913aY3/3hF8TFCjYb/OFPouNO8gcDFjUMfmqX4253SXqNtFcM3HCj2m4q7JrvwEdlTleZhQbDttkHn2zdYUEiIz9DRfBw0VJDdjs7oZX+VWQVERsxpBZCcj02 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 733a0ee3-3afe-4391-c257-08d4dad0a062 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(8251501002)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BY1PR02MB1210; X-Microsoft-Exchange-Diagnostics: 1; BY1PR02MB1210; 3:RpbCzjHGi7N9TgLQA6LoZtwzg69JDISmvp1fxzaFPrscwEO+8dZqQr5Eh8HoUdmF1OMnJk5sXsu0jmtH7Nva5KuB1XmG1H9PTPERknL8rrF1uH0yKW9HmIym/81P3x3aCjUw6/9wt4+bWSI2sOYZisqUvVvxqanQ0Pr96vPAfeBt6eGISJtBeEsUxFGwJrOWwW6sRjGW7TXu8BnBbZLvLZHIJOz2O5iJoovhfnSote4NY18AFmFt6En6QuF4pghEcmaDT3riy0UfUDRcSwGF/HJDbkQnIsP6ltREUjglE0cx5zKq7kZxabicBwz1U4ik7Bh7yYJt5PzUwwKZzyzI0EkyzWTFSlTtgTu2J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Psd2DQtAq7qtNdMxE7FjOGJDzWC2YzVHO78F7R2srXR8Qf2yykkONMO4RkmksXaT5Vkxmp7gevrpO6qogJcEC6jJN1FyGk X-Exchange-Antispam-Report-Test: UriScan:(72170198267865)(211171220733660)(146099531331640); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(13016025)(8121501046)(13018025)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93004095)(6055026)(6041248)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY1PR02MB1210; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY1PR02MB1210; X-Microsoft-Exchange-Diagnostics: 1; BY1PR02MB1210; 4:f3MEiSLRlsqUHCQZoF1i0iracIfjyy0j2y34r+cd/+jYYRZzG5tacTGqRP3vqcUdCI7rv6YwQsqciDRsfXRiF/e3RfV/vuNKBjutsBnh6sfiDYmLVUBZYmHUkuWem/dBi0KkJOMWZ8aPtpuqTfQl6s5u/WD111gAVNfeuHwB0IWI6bfCG2YCDHLaac1RdeLg1XgPDNEwbQLbXHt8Tvpz5MWVx1cePx5rPUtZM47ictz0IuXezmhvX/sYEXTEDr89a9+dBI3JqvjvKqgdCj448mJZG4ykI82+varojNCFuSJ1tuAfilyrnxVUbx5RDaQcMYhC62PXKgUX6PlCVVC0E7ABbjD4DHnLHb69b/FsACxdqRHOXCAVO6x99zEei5ad X-Forefront-PRVS: 0389EDA07F X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTFQUjAyTUIxMjEwOzIzOmtzVFpzNnBUSU8rK0MvRk9MVVdISjNYa3RI?=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HvMFWLc/sWh8CsaMDVqBd0EMe7Y0hlQxJyMjCJg9qQAF8mszZlvzkLtZvZN/xEOW3qVc1bn44EkTOrVsNyLNjMsijmJB5+oTsjExnQYLPlKh4hQe60vNHiH9oJdGKx64xKzyKrPq3+6MRCgVR59T2XM7WD6KaxW6pt2nMyL6MPZvRmuormA1jW+piFuQrjlOxs6A6am/Eb8xv882VU2NvE3aQIvQ9j9cEIggYthOrS/ImhYyYXP1w==; 5:jlBc7p1j/wogQ7+QRiAYBmFUtMGVcUn0HNJPNYD57SK0dagKBXRZQMUwr+WhhybS8IJAsnvrx7KC+5sLDGjr4SclrVl+0Gg6SkF/IA1RTdNiT7h6Ai/DSXgXMHEq5uxkjUzD4pVAdNKdGqU+gKzqfQ==; 24:G46g2XTNKZLx0sMJXBTh0ZgBzCfPVuBM3J9AQFu3xoF94QZTXoZGjoe9+mq4LojDzhkvqNfeYsXAEEEn3ypxFRImzjjv421MrQLgFbvM/zI=; 7:aOWNppgseCe4VwiaOvTcYh27HR2+vqVDtbnluqO+/xZq5gJ5HxRncY05coEpY0DolqKtaEgYpuYyMxpJhAZXBw7Fy+XLiJjHuS9OLAh6UBUCrzYYF9QM2UNRxg1wR1/dIt4whwdJUH0lwa/sDilAP7V/CT9v8FIliRT8+M+t/peYHOo69TFvgrZ8WrqaO80B0o6G0dB3q4b1JNRfrZZq3EnTzfHKVet7cSmsSaZZxrA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2017 00:34:52.5618 (UTC) X-MS-Exchange-CrossTenant-Id: f267a5c8-86d8-4cc9-af71-1fd2c67c8fad X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f267a5c8-86d8-4cc9-af71-1fd2c67c8fad; Ip=[208.19.100.21]; Helo=[avsrvexchhts1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR02MB1210 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We terminate the aac_get_name_resp on a byte that is outside the bounds of the structure. Extend the return response by one byte to remove the appearance of out of bounds reference. Thank you Dan for reporting the issue. Thank you Bart Van Assche for suggesting the FIELD_SIZEOF macro. Fixes: b836439faf04 ("aacraid: 4KB sector support") Reported-by: Dan Carpenter Signed-off-by: David Carroll Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Bart Van Assche --- drivers/scsi/aacraid/aachba.c | 9 +++++++-- drivers/scsi/aacraid/aacraid.h | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 707ee2f5954d..a875175d58d1 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -549,7 +549,9 @@ static void get_container_name_callback(void *context, struct fib * fibptr) if ((le32_to_cpu(get_name_reply->status) == CT_OK) && (get_name_reply->data[0] != '\0')) { char *sp = get_name_reply->data; - sp[sizeof(((struct aac_get_name_resp *)NULL)->data)] = '\0'; + int data_size = FIELD_SIZEOF(struct aac_get_name_resp, data); + + sp[data_size - 1] = '\0'; while (*sp == ' ') ++sp; if (*sp) { @@ -579,12 +581,15 @@ static void get_container_name_callback(void *context, struct fib * fibptr) static int aac_get_container_name(struct scsi_cmnd * scsicmd) { int status; + int data_size; struct aac_get_name *dinfo; struct fib * cmd_fibcontext; struct aac_dev * dev; dev = (struct aac_dev *)scsicmd->device->host->hostdata; + data_size = FIELD_SIZEOF(struct aac_get_name_resp, data); + cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd); aac_fib_init(cmd_fibcontext); @@ -593,7 +598,7 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd) dinfo->command = cpu_to_le32(VM_ContainerConfig); dinfo->type = cpu_to_le32(CT_READ_NAME); dinfo->cid = cpu_to_le32(scmd_id(scsicmd)); - dinfo->count = cpu_to_le32(sizeof(((struct aac_get_name_resp *)NULL)->data)); + dinfo->count = cpu_to_le32(data_size - 1); status = aac_fib_send(ContainerCommand, cmd_fibcontext, diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index 69812994b81e..92fabf2b0c24 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -2275,7 +2275,7 @@ struct aac_get_name_resp { __le32 parm3; __le32 parm4; __le32 parm5; - u8 data[16]; + u8 data[17]; }; #define CT_CID_TO_32BITS_UID 165