From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932569AbdKAGuG (ORCPT ); Wed, 1 Nov 2017 02:50:06 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:34896 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753931AbdKAGuF (ORCPT ); Wed, 1 Nov 2017 02:50:05 -0400 Date: Wed, 1 Nov 2017 07:49:54 +0100 From: Willy Tarreau To: Kees Cook Cc: "David S. Miller" , Alexander Potapenko , Kostya Serebryany , Andrey Konovalov , Eric Dumazet , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, security@kernel.org Subject: Re: [PATCH] net: recvmsg: Unconditionally zero struct sockaddr_storage Message-ID: <20171101064954.GC1585@1wt.eu> References: <20171031161445.GA140874@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171031161445.GA140874@beast> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 31, 2017 at 09:14:45AM -0700, Kees Cook wrote: > diff --git a/net/socket.c b/net/socket.c > index c729625eb5d3..34183f4fbdf8 100644 > --- a/net/socket.c > +++ b/net/socket.c > @@ -2188,6 +2188,7 @@ static int ___sys_recvmsg(struct socket *sock, struct user_msghdr __user *msg, > struct sockaddr __user *uaddr; > int __user *uaddr_len = COMPAT_NAMELEN(msg); > > + memset(&addr, 0, sizeof(addr)); > msg_sys->msg_name = &addr; Isn't this going to cause a performance hit in the fast path ? Just checking, I have not read the whole code with the patch in its context. Willy