Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3452122pxa; Sun, 9 Aug 2020 00:07:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiC1ySVi6LjbxhGS47c7vQ88ltjhGaTkxfQON2dLTHK/bS+VE+two7ioSameEEPjQL7vHc X-Received: by 2002:a17:907:2119:: with SMTP id qn25mr16519479ejb.278.1596956826471; Sun, 09 Aug 2020 00:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596956826; cv=none; d=google.com; s=arc-20160816; b=XKO5VrTxV9X7EyJMuG+9X9+HFDk4nNW+W431CcPUtWH5Wb/pSE1+caq1Q0h5SJoQAT W2uH8ys60jAzTzK4K7jrrMz7LEwkPkFD0Z0BqDhAR2+DHjRcTbzIyvFKoQX6hKtVO412 Ft7B273bvq+rguX76tUXktEsf64UZdZ9VV2B6UILPPrPJcO6HNQuHj1NTfsxLiSD5+Cn ykngF75Cq8CwPJH0bOv/+agpaQe0i1uu/zmMybYb5lb+U9N5lNCJKXZ6lwewu/Ns1hGN ps852/H5P6XQvhhqtnoKzTC1r3issoLH/UIk1tWeV+2yI1Lv7Gwyq702xwXOkl1OUc+X Pphw== 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=RXegfO8sfwtCPziOMzKjff9+mTWukqMXNBxcvA/PHQ0=; b=AXl7zs2TUG2JDFGkNP7PQodb73Tb4b/HIy/MsprnDVkOU7LGR+LoRHeVYgBNlFQJ27 bFssSyBHMi8UQIaVJS5M2V4DiWc9WgbuCsi4Bj6KEvyiBNJoUKpE2DABHPMxIuWuYbsQ Q1VnRBMXJ0vFVLy1i7UohNc13rvcKBn7GJk0yOpkPrHxHsUuxVKTmdjIKZpPDQZX6COB ikzPAU7JQ/g0FaWLNYRDnrEPx71b6lPAIqEx5kx/sCqRnS23aS4a7ale5Gix0r0aJAQr h/ZbLKXrI7sGHRdoQfhBMC+T/E3oeDnZAoOrDThkGgHlg4fXxdVRzg/bFrbGjwRqhhDI SG5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WbjJligg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id k23si7354291ejg.514.2020.08.09.00.06.16; Sun, 09 Aug 2020 00:07:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WbjJligg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726338AbgHIHEt (ORCPT + 99 others); Sun, 9 Aug 2020 03:04:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:49344 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726050AbgHIHEt (ORCPT ); Sun, 9 Aug 2020 03:04:49 -0400 Received: from localhost (unknown [213.57.247.131]) (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 C9032206C3; Sun, 9 Aug 2020 07:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596956688; bh=RXegfO8sfwtCPziOMzKjff9+mTWukqMXNBxcvA/PHQ0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WbjJliggcdbohvw04zRJ7b4Y/r/cKmbBRJpasZ3n26KOioJjq7UsNclBR2x1bdeDt xlZbQXEruW13ZQFEm4tdU81P2XkQOrQ3i7WDcpzgrxamnx1xDAOLngh0sHZGNMUP4D 1sgz5yxpQG0vFOT6X9NqnS70c7StKKboPX/plznY= Date: Sun, 9 Aug 2020 10:04:40 +0300 From: Leon Romanovsky To: Jack Leadford Cc: Jason Gunthorpe , Joe Perches , Greg Kroah-Hartman , Peilin Ye , Santosh Shilimkar , "David S. Miller" , Jakub Kicinski , Dan Carpenter , Arnd Bergmann , linux-kernel-mentees@lists.linuxfoundation.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: Re: [Linux-kernel-mentees] [PATCH net] rds: Prevent kernel-infoleak in rds_notify_queue_get() Message-ID: <20200809070440.GA1653394@unreal> References: <20200731142148.GA1718799@kroah.com> <20200731143604.GF24045@ziepe.ca> <20200731171924.GA2014207@kroah.com> <20200801053833.GK75549@unreal> <20200802221020.GN24045@ziepe.ca> <20200802222843.GP24045@ziepe.ca> <60584f4c0303106b42463ddcfb108ec4a1f0b705.camel@perches.com> <20200803230627.GQ24045@ziepe.ca> 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 Sat, Aug 08, 2020 at 03:57:33PM -0700, Jack Leadford wrote: > Hello! > > Thanks to Jason for getting this conversation back on track. > > Yes: in general, {} or a partial initializer /will/ zero padding bits. > > However, there is a bug in some versions of GCC where {} will /not/ zero > padding bits; actually, Jason's test program in this mail > https://lore.kernel.org/lkml/20200731143604.GF24045@ziepe.ca/ > has the right ingredients to trigger the bug, but the GCC > versions used are outside of the bug window. :) > > For more details on these cases and more (including said GCC bug), see my > paper at: > > https://www.nccgroup.com/us/about-us/newsroom-and-events/blog/2019/october/padding-the-struct-how-a-compiler-optimization-can-disclose-stack-memory/ > > Hopefully this paper can serve as a helpful reference when these cases are > encountered in the kernel. I read the paper and didn't find exact GCC version, only remark that it was before GCC 7. So my question, why is this case different from any other GCC bugs? AFAIK, we don't add kernel code to overcome GCC bugs which exist in specific versions, which already were fixed. More on that, this paper talks about specific flow which doesn't exist in the discussed patch. Thanks