Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3048837ybb; Sun, 22 Mar 2020 14:07:02 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsaDtRDNpJVKY5gclluIi7QuNIro2+Vtc52zJwbheMIj7RraprZpDyUMGk1P8tZrAm6gHBe X-Received: by 2002:aca:4154:: with SMTP id o81mr14937356oia.125.1584911221913; Sun, 22 Mar 2020 14:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584911221; cv=none; d=google.com; s=arc-20160816; b=lNNogo1mXJYecEWjpetNxcAYgvU5ag1BEHFFZBiYcZwqiYjMRPTt+ZV37MoZr7fNPD YZMuykTAKUPui7mhrG834aCxrNkqyXjLb50KN+aI5Bywp10uDa27ztsmyNhCZh3VZxrw PqsQ1gkQwT5wZFUPVZEskBzdisldUMqrnZMVwDBEeg9EjkvYXo2XqmmD+ZO1FQIKCw70 G/pnPQvQ7VzTOcgpbxQR96587SRCZT9Vz6Bd2Qo6indZnYU7bE4XfIC8LIwHovV7L3rt ukiyyjb2jnGy5XzKqbCcPpRZwBpg/w4ylF/fVMQBROk6KL1cEixWmnXo3FldtHETKyHM 5kRg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=YnB/oi8OrGQd6hRwvSDm+GiLYPoNFXc1HyXhHbSqH1Q=; b=MGotE/4nlPR02NdrNW30X9KmK0oaj9ke6ibMMMfFyhoEgX+VLRq80KDJROyPUhxgAG L8IRDbCprxYZgOF3uHh5GXT6chHa0vQyguw5B4M8/nEI87Yg3JlqrmHPmFJX4I42fA4Q Zb13qiqdFigyPxkSGIVX61oPddmQsmxV4IbY2SwQ6a1QwmSoTK/ou858gEG24RY+Rm7b KD4P+JyeUGab6cznWhAtrPK2aRg+hBeqypjkKnxGkbbKm046jf9KBp5lnl6Gmb8hiRU4 p1HKZLv4u0ctU1wTAR/4rWmhCbzgf0N9No6Ko5F5jswiTZrMyquoY9YboNPSkplaq7yM Vjgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gT6DVqwX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si6238442oii.181.2020.03.22.14.06.50; Sun, 22 Mar 2020 14:07:01 -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=gT6DVqwX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726872AbgCVVGZ (ORCPT + 99 others); Sun, 22 Mar 2020 17:06:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:60696 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726741AbgCVVGZ (ORCPT ); Sun, 22 Mar 2020 17:06:25 -0400 Received: from kicinski-fedora-PC1C0HJN (unknown [163.114.132.4]) (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 CC45920658; Sun, 22 Mar 2020 21:06:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584911185; bh=tRJ4p7lKYiN6wX+ALChAuCV0TylJs+y6wN/8sB1COwo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gT6DVqwXG6yLiPzou40rj+Z1VEwlqihyMU06pRPfCfRyUk1ddJn3Gk4H87N47oTm+ Zy8pT0eVNZu0wu3040m8kefDmZeanKVdGIVN9DImzZYxpffMlY3gFf+5NLU0fs0naU 97Wb0Y8d+71NvFeK37zooQERZcA2i7z7pU8sVi2Q= Date: Sun, 22 Mar 2020 14:06:23 -0700 From: Jakub Kicinski To: Michal Kubecek Cc: "David S. Miller" , netdev@vger.kernel.org, Andrew Lunn , linux-kernel@vger.kernel.org Subject: Re: [PATCH net] ethtool: fix reference leak in some *_SET handlers Message-ID: <20200322140623.633d3446@kicinski-fedora-PC1C0HJN> In-Reply-To: <20200322205109.GF31519@unicorn.suse.cz> References: <20200322201551.E11BAE0FD3@unicorn.suse.cz> <20200322134356.55f7d9b8@kicinski-fedora-PC1C0HJN> <20200322205109.GF31519@unicorn.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 22 Mar 2020 21:51:09 +0100 Michal Kubecek wrote: > On Sun, Mar 22, 2020 at 01:43:56PM -0700, Jakub Kicinski wrote: > > On Sun, 22 Mar 2020 21:15:51 +0100 (CET) Michal Kubecek wrote: > > > Andrew noticed that some handlers for *_SET commands leak a netdev > > > reference if required ethtool_ops callbacks do not exist. A simple > > > reproducer would be e.g. > > > > > > ip link add veth1 type veth peer name veth2 > > > ethtool -s veth1 wol g > > > ip link del veth1 > > > > > > Make sure dev_put() is called when ethtool_ops check fails. > > > > Fixes: e54d04e3afea ("ethtool: set message mask with DEBUG_SET request") > > Fixes: a53f3d41e4d3 ("ethtool: set link settings with LINKINFO_SET request") > > Fixes: bfbcfe2032e7 ("ethtool: set link modes related data with LINKMODES_SET request") > > Fixes: 8d425b19b305 ("ethtool: set wake-on-lan settings with WOL_SET request") > > Yes, thank you, I forgot about Fixes tags. > > Should I resubmit or will patchworks pick the tags from your reply? Patchwork sees them, I think, but I don't think it adds them to the patch as downloaded by git-pw. Probably easiest to repost. > > > Reported-by: Andrew Lunn > > > Signed-off-by: Michal Kubecek > > > > Reviewed-by: Jakub Kicinski