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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 BB999C5DF60 for ; Fri, 8 Nov 2019 18:52:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 85475214DB for ; Fri, 8 Nov 2019 18:52:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573239155; bh=RlodDkjESUM8Slmuk9dH1BmilljgeGRbTugX96zDFV0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=yS3BrKthjZPkWnW8zoOkc4GjeMrgBzDfxrV0Tk2l8pbmnLaH+jGRqUdBqIXl2H9fy SIYv/2GkLMNt0V1HbkVKOEZzyMlmK0Ydf6AGixasBuHx1lsFTKQG1l6sq+eqzmV6zL 0uqYsRBq8ScikH4LFhqLi2Ge6waTjJfbh66yHFT0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731335AbfKHSwb (ORCPT ); Fri, 8 Nov 2019 13:52:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:48812 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731195AbfKHSwa (ORCPT ); Fri, 8 Nov 2019 13:52:30 -0500 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 E14ED21D7E; Fri, 8 Nov 2019 18:52:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573239150; bh=RlodDkjESUM8Slmuk9dH1BmilljgeGRbTugX96zDFV0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gmkwr7wb0skcYEx/CWx20hCXWRQqiDMvoIx6Z3u4bcHgi5NgPT93UgfIkMuMBf4Ps JQJPEEeWGSUOKBrCC1LZoT9j1qq8/sGJ+geUABWR+9arACl+Skun5Qz1xSC2uvOGeC P6cLEskVja80zqBLTk37Z75Ex1J0trC5bAyubUpo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, zhanglin , "David S. Miller" Subject: [PATCH 4.4 17/75] net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() Date: Fri, 8 Nov 2019 19:49:34 +0100 Message-Id: <20191108174723.977583735@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191108174708.135680837@linuxfoundation.org> References: <20191108174708.135680837@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: zhanglin [ Upstream commit 5ff223e86f5addbfae26419cbb5d61d98f6fbf7d ] memset() the structure ethtool_wolinfo that has padded bytes but the padded bytes have not been zeroed out. Signed-off-by: zhanglin Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/ethtool.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -941,11 +941,13 @@ static int ethtool_reset(struct net_devi static int ethtool_get_wol(struct net_device *dev, char __user *useraddr) { - struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL }; + struct ethtool_wolinfo wol; if (!dev->ethtool_ops->get_wol) return -EOPNOTSUPP; + memset(&wol, 0, sizeof(struct ethtool_wolinfo)); + wol.cmd = ETHTOOL_GWOL; dev->ethtool_ops->get_wol(dev, &wol); if (copy_to_user(useraddr, &wol, sizeof(wol)))