Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2018976imm; Thu, 21 Jun 2018 06:04:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJDGESXKp23lMc5fr5nCjyOGoouG39CHBO8TS71rplth5EM/C7KDrzWYIzRrl3qFVaEePa4 X-Received: by 2002:a65:4a42:: with SMTP id a2-v6mr22750407pgu.367.1529586280054; Thu, 21 Jun 2018 06:04:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529586280; cv=none; d=google.com; s=arc-20160816; b=ziOE+9kHjZdy2iNEq1YRwQHSMaFHvkFJQaqzdGsdsw+75NIUhl5EhvVyGNiENkDS24 Cv7Wgk8NaPEcoo+pacIM/Rl1QtoESAS/k3SnZPQgq1HwxGloYYl9UOtFiXqM6nMgdSm7 zST/IRhHaAJF1CYusb23Tjenacx5ScFvwvkN9TrIyAwR82eXkVc2Iy0xty9ou+/QXYVI a4CArUvB5JcyHaNj2qfd6DBI13i/9vDG+sBRDvmf6H+0rOkGONZ8fdMp37ZP5rsw5RK7 WOpimWKx/cXcYx1JRWESTucS9VaeowvVGMv4FDGQ/X0Nu143V6qXUOBgmqULqOiWZgyV qWew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=9IXDWkAXBmF71F26ka05Xhv15UCQmVpOrP73Kt2mfHk=; b=Bo/XpULsyXpnXMWO0XhfP8+2imPdMWr82lUbfbXe95dX16OkrRJfLyrcFht5zZ3OzN r1IdrHzwD+RGX1PPshCmJpN41Bk43MiSHlOlzJCtSnuXLM/jBbTGlvtWn0GTHT/cQqFT zWZPzd/3P3cZyk5WHz5K0NOlbjRetMMgFbmvQhicvGT9dhjJ8oMV9i2datSikImr5ENp M0irkLxkLN/fHum6s00GBXVT5jhugUg8Q0M0S5JArY9d2nh6zFPQAlBW2mUZeYs6m8dm gUInhhnOHUuG+G3RjFE1o216gSanoRl6ivfk12f2LrUJpFaSZs6eg5XX1FlFGCv08kmu QndQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=BcrTgjsf; 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 m8-v6si4685959plt.29.2018.06.21.06.04.25; Thu, 21 Jun 2018 06:04:40 -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=@infradead.org header.s=bombadil.20170209 header.b=BcrTgjsf; 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 S933460AbeFUNDl (ORCPT + 99 others); Thu, 21 Jun 2018 09:03:41 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:38250 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933169AbeFUNDj (ORCPT ); Thu, 21 Jun 2018 09:03:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=9IXDWkAXBmF71F26ka05Xhv15UCQmVpOrP73Kt2mfHk=; b=BcrTgjsfSzRN7ycJu/L75BmXq cjgMs4QrXp8ygBEr6TZ3AfU+71Q2+6hmZP6wjPLEGuuH601qRAw4sim51qnPAJMXgUfXD/cr97fQ0 PX5TMaSXPHFbaC6S1f1QlBulVS4N57YL3hPYplDUVuU3lsrSN8wC5g+xiXVv+iuIVdmU/8Lx/7EXp AMmfSQT9EMRfQ62tTpJeTVx4nUspt2UI6rGWJUom0A0BXYZTEbX66CGtSJgaBPwzKAWexcDzT80dT bwhISU0jVI58EhdSdKhRR7o5FM25xb2pRz7Ile1mornUF3e3RA6Xrva10Q6P7zjq1JN7UQvXXkvFo w7wv3gitQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVzFH-00049A-R0; Thu, 21 Jun 2018 13:03:27 +0000 Date: Thu, 21 Jun 2018 06:03:27 -0700 From: Christoph Hellwig To: Jann Horn Cc: Christoph Hellwig , axboe@kernel.dk, dgilbert@interlog.com, Al Viro , fujita.tomonori@lab.ntt.co.jp, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, kernel list , Kernel Hardening , security@kernel.org, Alexander Nezhinsky , Nicholas Bellinger , stgt@vger.kernel.org Subject: Re: [PATCH] sg, bsg: mitigate read/write abuse, block uaccess in release Message-ID: <20180621130327.GB24925@infradead.org> References: <20180615152335.208202-1-jannh@google.com> <20180615164009.GD30522@ZenIV.linux.org.uk> <90063ef3-68fa-e983-9b47-838e6076b0f4@interlog.com> <813e817b-bb2f-4a47-6225-9e39f19be278@kernel.dk> <20180621123431.GA558@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 21, 2018 at 02:51:16PM +0200, Jann Horn wrote: > In the package https://packages.debian.org/stretch/tgt: > https://sources.debian.org/src/tgt/1:1.0.73-1/usr/bs_sg.c/?hl=131#L131 > https://sources.debian.org/src/tgt/1:1.0.73-1/usr/bs_sg.c/?hl=236#L236 This is for real, although it is an optional case in an optional plug in, so I'm not sure if any one actually uses bsg read/write with it for real. The usual aspects added. (the question is if bsg read/write support is actually used in real life or can be removed) > In the package https://packages.debian.org/stretch/sg3-utils: > https://sources.debian.org/src/sg3-utils/1.42-2/examples/bsg_queue_tst.c/?hl=60#L60 This is just example code.