Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2454640imd; Fri, 2 Nov 2018 11:41:14 -0700 (PDT) X-Google-Smtp-Source: AJdET5dH5tRP+bfqm0cjyYxSWeWGMvPymr5z29dclEyh7Qt+BCrabZxcZwV4MwMYH7n+EHzOaxdS X-Received: by 2002:a17:902:a614:: with SMTP id u20-v6mr12689579plq.77.1541184074301; Fri, 02 Nov 2018 11:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184074; cv=none; d=google.com; s=arc-20160816; b=vF41tTOLhKbTTADek7piaBM2RJkuyvR2C6ooNbzedxW0dcsRpFNYSznxvL5mtEzjr6 xfC1ROBOLJ4y8ElsXJkA3vFgSVPhI5KBxfgdyH1ajgIXA6iP/JRJD7h2fhorvc/BgvoG 98k6mxpsagScmOD0zw5ZsHN22O81tBVeTkRZcxIUs/mID7zBRDPsx759+xuuAq4HrfVn S9bE264sg5SPpG9gGzoDrXziXbEFnxqpyGkgOxLuDkFtVHMtrb+uSW0lnqrYZpJep22n BASSBqsr59MwvdpGwIMuHRp23Y2uC20im571O0lKy7XBds9hv2Y4qsG0bXYTfXYQKMVS Atqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ElRKkbsLUr28jwUQmiYnySTZdIHVrwQszM6+f3+9Iqo=; b=wKd4Jpfxq0DutODqeWehsoKvgVJOoHjEi/ZsWw/qQNoIqdA9sgwaLIpux1yQBveOtG LYZKU2k92NlkJ4oe780I4aanhU06bb1KOUyv7+fIUhfPwH8IxYYfdrESyxxDATwZBfV2 7kA8RkSqROVDF0/3n9ztRviMaXmc+nDc3u20Pg1cFlapF16lSU6Uzt6ooV33EIN+kIkW Y3XRLIHF7RZCpcPjFmQBXuaz9NFRB7qxX7GgyqowLxFCIQc45E4GXFq6Fg4eeOmoc1Rj ZDYD5Y+S4iL2dU4Ht0MZFZKzJGuT3FhPE7Rlkpfh6xIkMDnWEkWDBemfIVXT3g4g2H8E zkiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QPhU+Amr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d34si4060982pgb.43.2018.11.02.11.40.59; Fri, 02 Nov 2018 11:41:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QPhU+Amr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729220AbeKCDr4 (ORCPT + 99 others); Fri, 2 Nov 2018 23:47:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:42164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728250AbeKCDrz (ORCPT ); Fri, 2 Nov 2018 23:47:55 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.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 0F46F2082E; Fri, 2 Nov 2018 18:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541183984; bh=l90o+lEH+iQmMO05MqsdRPvwEhcDpuKRIrn+tZqWmMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QPhU+AmrOmNmzkrgInHT745ziub27r3+mdASnDyfFoDcBnAy8FCXEYJJHRL14pxcx wjfGvzS6WU1iOQwtZjlgM0xNbjnCY/pfmxRQ6cmr5VeJYPyeOANZ/9GGAPBOlt6kCP J46kl5Fe0Yhq8GkZQQoV8SSvU79MTVH43F3gfl30= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , "David S. Miller" , Sasha Levin Subject: [PATCH 4.18 042/150] asix: Check for supported Wake-on-LAN modes Date: Fri, 2 Nov 2018 19:33:24 +0100 Message-Id: <20181102182906.315460286@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit c4ce446e33d7a0e978256ac6fea4c80e59d9de5f ] The driver currently silently accepts unsupported Wake-on-LAN modes (other than WAKE_PHY or WAKE_MAGIC) without reporting that to the user, which is confusing. Fixes: 2e55cc7210fe ("[PATCH] USB: usbnet (3/9) module for ASIX Ethernet adapters") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/asix_common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/asix_common.c b/drivers/net/usb/asix_common.c index e95dd12edec4..023b8d0bf175 100644 --- a/drivers/net/usb/asix_common.c +++ b/drivers/net/usb/asix_common.c @@ -607,6 +607,9 @@ int asix_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo) struct usbnet *dev = netdev_priv(net); u8 opt = 0; + if (wolinfo->wolopts & ~(WAKE_PHY | WAKE_MAGIC)) + return -EINVAL; + if (wolinfo->wolopts & WAKE_PHY) opt |= AX_MONITOR_LINK; if (wolinfo->wolopts & WAKE_MAGIC) -- 2.17.1