From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E796C433EF for ; Fri, 15 Jun 2018 16:40:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 50120208B2 for ; Fri, 15 Jun 2018 16:40:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 50120208B2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ZenIV.linux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966218AbeFOQkV (ORCPT ); Fri, 15 Jun 2018 12:40:21 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:39802 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966019AbeFOQkU (ORCPT ); Fri, 15 Jun 2018 12:40:20 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fTrlh-0005lr-MX; Fri, 15 Jun 2018 16:40:09 +0000 Date: Fri, 15 Jun 2018 17:40:09 +0100 From: Al Viro To: Jann Horn Cc: Jens Axboe , FUJITA Tomonori , Doug Gilbert , "James E.J. Bottomley" , "Martin K. Petersen" , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, security@kernel.org Subject: Re: [PATCH] sg, bsg: mitigate read/write abuse, block uaccess in release Message-ID: <20180615164009.GD30522@ZenIV.linux.org.uk> References: <20180615152335.208202-1-jannh@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180615152335.208202-1-jannh@google.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 15, 2018 at 05:23:35PM +0200, Jann Horn wrote: > I've mostly copypasted ib_safe_file_access() over as > scsi_safe_file_access() because I couldn't find a good common header - > please tell me if you know a better way. > The duplicate pr_err_once() calls are so that each of them fires once; > otherwise, this would probably have to be a macro. > > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Cc: > Signed-off-by: Jann Horn > --- WTF do you mean, in ->release()? That makes no sense whatsoever - what kind of copy_{to,from}_user() would be possible in there?