Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2444344ybg; Thu, 30 Jul 2020 22:37:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3imoq1ZN7cRQi6Au70A+hmDmFPiXvmY/VpYOI/KOfn3B8CVGSdAlnOX1C0Z6sL6lKyHmh X-Received: by 2002:a50:d80f:: with SMTP id o15mr2300505edj.156.1596173859566; Thu, 30 Jul 2020 22:37:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596173859; cv=none; d=google.com; s=arc-20160816; b=UpbZLxhCXmlsjegbVyAZVC53VdlhKUFznuQw9Kw5MYI/wDmsKgrQRiCu3FnayOAINb B0K2ruqXhSN5MHKDWGsy6nn0JYfyIArjOJsoTXowAc5XQIayMvF/TBGLte9UGGmy+1Df bTiPaS6tz5apH4KcyVYWmCGmk8dqqeLqZdmPb9/0EAmJ6VqBqPBlpVcCs1n7bvctLrBO uOHevaUP7ClhP/j8nytTnm5pd1wCN/L+uTnBeQkF5QwmZ+GfLq5SX4kwdDSSKwQseJog tRepHCCl74zo2ROe30kQgeP8VYZvpyOeCnEi5uK1p3orPWunzgLIrg4IG1iE1uB0auPP jbzw== 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=1rhG5N9uQ2DlgMa4bJ2W2ZVh1ch/GYEUL6w3PaPSUic=; b=UFLKinZ4KGnZvV4+1YHNgTxhFqrulMQD7fU1aYbgFe73+6iTgjE9exD23uqmENz8I2 iif9ReZS5/pmosmSMw38Cz6W7oTu6fej+so16eXAmFqwEUeXxhjpVnk7GJ78SBkWas2V maN7nK9ycKHPE63/dtgQnOSR8cUHdlL98bkFiqbmvFBnXorksvPYg0rpZAokwsOA9cGr FWaepaSQqrhgwonlzk46vROrUd4ME15giT/aIhRXiRrb/yogWxYHl1NoVXqzFXX1tkXG is7NAd/kvv5lyUoBPolFASeea5yIj5iITFD8rLwl8pq3bvl+FtNnaFAeYcrgbX4jpqbE /d3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FwnmgM0L; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e10si4306694ejj.546.2020.07.30.22.37.13; Thu, 30 Jul 2020 22:37:39 -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=FwnmgM0L; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731155AbgGaFdh (ORCPT + 99 others); Fri, 31 Jul 2020 01:33:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:38516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726972AbgGaFdh (ORCPT ); Fri, 31 Jul 2020 01:33:37 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 D6D79208E4; Fri, 31 Jul 2020 05:33:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596173616; bh=SrMzJYfTMQLBsXyhVjLLCmvenkRswzPK65sqy1cHK2g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FwnmgM0LtXhYrZbihPSWdfHqpy+DSzZ09TwFtOWT8N9S6rPrAdA2tKlVwkYDVpYI7 /WGlgrGBWt6dS8efzXij7J2/2EIt43xsBoMyJbQjG+ff8WnhikCXp0JZMHcr82mxWq +EWy9cKwBRc78VgQG7aPqhbBW+dx32cNhinrGwQk= Date: Fri, 31 Jul 2020 07:33:33 +0200 From: Greg Kroah-Hartman To: Leon Romanovsky Cc: 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: <20200731053333.GB466103@kroah.com> References: <20200730192026.110246-1-yepeilin.cs@gmail.com> <20200731045301.GI75549@unreal> <20200731053306.GA466103@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200731053306.GA466103@kroah.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 31, 2020 at 07:33:06AM +0200, Greg Kroah-Hartman wrote: > On Fri, Jul 31, 2020 at 07:53:01AM +0300, Leon Romanovsky wrote: > > On Thu, Jul 30, 2020 at 03:20:26PM -0400, Peilin Ye wrote: > > > rds_notify_queue_get() is potentially copying uninitialized kernel stack > > > memory to userspace since the compiler may leave a 4-byte hole at the end > > > of `cmsg`. > > > > > > In 2016 we tried to fix this issue by doing `= { 0 };` on `cmsg`, which > > > unfortunately does not always initialize that 4-byte hole. Fix it by using > > > memset() instead. > > > > Of course, this is the difference between "{ 0 }" and "{}" initializations. > > Really? Neither will handle structures with holes in it, try it and > see. And if true, where in the C spec does it say that? thanks, greg k-h