Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp4877437imd; Tue, 30 Oct 2018 08:40:53 -0700 (PDT) X-Google-Smtp-Source: AJdET5ci7iZ+zf4ZOFgkm8uhc3sJ1CEHvhGqPCMjSCmpkAM4GWL9F+zfiIf1rwB4/LJMiIFM9kY3 X-Received: by 2002:a63:1a1c:: with SMTP id a28-v6mr18167107pga.157.1540914053776; Tue, 30 Oct 2018 08:40:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540914053; cv=none; d=google.com; s=arc-20160816; b=UVDf0mt3kXcIoe1MOIw4FVZke/B/lwidaLAQhmiVZPJREtac1HS/fF78SRx0fjdw6S ScZ4qFV065Qzct40vCO+0zVHUwiUIAGKwmpltz1lSavkkwyzSZ5LE8vw2Px26u1h8Vid kFsqKYCFbxBLPn9zP20c8XD7VRdOayxzNYhb4nTJw9ZQt6iH5N+eqrjcA+y0neAmgmzV n/omkkJteOKgrhr+6QnoWsicswfKMt+4pt/g6sGv8zmDcwzc9l3S+ke9IPuCqVeQzYeO BO8PTjQOTSBAB+AHoqUlXNAqMgwat3XHycdOmukUEgqtJ/hdiISb5shzft7wXkLK7Hyc JTiQ== 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=55ckWGvPLucEZ6A7S9A1AJ7MTVz42QBk9yQvmKgwzxc=; b=cKGYkWQ2gdGDeYDhjCJN9I1sQ6Yu1X1opuhFxKWxiJd7HIl2VPFEEvZDsC9Yw+p+bA 9qhaiT3YrlPIADa4C1ZgqOUDhZvW/PSOBIRLjh8pZL9A3L2VrUkWSAqdAtPd2pEDqDJD LgVVtqBD5yeSDAy/pHZtRqJgKb/ZU1DEsTGxDim1LnvH5ZTtDVfSuBONbFzDOM/i2f+3 iFOpzgVDaAtJmgk7cE+pSpVXhDTy03A5zuk06zz+DowKKa1r0c3TVmT4H6S0qE6eTSVd zGu2RhLAVQS087r9zY+XHCI1f/7yjIT72Jbvm4pxtQ9Pz7wcDbGAp6DmoUvpYfQ5d/Dm c6ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=SbQ0z9k3; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w18-v6si23634360plp.147.2018.10.30.08.40.37; Tue, 30 Oct 2018 08:40:53 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=SbQ0z9k3; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726886AbeJaAd7 (ORCPT + 99 others); Tue, 30 Oct 2018 20:33:59 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:57126 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726549AbeJaAd7 (ORCPT ); Tue, 30 Oct 2018 20:33:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=55ckWGvPLucEZ6A7S9A1AJ7MTVz42QBk9yQvmKgwzxc=; b=SbQ0z9k3KbFUKKpXmkp3dFQik 4OZFN88GKQBN/8UmraKtjJXUOGI5UuDIhdrVo/KinNraL716rtrSYQ/oDeW7KkvYGIwALAw02ugs8 9vn88o5gjdxpqBKCYByD3fw65nt+cZIb/UDGKILl8VYp90g4gIjWLYCeZHdiOzGcMDaGi1V8VbeRd ufLaV3Z99BwOMrBgZKLnQMPvJtDJnmDjSF8HkWXy3nAanT/GJv7Q9NotvCDnbpLgn4QTFUAANe/Uq VTtWoPmO0epxhJ+DeC4MSyTeSoXUTEjCTK2C1cs3CRstLrDGtvDGBeyroHJlqHZRWed0Z6bgkKVlK wyRTlOdKQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHW7O-0005ed-GQ; Tue, 30 Oct 2018 15:39:46 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id EFADE2029FA14; Tue, 30 Oct 2018 16:39:44 +0100 (CET) Date: Tue, 30 Oct 2018 16:39:44 +0100 From: Peter Zijlstra To: Matthew Wilcox Cc: Igor Stoppa , Mimi Zohar , Kees Cook , Dave Chinner , James Morris , Michal Hocko , kernel-hardening@lists.openwall.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, igor.stoppa@huawei.com, Dave Hansen , Jonathan Corbet , Laura Abbott , Greg Kroah-Hartman , Andrew Morton , Masahiro Yamada , Alexey Dobriyan , Pekka Enberg , "Paul E. McKenney" , Lihao Liang , linux-kernel@vger.kernel.org Subject: Re: [PATCH 13/17] prmem: linked list: disable layout randomization Message-ID: <20181030153944.GB13436@hirez.programming.kicks-ass.net> References: <20181023213504.28905-1-igor.stoppa@huawei.com> <20181023213504.28905-14-igor.stoppa@huawei.com> <20181026093205.GD3159@worktop.c.hoisthospitality.com> <20181026101707.GO25444@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181026101707.GO25444@bombadil.infradead.org> 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 Fri, Oct 26, 2018 at 03:17:07AM -0700, Matthew Wilcox wrote: > On Fri, Oct 26, 2018 at 11:32:05AM +0200, Peter Zijlstra wrote: > > On Wed, Oct 24, 2018 at 12:35:00AM +0300, Igor Stoppa wrote: > > > Some of the data structures used in list management are composed by two > > > pointers. Since the kernel is now configured by default to randomize the > > > layout of data structures soleley composed by pointers, this might > > > prevent correct type punning between these structures and their write > > > rare counterpart. > > > > 'might' doesn't really work for me. Either it does or it does not. > > He means "Depending on the random number generator, the two pointers > might be AB or BA. If they're of opposite polarity (50% of the time), > it _will_ break, and 50% of the time it _won't_ break." So don't do that then. If he were to include struct list_head inside his prlist_head, then there is only the one randomization and things will just work. Also, I really don't see why he needs that second type and all that type punning crap in the first place.