Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1798937pxa; Sun, 2 Aug 2020 22:05:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7F6a9avaB2R1mQEGcFWvTBXL2B1GoYSqtpF5Vz0WN1auxL4TPLATC5010TQ8gA0KnGyPu X-Received: by 2002:a50:ec0c:: with SMTP id g12mr13716345edr.27.1596431154804; Sun, 02 Aug 2020 22:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596431154; cv=none; d=google.com; s=arc-20160816; b=j99je12pYKc5f7RnYXaLqxxqs8gvaoZZJbRe1+5BdRGbPPnIJmwIGqraqZTXoX/3NY MstG10bLgXIVE5dxYG1Gc3ZA7QMkr13hhaPiK9qC/RAQoKt+gEFdVgAlghauDUGk5DBr C6VdzGmFzPXpNdOVKauPvXXFZlYTxrpa+rHyzo1kREZQLxJ7MRfu80PGygUv3wsWho0T +Udn9LTlFxG7U0z/sYuvZXpm63BT0LplIJbOF4FaIl1T0Yk1pbKMcJ4tXyfd/L/Ef+5P UEtX9dMwgN/IO14hwDn9Oz8qdUpgGYFgn8Mo4hsjOhhnHb1qCUq+fi9go23rKE8WstBO Pepw== 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=fDFRp+IKe99+BwnBau41/H/ap1t2usEy03syE6nmahA=; b=KhbqFuG4eoLZNsw/MQydeiB0I8eWMt6TI2qDYr7FHhjFqYG3YuByCXbfA3x8K//roe rkzyLsS+q4v0abeFYvJtPwN6VqxcBJfMPo0yRKiOGQaCbkIn7rL3dxcn/YHzcn/WfxQH vC915ip/tSbHpP6s9jIDazSR0Inr3CnOF3tIE2cVnnlNfbcVxsEJClB+UO412Lkwrt+B Jm79UBBrXJjKMXMBNxPaoDSqPx2dgaiZTBSeZ8Ipxdyo+lD/kCdNjFegjAgsW1M1WQu7 KPNf+1kAxtg2yIKtFbotIcddyseo/G563bjVs8Z9cgHIk9G4oJcIX4oegFhq2Bd5W7TY vU0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z6qPIEgF; 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 se5si9173873ejb.744.2020.08.02.22.05.33; Sun, 02 Aug 2020 22:05:54 -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=Z6qPIEgF; 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 S1727098AbgHCE6p (ORCPT + 99 others); Mon, 3 Aug 2020 00:58:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:41070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbgHCE6p (ORCPT ); Mon, 3 Aug 2020 00:58:45 -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 5DD062068F; Mon, 3 Aug 2020 04:58:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596430724; bh=0wWu/yJWcJHPmm8RbF95+DdUX5G1LnDQ23Z2blw/WnY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z6qPIEgF/UKp+AlLPVIkFocBc7mvGHOXJRP678/PMve5rmyqsVTkuz9VsKK41IZ4o Bgw1F9OID013tKs7dEZEy+biN9BRct6FIt/kue+lSdWTS4UVyKh/nipQlhSjMABNEi dj1i+iPxo6xTYI7gA/KPead6eBLVxHt72ONcZb9U= Date: Mon, 3 Aug 2020 07:58:40 +0300 From: Leon Romanovsky To: Joe Perches Cc: Jason Gunthorpe , 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: <20200803045840.GM75549@unreal> References: <20200731053333.GB466103@kroah.com> <20200731140452.GE24045@ziepe.ca> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <60584f4c0303106b42463ddcfb108ec4a1f0b705.camel@perches.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 02, 2020 at 03:45:40PM -0700, Joe Perches wrote: > On Sun, 2020-08-02 at 19:28 -0300, Jason Gunthorpe wrote: > > On Sun, Aug 02, 2020 at 03:23:58PM -0700, Joe Perches wrote: > > > On Sun, 2020-08-02 at 19:10 -0300, Jason Gunthorpe wrote: > > > > On Sat, Aug 01, 2020 at 08:38:33AM +0300, Leon Romanovsky wrote: > > > > > > > > > I'm using {} instead of {0} because of this GCC bug. > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119 > > > > > > > > This is why the {} extension exists.. > > > > > > There is no guarantee that the gcc struct initialization {} > > > extension also zeros padding. > > > > We just went over this. Yes there is, C11 requires it. > > c11 is not c90. The kernel uses c90. It is not accurate, kernel uses gnu89 dialect, which is C90 with some C99 features [1]. In our case, we rely on GCC extension {} that doesn't contradict standart [2] and fills holes with zeros too. [1] Makefile:500 496 KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \ 497 -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \ 498 -Werror=implicit-function-declaration -Werror=implicit-int \ 499 -Wno-format-security \ 500 -std=gnu89 [2] From GCC: https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html "When a base standard is specified, the compiler accepts all programs following that standard plus those using GNU extensions that do not contradict it." Thanks > > >