Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2472964ybg; Fri, 31 Jul 2020 00:02:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBoOZb6JxVGNATWqsSJf+clJoB84sIidvyGU20Or+U07JHl7Ko4jkxhwffZ+vVzt3rziGV X-Received: by 2002:a17:906:c201:: with SMTP id d1mr2681253ejz.40.1596178920907; Fri, 31 Jul 2020 00:02:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596178920; cv=none; d=google.com; s=arc-20160816; b=ySr6z/tNAzrqigM/0MzDSTH5OZN12XAexa+lQArKTmp7tSSygYa3z7voCmHJlNUJkR mwVTTSyhG+STHqsby6obo7Sfcjh7W95LceCA3Ihyo1UzbL3BWwd1N76yTJ47lrZNHAv6 zkZUPpJwLMfVpX2tTFIce+W78h97USJRCL4YyAihw1jXuOziwjxbfZIxyPum5CFquAb2 fEIpKAQzEmfH8CXePKcYqm5v5JdMUccQzvTVjnQEnEgnd5WgqEJnA4WRneYShwDj334Y nQwGmEYdU3Y5BPBGxFNq7jI/FbLnN+L9bCiXdyl3GsSXq9ycj2kuMFsNK4FxjY7H9p0l FGsw== 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=RBaS63R8XZAM4zjuZSTEOLKbUevL50/Jht2vqs3n/jc=; b=F+9sZU6ZtDhAfLOe5HqFzO5JlHj3L0/+2txIiln+K5tOPeRPovzsSpkWjGeqvWaca3 nQV/UNfVfEpb3/5jhupgQ4kANJWqwzGFBDiV5MlN7b/WOK16pUiyl0svNpxpqNZZk5Uy 2f4b6hZNiTVYU1PhOLQY6o7/85QsvjWHwRs0Jj4QrXAIv9C1Hb7mMDfnCOlMjTb7wElO iCoUaosX9rpS3CfIAFcq2RB99yhoo3Pn9m6VTvrceF+jRw/RDnS/Wbu2xWKHFckdUoyE UdyCB9hCthp8jxseV1K832koOqz3RvM8CjMpczRVgp7RHCcVZ7dnSkDuLYqm1D405szK oklQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VNADuhxW; 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 n20si4037681ejg.494.2020.07.31.00.01.39; Fri, 31 Jul 2020 00:02:00 -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=VNADuhxW; 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 S1731617AbgGaHAi (ORCPT + 99 others); Fri, 31 Jul 2020 03:00:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:33196 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731628AbgGaHAe (ORCPT ); Fri, 31 Jul 2020 03:00:34 -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 368BA207F5; Fri, 31 Jul 2020 07:00:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596178833; bh=qjwGoIyl/wBff+iYMlZWx9H6G4svCrkKR/WF1d5EkDQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VNADuhxWnvWY3HlDYEqwJOC2grlnuHBoTybqGmuHW2dHkFl33dnqSNHyLA5NnBiCS SznzbcsXaju719ksD8EHEj9EUzSR87MTzfi9mMLb/2m2jqv6tM+42guU0Am/Iev5Vp UrdN4yUeMTOR1AJlgj+7/HAFxem1vSHfmSmby0m8= Date: Fri, 31 Jul 2020 10:00:30 +0300 From: Leon Romanovsky To: Andy Shevchenko Cc: 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: <20200731070030.GJ75549@unreal> References: <20200730192026.110246-1-yepeilin.cs@gmail.com> <20200731045301.GI75549@unreal> <20200731053306.GA466103@kroah.com> <20200731053333.GB466103@kroah.com> 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 Fri, Jul 31, 2020 at 09:29:27AM +0300, Andy Shevchenko wrote: > On Friday, July 31, 2020, Greg Kroah-Hartman > wrote: > > > 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. > > > {} is a GCC extension, but I never thought it works differently. Yes, this is GCC extension and kernel relies on them very heavily. Thanks > > > > > > > And if true, where in the C spec does it say that? > > > > thanks, > > > > greg k-h > > > > > -- > With Best Regards, > Andy Shevchenko