Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp137968imm; Tue, 25 Sep 2018 17:53:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV63IIG/M4SbVWHVih5WkrGUbC0GL8UIf0UU9MXmy8J2rr2MUH4F1YwPwAyHMP/p16icht6PB X-Received: by 2002:a17:902:280a:: with SMTP id e10-v6mr3476137plb.187.1537923231163; Tue, 25 Sep 2018 17:53:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537923231; cv=none; d=google.com; s=arc-20160816; b=V+6m+unFeOAk45tJJA6XLw+yp72A8RVWiweHV5Be9vXlNuVW/r2WcOmVD+ApV4QRdt EHHWSdA7w/1u7lFiqDEunQtK6eeDNpaTsq2wja69y6GHIyOPuaMy/7uOP9+LCClg+rQU e5JL4OB2Ku1w4a33Tt/ezRQaYSvl3IDbKBhcOl99pwtDr59zZs1Y2eRzWzGL6H4xD0iN 5hMRY9Sp49jk2u1YMQ/S4PzsRdPDYd44I1MJ3LD3/7u3Vx+c+oIqI10vlNkAe117MPJz IEx3mDn3E7u4XkJ9KjxW+CaJlVuj9Fz+wOCiPJYliiGHS5+XAAegZDssRsMquPQNVUdq MLMA== 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; bh=Jk4O/MacvM9YCb/DJt2sX3d5C4wDUaJw8b7DcHqJBjA=; b=JbAsSSeMPfKtT9hcr/SLaSyiIn8qEdkXcchvRGYC2dUdjPtRr7RDG0OTPprmIGSf+q eVSqAyy59zPiNOZTGA3RS2Ehs6epobGnrjogR/6MaVnPuo1w2dE/mzvgLLqo1V+0rJZ2 icR8KpH4wdgajqy0yEwgdbtQwd9iMQuJAkZa7gfQSL1/INSdb02IL0b7UyzU5gl2mW74 nkBZfT9H+ljU5Kt+SA6kCwqj1prgSly3TcNhVhpTbaFIo4HIxlEZPIQ1QiK5MpegiZkB 9/5/g1yxSuN71JP8jNCRIWlkl9ph6uxwgZ+Io9tPeqcJDCtRBpAYm2ngoaGAJR6qSwNy +Z+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=nuaHsEVO; 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 d34-v6si4062217pla.195.2018.09.25.17.53.35; Tue, 25 Sep 2018 17:53:51 -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=nuaHsEVO; 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 S1727077AbeIZHDU (ORCPT + 99 others); Wed, 26 Sep 2018 03:03:20 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:54618 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726190AbeIZHDU (ORCPT ); Wed, 26 Sep 2018 03:03:20 -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 w8Q0jMTn029769; Wed, 26 Sep 2018 00:53:03 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=Jk4O/MacvM9YCb/DJt2sX3d5C4wDUaJw8b7DcHqJBjA=; b=nuaHsEVONuufguJs5onQOxzS3BkA61cT2xszn8crH5d/qc8/m3HCLH9DwzcBQ+pN6vyp UJSXcUwBgtTJwaWfHPL8DQlDPSOyyb2zYjuDztXgaQYqge8+MJKQrVtk3UKCGHKunhSZ uJKbrwgm9pHUhTvIdlxYt4si4frU+SeeML0rN9gD4ROt3rckWu3ZHZ4DQ5bp9Nw708qS SiadbBecoJ8RGJ6aqjN5tnYV1BvA8/m+PV8gJ0cOJ9hqqZ7X13d2obITA1HrcLgcbXg2 zaNMqaJ/K++2dbpshLLSHfhMZFYNVSs3V5yrrTRM6dklsCElRN7x5Qo0zxcubD5Esmx0 xA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2mnd5tffr5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Sep 2018 00:53:02 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w8Q0r2km030899 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Sep 2018 00:53:02 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w8Q0r1BN022908; Wed, 26 Sep 2018 00:53:01 GMT Received: from ca-mkp.ca.oracle.com (/10.159.214.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 25 Sep 2018 17:53:01 -0700 To: Johannes Thumshirn Cc: "Martin K . Petersen" , Linux Kernel Mailinglist , Linux SCSI Mailinglist , Hannes Reinecke , Bart Van Assche , Christoph Hellwig Subject: Re: [PATCH v2] scsi: sd: don't crash the host on invalid commands From: "Martin K. Petersen" Organization: Oracle Corporation References: <20180921070101.9260-1-jthumshirn@suse.de> Date: Tue, 25 Sep 2018 20:52:58 -0400 In-Reply-To: <20180921070101.9260-1-jthumshirn@suse.de> (Johannes Thumshirn's message of "Fri, 21 Sep 2018 09:01:01 +0200") 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=9027 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=569 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809260006 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Johannes, > When sd_init_command() get's a with a unknown req_op() it crashes the > system via BUG(). > > This makes debugging the actual reason for the broken request > cmd_flags pretty hard as the system is down before it's able to write > out debugging data on the serial console or the trace buffer. > > Change the BUG() to a WARN_ON() and return BLKPREP_KILL to fail > gracefully and return an I/O error to the producer of the request. Looks like a bunch of my merge mails didn't make it out last week. For the record, I did merge this into 4.19/scsi-fixes and it has made its way upstream. -- Martin K. Petersen Oracle Linux Engineering