From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754309AbcHWQjT (ORCPT ); Tue, 23 Aug 2016 12:39:19 -0400 Received: from mail-yb0-f173.google.com ([209.85.213.173]:36153 "EHLO mail-yb0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753972AbcHWQjP (ORCPT ); Tue, 23 Aug 2016 12:39:15 -0400 MIME-Version: 1.0 In-Reply-To: <1471966619.14381.21.camel@edumazet-glaptop3.roam.corp.google.com> References: <1471959668-18209-1-git-send-email-luis.henriques@canonical.com> <1471959668-18209-2-git-send-email-luis.henriques@canonical.com> <1471962096.14381.15.camel@edumazet-glaptop3.roam.corp.google.com> <1471964716.3746.103.camel@perches.com> <1471966619.14381.21.camel@edumazet-glaptop3.roam.corp.google.com> From: Andrey Ryabinin Date: Tue, 23 Aug 2016 19:38:28 +0300 Message-ID: Subject: Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() To: Eric Dumazet Cc: Joe Perches , Luis Henriques , Avijit Kanti Das , "David S . Miller" , Ben Hutchings , "netdev@vger.kernel.org" , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2016-08-23 18:36 GMT+03:00 Eric Dumazet : > On Tue, 2016-08-23 at 08:05 -0700, Joe Perches wrote: > >> A compiler does not have a standards based requirement to >> initialize arbitrary padding bytes. >> >> I believe gcc always does zero all padding anyway. > > I would not worry for kernel code, because the amount of scrutiny there > will be enough to 'fix potential bugs' [1], but a lot of user land code > would suffer from various bugs as well that might sit there forever. > > [1] Also, most call sites in the kernel are using same call stack, so > the offset of '1-7 leaked bytes' vs kernel stack is constant, making > exploits quite challenging. > > Even if the current standards are lazy (are they, I did not check ?), > security needs would call for a sane compiler behavior and changing the > standards accordingly. > C11 guarantees zeroed padding.