From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b5-smtp.messagingengine.com (fout-b5-smtp.messagingengine.com [202.12.124.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B93533E4506; Wed, 8 Jul 2026 21:47:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.148 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783547254; cv=none; b=SvhtRJMgRQ6u9Wo8m1GTQEpWL7kcWCawy154TYsLSw9WUXDdUnQqz2WcQzuXyL9UDvtPR2L/q1ifeZFXyHRFJNpqpnAlRkE1knY9Ln5E9pfOtL1he9mkRS9wgYKAvWGE4QfDYdl1lZNkpmuuIeksUTPVQT4nCgDRsFrE2SytYpA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783547254; c=relaxed/simple; bh=cLbYfj0ix0uweAgXGMGt8iFFBLz5yorNVz94Azlcj2c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bQ6s6EvLiBHZmSbk87pdH7YR0oyu5ajZUnrttf2KFc4JFH3WJfFpuBpHXoE0hePFTGuDTyjovxGvKTSPrloGNKKoFjSzzWIbLPcgQH61sJxfG/cHGEKXzCR+nWFR5gTbiULxRgfqEzgsqB2DRg3E4fcEJpW/uYN2EJX2p8/10aI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=queasysnail.net; spf=pass smtp.mailfrom=queasysnail.net; dkim=pass (2048-bit key) header.d=queasysnail.net header.i=@queasysnail.net header.b=K1LJCbEG; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Dr/bbDL+; arc=none smtp.client-ip=202.12.124.148 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=queasysnail.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=queasysnail.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=queasysnail.net header.i=@queasysnail.net header.b="K1LJCbEG"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Dr/bbDL+" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id B7E431D000F9; Wed, 8 Jul 2026 17:47:29 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 08 Jul 2026 17:47:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=queasysnail.net; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1783547249; x= 1783633649; bh=SkhMzosNQBmymgj3p2xy58uHyxhr2icAp5O0RittQsM=; b=K 1LJCbEG1PWvnlad0u6OH2lgDk3yullbaD90XoQNGzNXFKuHumqCs0p4SStp2ZbU1 5IfaiOLrNHuxQjWuYw/uYx8TU1VfUbck9B3aqjNPgof4VlBz71RSUDPatFvJCEGE ZiLlfD19rZSMHMw7ZJF27N20uSu6wU9UpNTdPM9o6POy6ovNuOYBcwmeVlQn3Not LSy1BPV+L9KrSzeFV7QC65A1wrD+ANAGXHIboi4T17ihg9hvBUmahLWoI1LsH2Zu VOYnx/W71yT4CoAXL8PSRIFiDe3FVJeC4dGYmk6NLLLo3cF5hj/rVINZvfkdTF5+ oRJ2sdEo9IxBg9CuCQxsA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1783547249; x=1783633649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jUJrkz7CB31vwlzMoJoWmeCwQ X-ME-Proxy: Feedback-ID: i934648bf:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Jul 2026 17:47:28 -0400 (EDT) Date: Wed, 8 Jul 2026 23:47:26 +0200 From: Sabrina Dubroca To: James Raphael Tiovalen Cc: netdev@vger.kernel.org, stable@vger.kernel.org, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Antoine Tenart , linux-kernel@vger.kernel.org Subject: Re: [PATCH net] macsec: fix promiscuity refcount leak in macsec_dev_open() Message-ID: References: <20260705113629.187490-1-jamestiotio@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260705113629.187490-1-jamestiotio@gmail.com> 2026-07-05, 19:36:29 +0800, James Raphael Tiovalen wrote: > When a MACsec interface with IFF_PROMISC set is brought up on top of a > device that has hardware offload enabled, macsec_dev_open() first calls > dev_set_promiscuity(real_dev, 1) and then propagates the open to the > offload device. If that propagation fails, the error path jumps to the > clear_allmulti label, which only reverts allmulti and the unicast > address. The promiscuity taken on the lower device is never dropped, so > real_dev is left permanently stuck in promiscuous mode. Its promiscuity > count can no longer be balanced from software. > > Add a clear_promisc label that drops the promiscuity reference and > route the two offload failure paths to it. The dev_set_promiscuity() > failure itself still jumps to clear_allmulti, since on that failure the > count was not incremented. > > Fixes: 3cf3227a21d1 ("net: macsec: hardware offloading infrastructure") > Cc: stable@vger.kernel.org > Signed-off-by: James Raphael Tiovalen > --- > drivers/net/macsec.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) Reviewed-by: Sabrina Dubroca -- Sabrina