From patchwork Thu Sep 21 14:49:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 9964071 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 17B30602D8 for ; Thu, 21 Sep 2017 14:49:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C43429576 for ; Thu, 21 Sep 2017 14:49:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00FE92957B; Thu, 21 Sep 2017 14:49:31 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 8043A29576 for ; Thu, 21 Sep 2017 14:49:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751785AbdIUOta (ORCPT ); Thu, 21 Sep 2017 10:49:30 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34109 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751531AbdIUOt3 (ORCPT ); Thu, 21 Sep 2017 10:49:29 -0400 Received: by mail-wm0-f66.google.com with SMTP id i131so5447802wma.1; Thu, 21 Sep 2017 07:49:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=IvnkOO6i/JX1hQy0HugVQurKPRY/rD/beKbZsUQFuTQ=; b=A+sxiH9Bsw6xtz+uXf7jIuYuz8AyvYHjj57YfgNjVgiChaZLT2oQiKo8ecYlMtjxZH 4USAQlV7j0gqvAZFbBVIQDZQeyiwopkQ/KGZIL4ifNd+8GERB52hJzkopHHC9L/prc9I Hm8BE6gwUQ2/mMEDGpbrELL36DBwdHBuy3Ew2kFsYzfFartyOacHdNlF/CprYd3SouQO 7rnLVQugNTEg/FWscMzgWYumTK/cYGhhK+8zlm9qtsqtOqcp+vZMh6N6sEBCGYyT/v7P Sjzk26wvNOq+K4CWdWqzOBrcfhjmg6PzWbz6mpBm1p2sNG2OutvGdYaRIkbnmplkb5rH vnRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=IvnkOO6i/JX1hQy0HugVQurKPRY/rD/beKbZsUQFuTQ=; b=fX699g8uy6lQFiVOTe0/KITBOojyNfN7yQrYmv3eTUimQYUMkGRs3OvfZHCdGsAPoN sno2ltYJcFDVRFRETHL2vUecoRmQnkCLxaCbvl87HN3eduPjIqq412CZHdS4/AD/a+tz Ab37o0I4mrHNNhZMJ6Yu+QSXHIimvPzOnoF+ka8uyexx+FtGtT2mlz1BqMjGEnoiJ+Hg sSdsioDqTV0WLAdUvAvWCFN8HFHnNz6ZdnS5YpDJ1XcOGXVoM1hN99zzXs6ElL7NIhM7 j5RGyTz6fjLZZVwP120E5cb10T2gkK/LOZhQAR4ck0z8qcsIWia05KeHVBZrdBeOlHmg Fjzg== X-Gm-Message-State: AHPjjUhPbyQPrRf8QYCJTwdyg1kbXddBfRkirfeCqrCgjnqFLPCniSZy gsGMbOowTnLrZFVSZMGWlSoKK8mn X-Google-Smtp-Source: AOwi7QCyPbr/IX2pQathJDHUSfVa005UxzGSbEpHdAmyVK8VOyRjKaojQvo+vZMn7uBXsLdJz+NeQw== X-Received: by 10.28.26.138 with SMTP id a132mr1294694wma.25.1506005367328; Thu, 21 Sep 2017 07:49:27 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-246-117.clienti.tiscali.it. [78.12.246.117]) by smtp.gmail.com with ESMTPSA id b127sm1482526wmc.34.2017.09.21.07.49.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Sep 2017 07:49:25 -0700 (PDT) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: axboe@kernel.de, linux-block@vger.kernel.org Subject: [PATCH] block: drop "sending ioctl to a partition" message Date: Thu, 21 Sep 2017 16:49:22 +0200 Message-Id: <1506005362-13429-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP After the first few months, the message has not led to many bug reports. It's been almost five years now, and in practice the main source of it seems to be MTIOCGET that someone is using to detect tape devices. While we could whitelist it just like CDROM_GET_CAPABILITY, this patch just removes the message altogether. Signed-off-by: Paolo Bonzini --- block/scsi_ioctl.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 7440de44dd85..eafcd67e2480 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c @@ -707,24 +707,10 @@ int scsi_verify_blk_ioctl(struct block_device *bd, unsigned int cmd) case SG_SET_RESERVED_SIZE: case SG_EMULATED_HOST: return 0; - case CDROM_GET_CAPABILITY: - /* Keep this until we remove the printk below. udev sends it - * and we do not want to spam dmesg about it. CD-ROMs do - * not have partitions, so we get here only for disks. - */ - return -ENOIOCTLCMD; default: - break; + /* In particular, rule out all resets and host-specific ioctls. */ + return capable(CAP_SYS_RAWIO) ? 0 : -ENOIOCTLCMD; } - - if (capable(CAP_SYS_RAWIO)) - return 0; - - /* In particular, rule out all resets and host-specific ioctls. */ - printk_ratelimited(KERN_WARNING - "%s: sending ioctl %x to a partition!\n", current->comm, cmd); - - return -ENOIOCTLCMD; } EXPORT_SYMBOL(scsi_verify_blk_ioctl);