Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1141139imm; Sun, 2 Sep 2018 11:10:08 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb/78TA+2y54xb2XXrfte9StI/AVFImVmTETdtI0+su722ExxZs8T/C/DzsADqyg2SAZ0eX X-Received: by 2002:a63:4283:: with SMTP id p125-v6mr23157743pga.142.1535911808557; Sun, 02 Sep 2018 11:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535911808; cv=none; d=google.com; s=arc-20160816; b=lprv0W7JMdVWddixGOD+uMrAuLZAvGunSJ+cq23wRYiD5JvJFUoAc9JZd9LcBokny/ aAjpoRKspuJm07DijgeihyGtYCWSmSWJMtkKeo1ytiaPXjLOm9BwcCjfvvpy1t3ApNnq p63UtWrLR6YQUj6JRnh7Ww/4pOSnstUDntpF+5xbaasH65R5olsJsYxN8SYl36j5GVpI HjC0Z9cBUfZPnE89lZC06A3JlKl97503KZ+JeUrNHE8xIGZLV37O928UcvqyNigT4zax OtQKMszZfbSwAIEzJSTaCHn0GYhB81JCzI8ktu3HpVPbDmGFUi3Y5jlHw6s6JCkvzuo2 FYmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=nyhWyYVLeXxsm5jta3Rs0eGxTrHuILH40AqO8R7l5G8=; b=YVXt6/B4y/uFTa9wswwxvSuzd8eBDo337+5QWcls6odf+J2fdUmUFHdU8Y1YSrkgNU JYtZ1O//nG+recNZgYQEUi4KhZgxLhupueFkGt0qfJCijZZIM+eFHKiQqiN2EKobRvZX LFqvq8wXLkkbIgHUmQkjGjn6Yb2z1YCx4bFGs7q2ops/QN5N8AXOLHrdpo1WckCX9gXt yg3Rit8cz6+ixMFDoUxHnkh/qL3s/Eew2+7t0nusjJJd37M2zcOhBta0HYXlK7NMQwvJ sYGs+wfin0Y+xq+abV92BtZ0wYtAO6bJAx7c6NVoJqfxkPfqNGQtZqevHf0tN9WosiyR vzaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=UCuKlGIH; 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 o20-v6si16208799pgh.319.2018.09.02.11.09.52; Sun, 02 Sep 2018 11:10:08 -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=@linux-foundation.org header.s=google header.b=UCuKlGIH; 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 S1727199AbeIBWMH (ORCPT + 99 others); Sun, 2 Sep 2018 18:12:07 -0400 Received: from mail-io0-f171.google.com ([209.85.223.171]:42085 "EHLO mail-io0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726065AbeIBWMG (ORCPT ); Sun, 2 Sep 2018 18:12:06 -0400 Received: by mail-io0-f171.google.com with SMTP id n18-v6so14211503ioa.9; Sun, 02 Sep 2018 10:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nyhWyYVLeXxsm5jta3Rs0eGxTrHuILH40AqO8R7l5G8=; b=UCuKlGIHQJBOsOH6kzcP85bWXlCKGBk7RJRdrBefQ1Iy/cezySZhXw58+qrQRAynUM iO4w7QLt2+OUUClvFAZZ9/3mFOOlLQp1mb/oCdK+h+v90TWguGn1Q15TaqWbqBLlkvv0 YanOOTWttuSvSlKG+sWR5+34XKYTeQfWmhLNo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nyhWyYVLeXxsm5jta3Rs0eGxTrHuILH40AqO8R7l5G8=; b=ZmLK0fDjFD7J+K2iO/+uMTZkcPLSNZdok19aGY4mxMXIuZ3AZsuXSqs87pOgzDqd1r 0LuAEq/QyuYVN5geC9tUSjnWWHIL7pz1Tzrcw2RxxUuUFm7A4UwNM/gjlqjBSfZvVClI mA/fye+ezA6f3gd6+XEEFl+tWtAtgyni7uyWtSzFWow3Hr69yJen+nzqpR8p0BhwAizI V28TuHT/9IKGriEXPZCpN1RgySHJi0bDh85DxIiZ3kHRHSRhNNzcd5lpYknC8YoRgt+i 8a0glyR+8TBGZ6nJlcXO9NCJ/ZCD8E7M7TcWYfFCZGEmRaq3Fj1L2s+hMSi/RlzYkZpO CQrg== X-Gm-Message-State: APzg51AuUYSO01on6oda4BVkL8oiaOM929T81OC5gbNWw/Ga29vrj2lv 4HK7rmAQ0Lhyy7bAZo7tXEaYCoz4EbHDSmt1Quw= X-Received: by 2002:a6b:7a49:: with SMTP id k9-v6mr18245282iop.238.1535910932112; Sun, 02 Sep 2018 10:55:32 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Sun, 2 Sep 2018 10:55:21 -0700 Message-ID: Subject: Re: Recent removal of bsg read/write support To: richard -rw- weinberger Cc: drorl@infinidat.com, Linux Kernel Mailing List , linux-block , Linux SCSI List , Christoph Hellwig , Jens Axboe Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 2, 2018 at 4:44 AM Richard Weinberger wrote: > > CC'ing relevant people. Otherwise your mail might get lost. Indeed. > On Sun, Sep 2, 2018 at 1:37 PM Dror Levin wrote: > > > > We have an internal tool that uses the bsg read/write interface to > > issue SCSI commands as part of a test suite for a storage device. > > > > After recently reading on LWN that this interface is to be removed we > > tried porting our code to use sg instead. However, that raises new > > issues - mainly getting ENOMEM over iSCSI for unknown reasons. Is there any chance that you can make more data available? I'd rather fix the sg interface (which while also broken garbage, we can't get rid of) than re-surrect the bsg interface. That said, the removed bsg code looks a hell of a lot prettier than the nasty sg interface code does, although it also lacks ansolutely _any_ kind of security checking. > > Because of this we would like to continue using the bsg interface, > > even if some changes are required to meet security concerns. I wonder if we could at least try to unify the bsg/sg code - possibly by making sg use the prettier bsg code (but definitely have to add all the security measures). And dammit, the SCSI people need to get their heads out of their arses. This whole "stream random commands over read/write" needs to go the f*ck away. Could we perhaps extend the SG_IO interace to have an async mode? Instead of "read/write", have "SG_IOSUBMIT" and "SG_IORECEIVE" and have the SG_IO ioctl just be a shorthand of "both". And have a model that actually checks that "yeah, this command is ok for a normal user", so that it's actually useful for things like CD burning etc, without making it a huge gaping security hole that is only useful for crazy special cases? Maybe that - otherwise reasonably pretty - block/bsg.c code could be joined with the SG_IO code that actually understands security issues? Linus