From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f69.google.com (mail-it0-f69.google.com [209.85.214.69]) by kanga.kvack.org (Postfix) with ESMTP id 8BF076B03A7 for ; Wed, 5 Apr 2017 15:39:19 -0400 (EDT) Received: by mail-it0-f69.google.com with SMTP id o15so9093034ito.14 for ; Wed, 05 Apr 2017 12:39:19 -0700 (PDT) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com. [2607:f8b0:4001:c06::230]) by mx.google.com with ESMTPS id r20si22325884ioe.110.2017.04.05.12.39.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Apr 2017 12:39:18 -0700 (PDT) Received: by mail-io0-x230.google.com with SMTP id b140so16769934iof.1 for ; Wed, 05 Apr 2017 12:39:18 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20170330194143.cbracica3w3ijrcx@codemonkey.org.uk> <20170331171724.nm22iqiellfsvj5z@codemonkey.org.uk> From: Kees Cook Date: Wed, 5 Apr 2017 12:39:17 -0700 Message-ID: Subject: Re: sudo x86info -a => kernel BUG at mm/usercopy.c:78! Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Linus Torvalds Cc: Tommi Rantala , Dave Jones , Linux-MM , LKML , Laura Abbott , Ingo Molnar , Josh Poimboeuf , Mark Rutland , Eric Biggers On Tue, Apr 4, 2017 at 5:22 PM, Linus Torvalds wrote: > On Tue, Apr 4, 2017 at 3:55 PM, Linus Torvalds > wrote: >> >> I already explained what the likely fix is: make devmem_is_allowed() >> return a ternary value, so that those things that *do* read the BIOS >> area can just continue to do so, but they see zeroes for the parts >> that the kernel has taken over. > > Actually, a simpler solution might be to > > (a) keep the binary value > > (b) remove the test for the low 1M > > (c) to avoid breakage, don't return _error_, but just always read zero > > that also removes (or at least makes it much more expensive) a signal > of which pages are kernel allocated vs BIOS allocated. This last part (reading zero) is what I'm poking at now. It's not obvious to me yet how to make the mmap interface hand back zero-mapped pages. I'll keep digging... -Kees -- Kees Cook Pixel Security -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org