From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Martin K. Petersen" Subject: Re: [PATCH v3] sg: mitigate read/write abuse Date: Tue, 26 Jun 2018 13:11:56 -0400 Message-ID: References: <20180625142544.182673-1-jannh@google.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Post: List-Help: List-Unsubscribe: List-Subscribe: In-Reply-To: <20180625142544.182673-1-jannh@google.com> (Jann Horn's message of "Mon, 25 Jun 2018 16:25:44 +0200") To: Jann Horn Cc: Doug Gilbert , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, Christoph Hellwig , Al Viro , Andy Lutomirski , linux-kernel@vger.kernel.org, Jens Axboe , FUJITA Tomonori , kernel-hardening@lists.openwall.com, security@kernel.org, Benjamin Block List-Id: linux-scsi@vger.kernel.org Jann, > As Al Viro noted in commit 128394eff343 ("sg_write()/bsg_write() is > not fit to be called under KERNEL_DS"), sg improperly accesses > userspace memory outside the provided buffer, permitting kernel memory > corruption via splice(). But it doesn't just do it on ->write(), also > on ->read(). > > As a band-aid, make sure that the ->read() and ->write() handlers can > not be called in weird contexts (kernel context or credentials > different from file opener), like for ib_safe_file_access(). Applied to 4.18/scsi-fixes with the naming fix pointed out by Doug. Thanks! -- Martin K. Petersen Oracle Linux Engineering