Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6188674yba; Thu, 11 Apr 2019 14:05:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpjoJdFdmKQhsDmvcNcPs3v15x/F96JpqB2V5dDNx7Y4Yt/RGTf5aHI0YldvdnpKKn1DoW X-Received: by 2002:aa7:8694:: with SMTP id d20mr53065514pfo.81.1555016710800; Thu, 11 Apr 2019 14:05:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555016710; cv=none; d=google.com; s=arc-20160816; b=XPdQVsh5c60IMZPMrQ8kbVdKk0DOajXS9FHUK1vDQbFIyteQVEVbryBwnlq5IRY5EV gIKqIyWe9ZFGlG16mfq42LUyvZl5xiyO0jc7O7ZvJ+Ar98S/V/WBwbj3SYk8QWuOpinY JcvydqIz/YH7XjjupMT/Zr6n3Dx6ESqISkyMS31ilC8ml/HKXIqGm9DXPmkhPp5vg/L6 hPcxiWIgwawtgNBcuwIZZ+aazWooewM4pv1Yk+c+IENkC1XSOZcCT6+SdoKSUl0ov9q3 f+fwixxKb2Ofu8QFj/UHp72PhkySTB35lW6Pk+WRa/NTi174PoV7S2GYR1Ghn/J9Mm4O aTPw== 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; bh=LkJK73fZo2bGFN+2FkJksejZukJxQxYNrIa8TaW51xM=; b=dU6NnafH6gLiBMoPo24A2MbA6421ZWyYbWWQ9earSv45XKoz5sHSHYETW8yFF1DNMU WWqcbeVb/jcd/W9Ozd1LfnT+u+ThuE2rLNN2fStu0wll2qKp2BT+sLr9Pnjh/A9/5bi6 itVvpCDSF01UoQmQDzov0kfIkfBh1j6rOtp/wsX6UiBb8n166GPprvluDPP32nPymcaZ btc/FHoN08ZP6lQlgL/2bAUgbVeJGnYVeI48JCIb+UhZgbb6vl9UYUKoD4HQMnr6rGGP ZRpj7oK0YqmuI1LggArFNczM8FpVjZZCdkSeWFBwGsGkM5oRQBaZ6Zajjiq6BTW6oO4c 8kXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wPDQirIs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si10033217plc.303.2019.04.11.14.04.54; Thu, 11 Apr 2019 14:05:10 -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=pass header.i=@kernel.org header.s=default header.b=wPDQirIs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727074AbfDKVED (ORCPT + 99 others); Thu, 11 Apr 2019 17:04:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:40388 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726723AbfDKVED (ORCPT ); Thu, 11 Apr 2019 17:04:03 -0400 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 3FE532146F; Thu, 11 Apr 2019 20:56:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555016203; bh=rBrc//Q8zkoBO+A9SsRSKoG9WGpSqk/8v99bH2iG5No=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wPDQirIsuHS5B2351kVZEj22FJLGqwUYvVMz4uKk743DHmbgBnRF3JgLtTuw8ph0E WaCg0I1PWscaFjRPzGnAO/jGP47dAx4wE2onubgeXY7SL0OS/HYT/Aj0ka7jk2z81K BEUUBQOqppvUjGPpabEkBIQe13AjAl2n+O5HhqSI= Date: Thu, 11 Apr 2019 13:56:41 -0700 From: Eric Biggers To: Kees Cook Cc: Dmitry Vyukov , Geert Uytterhoeven , Herbert Xu , linux-security-module , Linux ARM , Linux Crypto Mailing List , Linux Kernel Mailing List , Laura Abbott , Rik van Riel Subject: Re: crypto: Kernel memory overwrite attempt detected to spans multiple pages Message-ID: <20190411205640.GE225654@gmail.com> References: <20190410031734.GB7140@sol.localdomain> <20190410190729.GA120258@gmail.com> <20190410231156.GB120258@gmail.com> <20190411175823.GC225654@gmail.com> <20190411192607.GD225654@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 11, 2019 at 01:36:37PM -0700, Kees Cook wrote: > On Thu, Apr 11, 2019 at 12:26 PM Eric Biggers wrote: > > Well, I guess I'll just add __GFP_COMP so I at least don't get spammed with > > useless bug reports. > > Thanks, I appreciate it. > > > But I don't think it's in any way acceptable to change the semantics of the > > kernel's page allocator but only under some obscure config option, don't > > document it anywhere, ignore the known problems for years, say that the option > > is broken anyway so it shouldn't be used, and have to exchange 15 emails to get > > anything resembling an explanation. > > I understand what you mean, yeah. I'm sorry I wasn't clear about it > earlier. What do you think might help the situation as far as > documentation? > Explanation in Documentation/core-api/memory-allocation.rst of when to use __GFP_COMP and why. Where "why" includes the real underlying reason why it's designed the way it is, not just "you now need to provide this flag in order to stop the hardened usercopy thing from crashing, even though previously it meant something else, because that's the way it is." Also a brief, improved explanation of __GFP_COMP in include/linux/gfp.h. Also get Documentation/security/self-protection.rst up to date with what's actually in the kernel. Currently it doesn't mention hardened usercopy at all, and it's unclear about what's supported now vs. what is future work. And actually fix the known problems with the pagespan check, not ignore them for years. If not feasible, remove the option. - Eric