Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp695699imm; Fri, 21 Sep 2018 06:53:05 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbMw8S+ggVlGDDF0kRUL+h/Y6rEw0vFguWTYZ7un8FzH+s6JuVdpfohsUQsx/fjqqYeQm7d X-Received: by 2002:a63:64c2:: with SMTP id y185-v6mr6773850pgb.411.1537537985830; Fri, 21 Sep 2018 06:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537537985; cv=none; d=google.com; s=arc-20160816; b=I32p0NZMH0GvrJ6xVBBcULoqLqln1fXOSjOak98cbL7Md2PTLtjEdee6XqC7FOZWVL 7tSPGFZ+/k6YtHoMOkp2h1RpXDsQRJDnMHBhrpKddXFZ1oBjVK5lA3FfCqBFdobXA8Vy XboTlYtcpfzuNPLn1nOabJ0XNI2l/gprpby3NLcfMrs+CTv6tzS6WpMJMp1FkxaIzDz2 7mvqa5VqHmDMu7FCstPuaYR9aXJuC7ju7D0BIr2llbS3EP0JFmoCle2rHOLXZGBYR2mI 9FVsh3hNvhKulOQB7nA/Y+aJpJAN3L7IMZyPE4NzFtnULRXvD0nGXpgsOdrcXJz9VkhR l2zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=lEG/EKVPe05cxxnv5259Cj3BMviayd51BTh33CzCDOc=; b=EI6jKHJCiQkXYpi0iVOX9yLPH0IEZZ3P2BEsIDUCKaf6Kqljf9mxbiMTFE6dW1fI2I 3TLQkNQzkoYbMmYrcLjj77mVasJ2tBKbktrq9HOwscWM5XERaszMmF/FuiGnzqkNyzXQ 1c6sMIgfJzuICeWBVDdoHsYp6CYIyp/CMKbpBPpD+3eElRVDcTF933jIhPhsD//9g9nJ sSLA9ZcBxjpeMD99aVAS5zCOSjxOcvK975UfhuiuvL8YtQnEs8dKOiRpOsHsjneBf+w2 N20t2qyAg6pfeSEgYMB83at2Qx2bdjHgHHF8GTz5L1PpD8kt+2H/bLOQJHRhZLVCpqer i4SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailprotect.be header.s=mail header.b=idF+oADF; 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 x7-v6si6999355pga.638.2018.09.21.06.52.49; Fri, 21 Sep 2018 06:53:05 -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=fail header.i=@mailprotect.be header.s=mail header.b=idF+oADF; 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 S2389795AbeIUTlm (ORCPT + 99 others); Fri, 21 Sep 2018 15:41:42 -0400 Received: from com-out001.mailprotect.be ([83.217.72.83]:35411 "EHLO com-out001.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728098AbeIUTll (ORCPT ); Fri, 21 Sep 2018 15:41:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mailprotect.be; s=mail; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject: reply-to:sender:bcc; bh=lEG/EKVPe05cxxnv5259Cj3BMviayd51BTh33CzCDOc=; b=idF+o ADFRzoUoQQgi7xDAciQSh0iDTEAD4Ko939hc16mXKLjP5UGC22WqWd834GEq49mrX1SbAgj4IX1Ch 7Q52DvQTZnrCHP4o6YaC1m+qEOx86rFl2tJEpkbqTVnCVZQpKSKcFbGRHGkmjwEMTXfQcdPyXk2Uf lDsPcnmeQscTLLHKV0Sc0A9uFsVP46ZTQEXGr3VbexIh30l7+esQhYxzpdmr0YKYwqiEY6up8Zd6z ay8jSsfq//Sx3+24fpI/Hce7VTUZ0L/+EY3rk2Mzuse9ye0hY2yGsl5O0yftkbSmAe02IS/W4QezN siaPH/JMESX+Z1/tDwiOKphoc90LQ==; Received: from smtp-auth.mailprotect.be ([178.208.39.159]) by com-mpt-out001.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1g3LrL-000FDL-HQ; Fri, 21 Sep 2018 15:52:40 +0200 Received: from asus.site (c-174-62-111-89.hsd1.ca.comcast.net [174.62.111.89]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp-auth.mailprotect.be (Postfix) with ESMTPSA id E9CCFC07B4; Fri, 21 Sep 2018 15:52:35 +0200 (CEST) Subject: Re: [PATCH v2] scsi: sd: don't crash the host on invalid commands To: Johannes Thumshirn , "Martin K . Petersen" Cc: Linux Kernel Mailinglist , Linux SCSI Mailinglist , Hannes Reinecke , Christoph Hellwig References: <20180921070101.9260-1-jthumshirn@suse.de> From: Bart Van Assche Message-ID: Date: Fri, 21 Sep 2018 06:52:35 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180921070101.9260-1-jthumshirn@suse.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: 178.208.39.159 X-SpamExperts-Domain: mailprotect.be X-SpamExperts-Username: 178.208.39.128/27 Authentication-Results: mailprotect.be; auth=pass smtp.auth=178.208.39.128/27@mailprotect.be X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.06) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5qEGrhPEisnh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4Z+FT7fctuG6KQ7F UJu4bGno4HcWzTM+8NvWuEOaBFVKkIT35Qca9/LxmVk3n6Ce51Hb9nM= X-Report-Abuse-To: spam@com-mpt-mgt001.mailprotect.be Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/21/18 12:01 AM, Johannes Thumshirn wrote: > 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. Reviewed-by: Bart Van Assche