Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2689259ybi; Sun, 28 Jul 2019 15:17:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzX7KIBty8CbeRMjZt9qsA1uZRvi5sbRZWmYg4u1f1cYw+eMjb4LZy0b9sc/f7jcBDULFIv X-Received: by 2002:a63:fb43:: with SMTP id w3mr3420944pgj.403.1564352274406; Sun, 28 Jul 2019 15:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564352274; cv=none; d=google.com; s=arc-20160816; b=H/I4uEz4hm9NYXGN9LW7XA7lrRMNoFUODuStVGev/oHfo7ZBBjfymRrh70tie3gkHb UfLaxq9p1MU912Gz2Na3361WckP1sZGstxDLm2+bmxq+JUBUgrmuVuEIfCpEYN8Ed1Ey 24SHuZM0L9koT1vqUsoOKIlhJOdfZO/UgchFAIZgHCqVGZgYRpUA/ddKVqgW6845s19w psHj0gmS0Tl2C2ghiEDkc4nPz1ZtFef7OevOifSgZffnEDj45akirfSxhcwLv8PT9Rxa wSs88aJSGT9ETHCJOCi166bvDklNsR3WD23hTdF5c5hpaFpKTrReHbvBqBt25btGi6qu At3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=c8YSToKmG8S+pAYeJq04gGadIuFi0aiciNczjeIoUfY=; b=vA30fZaTOxvP1CHEJHUdVNE8yaxYDLkx6UXBoBzdWo/hGZXr5KbGQWei6i3UMtAlKq jySrj7S5H1evzFVagLcWQELgpbV/oMhVj6DAH5DnxwNrwihO4gw8/o5m2zm7/AD5Q4Gp AcoUTiRTAOqSPCmQEZMjJvtNdehaxE0vW1xRwABNZOYngDYLcXd0vIGHPPChCSue6eXC 0LnfL0kArVwa0MDhQGuFW99giSCKSl0y27ZkY+BWJk67SPsWq3Am5cPkrsrjvgP5KKTi j+nKNlq9gAozZDFTf+MmhoibvPw3XEIr8+pcvPnISRnwz6R6iHxQo+ovNdjOIVpECA3n AUtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PupS4yiK; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si24091026pga.118.2019.07.28.15.17.38; Sun, 28 Jul 2019 15:17:54 -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=@chromium.org header.s=google header.b=PupS4yiK; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726203AbfG1WQb (ORCPT + 99 others); Sun, 28 Jul 2019 18:16:31 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:33664 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726103AbfG1WQa (ORCPT ); Sun, 28 Jul 2019 18:16:30 -0400 Received: by mail-pl1-f193.google.com with SMTP id c14so26651879plo.0 for ; Sun, 28 Jul 2019 15:16:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=c8YSToKmG8S+pAYeJq04gGadIuFi0aiciNczjeIoUfY=; b=PupS4yiK7F/aaFtrJN1Qs/vag2f9vfElBk2oZ4GtPdDHk4oTBX4ZWlYrssDdIzCWt9 297KyUW5CKif7pwJouq7rVrrzK6MzhrqtYfidugj5hpnc+qAQ6p4aT8lwa4CMma7x+50 UomKX7T7S7PH2i+ujRem54zfmvQk78Y24rI0w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=c8YSToKmG8S+pAYeJq04gGadIuFi0aiciNczjeIoUfY=; b=K6pJYhK2eTcNXQ14/6xu9qfiO8H43kl/2+3knmP5TrQhgU/9+vRvH9impadMocRIBa 7Ira+wlYXkcOMFxudoIuVQBz4tfhR0zii9sJpKOnwQNIQ+869B5bEeImHLkbNIDcLeD5 AVp+LelI1pcwHZbF3eHrEZWipi5Ic3kyoWicOkQ4UKGTY0wk6ZKIYALNuyZYKyM1CU23 f1aKqxKxyNAXrq1aVu40xFduXdNpLWqQurnfBD+M6ErXzIC8rk9NyQ49LhnqDTcN6/8C Zy73qmQcbtmCnfvReHeK6AJmBrfGDwjdviV14wgOQuKo6It2rhVOMlBh3ueImqyQcdFt baog== X-Gm-Message-State: APjAAAVmkqI/RKzUbYOwp4unhuFlix/e7r+nrVHGMpuIPJtR3c/T8mDc 5GKb8hrC0mwHAC2soszkv0EtEA== X-Received: by 2002:a17:902:2f:: with SMTP id 44mr108866672pla.5.1564352190069; Sun, 28 Jul 2019 15:16:30 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a128sm65029848pfb.185.2019.07.28.15.16.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Jul 2019 15:16:29 -0700 (PDT) Date: Sun, 28 Jul 2019 15:16:28 -0700 From: Kees Cook To: Linus Torvalds Cc: Linux List Kernel Mailing , Arnd Bergmann , Alexander Potapenko Subject: Re: [GIT PULL] meminit fix for v5.3-rc2 Message-ID: <201907281507.B3F11DD54@keescook> References: <201907281218.F6D2C2DD@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 28, 2019 at 12:43:15PM -0700, Linus Torvalds wrote: > On Sun, Jul 28, 2019 at 12:21 PM Kees Cook wrote: > > > > Please pull this meminit fix for v5.3-rc2. > > Side noe: I find "meminit" a confusing description for the structleak > thing. When I hear it, it sounds like some generic memory > initialization thing in the VM layer (which we obviously do also > have), not the stack variable initialization. I will find a better name. :) We dreamed up "meminit" as finding a name for the umbrella of both stack and heap auto-initialization. But I agree, it's confusing. > Also, have you guys talked to gcc people about just making it a real > feature, like I think it is for clang? In particular, I still suspect > that we could/should just make zero-filling the *default* in the long > run, and say "our C standard is that local variables are initialized > to zero, exactly the same way static variables are". Yes, this is on the list for discussion at Plumber's. Having gcc do auto-init is the first part. Convincing Clang that _zero_ init isn't a language-breaking change is the second part. :P That's been a whole other issue. > I know you posted some numbers somewhere (well, I'm pretty sure you > did) and the full stack initialization really was pretty cheap, > wasn't it? Yes, Clang's initialization (which is 0xAA not 0x00 in most cases) is cheap. There are rumors(?) of some pathological workloads, though. I haven't seen real numbers for that though. I'll try to find the Clang numbers (maybe Alexander has them?) but I remember it being the same as (or maybe better than) the gcc-plugin version, which I measured here: https://git.kernel.org/linus/81a56f6dcd20 -- Kees Cook