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.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,FSL_HELO_FAKE,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham 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 62F79C10F13 for ; Thu, 11 Apr 2019 17:58:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 34F032070D for ; Thu, 11 Apr 2019 17:58:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FCZS5QOt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="TqRT/D2b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34F032070D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Q18UtZcWYERf/gAD8khgKvJ2wFrrWdWD4ilTnj1zbeE=; b=FCZS5QOt8dNpO0 5+PcluB0fI2RUSYWkHbJlNt1YVgvd97L7F5jdjqexuvymMiHwzdvEw7wHqzCIWU855pgiKAuzQ/qO DRhEFEinG97ux6rbDGKoAD7C1Hrum733XGRPN+7Uibnr8zFBZGoXo6OsHWzjnTZ4YOMIcD1rf04H3 uAalJdVQOc1hbIdAQ2m3zvrBaL548yF10Vkz5EWEY0fJBMlEL7pxAAyeLp4we2i+SIf/6u3cgR9rE c0dFhiy1KK79mOuzYa+7S3jvBeWil/8k42MSXP/lJhXrMEnQc7sJ6suZOPezTWw2KgUXTDqEWcSEn SogGkR4ygZr1rFfsCcVQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEdy2-0003GM-NJ; Thu, 11 Apr 2019 17:58:30 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEdxy-0003Fz-U5 for linux-arm-kernel@lists.infradead.org; Thu, 11 Apr 2019 17:58:28 +0000 Received: from gmail.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2A37F2070D; Thu, 11 Apr 2019 17:58:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555005506; bh=pDhoCNdjeWrX/vbXMoWNxoXMBQ5uWIGVajVGVcqJMWQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TqRT/D2bY+vD2/ipEBuIR7EhPIJZ1dyOdUd1PhF/ZbNz1X2+KRuqX4zrziUuz9cOB uTT0Xr1mikQiwpDMnAwdPiA3W4KqXFwtWOzwrjpiHfke0Dw2OoA9d4XEs2qFwSrj+W 15+Z2cp/nX6yoafj5Xgw7D4l9bqFSqf4r4T8hvIk= Date: Thu, 11 Apr 2019 10:58:24 -0700 From: Eric Biggers To: Kees Cook Subject: Re: crypto: Kernel memory overwrite attempt detected to spans multiple pages Message-ID: <20190411175823.GC225654@gmail.com> References: <20190319170911.GB202956@gmail.com> <20190320185719.GB180195@gmail.com> <20190321175122.GA1587@sol.localdomain> <20190410031734.GB7140@sol.localdomain> <20190410190729.GA120258@gmail.com> <20190410231156.GB120258@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190411_105826_992878_CC460029 X-CRM114-Status: GOOD ( 14.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Herbert Xu , Rik van Riel , Linux Kernel Mailing List , linux-security-module , Geert Uytterhoeven , Linux Crypto Mailing List , Laura Abbott , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 10, 2019 at 04:27:28PM -0700, Kees Cook wrote: > On Wed, Apr 10, 2019 at 4:12 PM Eric Biggers wrote: > > You've explained *what* it does again, but not *why*. *Why* do you want > > hardened usercopy to detect copies across page boundaries, when there is no > > actual buffer overflow? > > But that *is* how it determines it was a buffer overflow: "if you > cross page boundaries (of a non-compound allocation), it *is* a buffer > overflow". This assertion, however, is flawed because many contiguous > allocations are not marked as being grouped together when it reality > they were. It was an attempt to get allocation size information out of > the page allocator, similar to how slab can be queries about > allocation size. I'm open to improvements here, since it's obviously > broken in its current state. :) > > -- > Kees Cook Well, I'm still at a loss as to whether I'm actually supposed to "fix" this by adding __GFP_COMP, or whether you're saying the option is broken anyway so I shouldn't bother doing anything. IIUC, even the kernel stack is still not marked __GFP_COMP, so copies to/from the stack can trigger this too, despite this being reported over 2 years ago (http://lkml.iu.edu/hypermail/linux/kernel/1701.2/01450.html)? CONFIG_HARDENED_USERCOPY_PAGESPAN is even disabled in syzbot because you already said the option is broken and should not be used. I worry that people will enable all the hardened usercopy options "because security", then when the pagespan check breaks something they will disable all hardened usercopy options, because they don't understand the individual options. Providing broken options is actively harmful, IMO. - Eric _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel