From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B5E4C433E0 for ; Sat, 1 Aug 2020 05:38:43 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 106852072A for ; Sat, 1 Aug 2020 05:38:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="BJmM0f1U" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 106852072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id DA0E2887F8; Sat, 1 Aug 2020 05:38:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 52Yx9T-foR38; Sat, 1 Aug 2020 05:38:42 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 6A91F887EB; Sat, 1 Aug 2020 05:38:42 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5488CC004F; Sat, 1 Aug 2020 05:38:42 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id C7F0DC004D for ; Sat, 1 Aug 2020 05:38:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id AE19688E37 for ; Sat, 1 Aug 2020 05:38:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KYxsmG6zNpLi for ; Sat, 1 Aug 2020 05:38:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3483B88E41 for ; Sat, 1 Aug 2020 05:38:38 +0000 (UTC) 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 30581206E9; Sat, 1 Aug 2020 05:38:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596260317; bh=lGpwK1KfpscxUqahcA06uhD573mu3C8E7CKIwtqzqVI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BJmM0f1UXvY+GZiG48xH1hniSbfQOjEcu2PZGU6M97JyZ9pegPUHZKTk0KCCtUwV8 6C3nkXPO9Tq7cb2m+M/aZyM0uGv5FT3niWUayWOm6zuJrVhiXfYMlQEvp8Scf76dP7 ycWYDTIg4oIUopWDINNKCuCrNPcQaJCMnZX+djFQ= Date: Sat, 1 Aug 2020 08:38:33 +0300 From: Leon Romanovsky To: Greg Kroah-Hartman Message-ID: <20200801053833.GK75549@unreal> References: <20200730192026.110246-1-yepeilin.cs@gmail.com> <20200731045301.GI75549@unreal> <20200731053306.GA466103@kroah.com> <20200731053333.GB466103@kroah.com> <20200731140452.GE24045@ziepe.ca> <20200731142148.GA1718799@kroah.com> <20200731143604.GF24045@ziepe.ca> <20200731171924.GA2014207@kroah.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200731171924.GA2014207@kroah.com> Cc: rds-devel@oss.oracle.com, Arnd Bergmann , linux-rdma@vger.kernel.org, netdev@vger.kernel.org, Santosh Shilimkar , linux-kernel@vger.kernel.org, "David S. Miller" , Jason Gunthorpe , Jakub Kicinski , linux-kernel-mentees@lists.linuxfoundation.org, Peilin Ye , Dan Carpenter Subject: Re: [Linux-kernel-mentees] [PATCH net] rds: Prevent kernel-infoleak in rds_notify_queue_get() X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" On Fri, Jul 31, 2020 at 07:19:24PM +0200, Greg Kroah-Hartman wrote: > On Fri, Jul 31, 2020 at 11:36:04AM -0300, Jason Gunthorpe wrote: > > On Fri, Jul 31, 2020 at 04:21:48PM +0200, Greg Kroah-Hartman wrote: > > > > > > The spec was updated in C11 to require zero'ing padding when doing > > > > partial initialization of aggregates (eg = {}) > > > > > > > > """if it is an aggregate, every member is initialized (recursively) > > > > according to these rules, and any padding is initialized to zero > > > > bits;""" > > > > > > But then why does the compilers not do this? > > > > Do you have an example? > > At the moment, no, but we have had them in the past due to security > issues we have had to fix for this. Is it still relevant after bump of required GCC version to build kernel? I afraid that without solid example such changes will start to be treated with cargo cult. Jason, I'm using {} instead of {0} because of this GCC bug. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119 Thanks _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4012C433E1 for ; Sat, 1 Aug 2020 05:38:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3EB32072A for ; Sat, 1 Aug 2020 05:38:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596260323; bh=lGpwK1KfpscxUqahcA06uhD573mu3C8E7CKIwtqzqVI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=A3/Tyk29a+QPx4rhlclqn+oJur+oRqdpxoATFRzu7yTDln+EbFef7ebQxcbWN26dF uquJnigas1edFv/vsNe0DJJ5cfDaAmRMNly3QSaOL6EWlhlgObkEFC8TayjHdYrh4c U7cwhtaTcum9tA439H/r/PrmWDjpfp+7+quiQ5SM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726187AbgHAFii (ORCPT ); Sat, 1 Aug 2020 01:38:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:40250 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725497AbgHAFii (ORCPT ); Sat, 1 Aug 2020 01:38:38 -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 30581206E9; Sat, 1 Aug 2020 05:38:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596260317; bh=lGpwK1KfpscxUqahcA06uhD573mu3C8E7CKIwtqzqVI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BJmM0f1UXvY+GZiG48xH1hniSbfQOjEcu2PZGU6M97JyZ9pegPUHZKTk0KCCtUwV8 6C3nkXPO9Tq7cb2m+M/aZyM0uGv5FT3niWUayWOm6zuJrVhiXfYMlQEvp8Scf76dP7 ycWYDTIg4oIUopWDINNKCuCrNPcQaJCMnZX+djFQ= Date: Sat, 1 Aug 2020 08:38:33 +0300 From: Leon Romanovsky To: Greg Kroah-Hartman Cc: Jason Gunthorpe , 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: <20200801053833.GK75549@unreal> References: <20200730192026.110246-1-yepeilin.cs@gmail.com> <20200731045301.GI75549@unreal> <20200731053306.GA466103@kroah.com> <20200731053333.GB466103@kroah.com> <20200731140452.GE24045@ziepe.ca> <20200731142148.GA1718799@kroah.com> <20200731143604.GF24045@ziepe.ca> <20200731171924.GA2014207@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200731171924.GA2014207@kroah.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Fri, Jul 31, 2020 at 07:19:24PM +0200, Greg Kroah-Hartman wrote: > On Fri, Jul 31, 2020 at 11:36:04AM -0300, Jason Gunthorpe wrote: > > On Fri, Jul 31, 2020 at 04:21:48PM +0200, Greg Kroah-Hartman wrote: > > > > > > The spec was updated in C11 to require zero'ing padding when doing > > > > partial initialization of aggregates (eg = {}) > > > > > > > > """if it is an aggregate, every member is initialized (recursively) > > > > according to these rules, and any padding is initialized to zero > > > > bits;""" > > > > > > But then why does the compilers not do this? > > > > Do you have an example? > > At the moment, no, but we have had them in the past due to security > issues we have had to fix for this. Is it still relevant after bump of required GCC version to build kernel? I afraid that without solid example such changes will start to be treated with cargo cult. Jason, I'm using {} instead of {0} because of this GCC bug. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119 Thanks