Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp498213imm; Thu, 30 Aug 2018 04:21:25 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYv1FO1UdNCoJ/KsyIxwGzDMJFTJ62DoPqVHkE/sxOH7f52buMQmFZxI5z1jhiv+etAhSPc X-Received: by 2002:a62:3545:: with SMTP id c66-v6mr10003784pfa.63.1535628085393; Thu, 30 Aug 2018 04:21:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535628085; cv=none; d=google.com; s=arc-20160816; b=wN5JMv3PpUNIHJc7Ap/ptYjHV4zkeNaFZO5d2Twap3DIl0f7qMD08Ti9AQ189Vvyoc jv48McgmE3iW6Iva5tVZ5g3RMX9cdP7WfOby2AtYKHCVazfmYqu8ks6v+d9bAGWPmENO aD4q9uOc59yWwRHicbqlJs+zu0PZvMnMK1lx2XIOQ/Q017ZH1cD8po1W3vVW+musD9Ji HTMSoBd9h0MGHb/EvAJwuR+VnBTVMoXESZ+Ct3I5DkwnQlBIt0xH92fLl5wz3drFt9qt Ic8Toj69q5InV/3gLHA2ShDClKGgrdwaZJq6Cf4T9HF3eJCWout/uo57EToz/2JIiiyn 2R1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:from:subject:cc:to :dkim-signature:arc-authentication-results; bh=els9/U7elVtxbL59g8TfMaurLBM9UZhUOAmVtNRf+0U=; b=mU6huCrTs5+SEGacDCR3E9qs4mQtq1kDGCfiGU8CiNA6QQYECNfqnx7kSW593MVDHU Ew1koiG124nXQNZMeQ06yRruS7WCxymC4dGDHNwmbE/CrJGH4+3zfl9daW2JFIlUBQT6 FFgFHqZLDDm92DEN87tUEK0PLSyoZsT90KmMM2PCGD7TXssE2l2BHn+2lHr+VbOQ5I/o 9iWcRMPzRa7O3sbGKfe8IalZOfKDvWk30mZnMzQObwqePJNnNFvv1ZnOXwlz9iEku3/+ 1I/25BPcU3nJhn0WacpqkBkM8q4QEmILvAZRMMB9QL4WyzBqmudeYjKVX/hs7Tb5nYcy AlyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=VZnQofHR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5-v6si6371209pfa.116.2018.08.30.04.21.10; Thu, 30 Aug 2018 04:21:25 -0700 (PDT) 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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=VZnQofHR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728582AbeH3PVo (ORCPT + 99 others); Thu, 30 Aug 2018 11:21:44 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:43148 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728200AbeH3PVo (ORCPT ); Thu, 30 Aug 2018 11:21:44 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7UBJumf152517; Thu, 30 Aug 2018 11:19:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : subject : from : references : date : in-reply-to : message-id : mime-version : content-type; s=corp-2018-07-02; bh=els9/U7elVtxbL59g8TfMaurLBM9UZhUOAmVtNRf+0U=; b=VZnQofHRRfXkxsyhTnQbBgbTVpWFiejvV42QvjTmPL+8W0ndR0WBrk8PqaKDFN+Yft79 TS7f+5Y+sZ88LMKaR2R4aYECsltIDvYb0XAk3113peozdRfwaATIVxz7kFPTt5iFOI3l Y+uq3yIMD7/HMocQtxHputBMr+oFtZq4E5JYZXDTvvFIfi8d5Jy0ebVLk5lvnqlbXtTS Vs4/ujXtnBUt3I6QIShh+8rP0I26+ElBoYr+lgR0OFACDIIyOyFxealABBRVkRsL0L5L Hs6B7yHBzFKayqqaEMkLaaEfusasHyoDUADNx9m+gfSX7tINQPlXAMzcqTA6wJozr6YX QA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2m2xhu0ya1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 30 Aug 2018 11:19:57 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w7UBJFmb029278 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 30 Aug 2018 11:19:15 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w7UBJEie027971; Thu, 30 Aug 2018 11:19:14 GMT Received: from ca-mkp.ca.oracle.com (/10.159.214.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 30 Aug 2018 04:19:14 -0700 To: Laura Abbott Cc: "Nicholas A. Bellinger" , Bart Van Assche , Hannes Reinecke , Mike Christie , Maurizio Lombardi , target-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv2] iscsi-target: Don't use stack buffer for scatterlist From: "Martin K. Petersen" Organization: Oracle Corporation References: <20180823203626.15108-1-labbott@redhat.com> Date: Thu, 30 Aug 2018 07:19:10 -0400 In-Reply-To: <20180823203626.15108-1-labbott@redhat.com> (Laura Abbott's message of "Thu, 23 Aug 2018 13:36:26 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9000 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=661 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808300119 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Fedora got a bug report of a crash with iSCSI: > > kernel BUG at include/linux/scatterlist.h:143! > ... > RIP: 0010:iscsit_do_crypto_hash_buf+0x154/0x180 [iscsi_target_mod] > ... > Call Trace: > ? iscsi_target_tx_thread+0x200/0x200 [iscsi_target_mod] > iscsit_get_rx_pdu+0x4cd/0xa90 [iscsi_target_mod] > ? native_sched_clock+0x3e/0xa0 > ? iscsi_target_tx_thread+0x200/0x200 [iscsi_target_mod] > iscsi_target_rx_thread+0x81/0xf0 [iscsi_target_mod] > kthread+0x120/0x140 > ? kthread_create_worker_on_cpu+0x70/0x70 > ret_from_fork+0x3a/0x50 > > This is a BUG_ON for using a stack buffer with a scatterlist. There > are two cases that trigger this bug. Switch to using a dynamically > allocated buffer for one case and do not assign a NULL buffer in > another case. Mike: Please review. Thanks! -- Martin K. Petersen Oracle Linux Engineering