From nobody Fri Jun 12 11:07:39 2026 Received: from mail-vs1-f51.google.com (mail-vs1-f51.google.com [209.85.217.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A7901C3F31 for ; Fri, 15 May 2026 13:05:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778850326; cv=none; b=BbRRN8IUq2YPTksQMKZFDWd0UBEe6F/+lFQOchgTLrXXSoJE4oR66jsQjnGFarPWf+sGt1YtKqJyGq4F1D/OKjay9GEZF3eaGScb6o6mGcW2+nBdgnot1ddTdVYxlu/Np47zJsUmm+aepJarNr/v/0pk1ylqVwitJ9/PtUF4GZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778850326; c=relaxed/simple; bh=honIpHjQXRaEfjMyiAeWROXCZ8T2OieqleA+mRE/X1k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=d2A8xZMNavqXBq36g/GL4ehwW99yl/VVKnFbth8VsqGbfR4C9/QgEnqfrs3F4stq1UYn6WWXf99MWcUBfmFA3sYDmR+vYdYIfgU/Ka1Qsa5qdO+8s03PYahy6p4eyd66gqSviMqwAL7vN0kXH8cRjI9PNxqy9mP86AIcZMf40BE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WAq8Th8I; arc=none smtp.client-ip=209.85.217.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WAq8Th8I" Received: by mail-vs1-f51.google.com with SMTP id ada2fe7eead31-632a055fa9fso2386701137.1 for ; Fri, 15 May 2026 06:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778850324; x=1779455124; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Qpx8RNnGHJ9ymqlzPRNI9N2p4opJtjSN86qDmoFZ1hs=; b=WAq8Th8IkNwUEg7G+VyKMI/si1veYwNhUa4R8DhH9YWz8gAeR2h48zsFikABHVmpO7 EC8kC8xZ1OGUvgNLRxov0R5E1P4JzKs7PvXtg1+es7QoMBJDkc0LRtf5kFu3of25B2za jCmYajzf2WdAaHvzqERVEYNeiMkBxK3yr8qzp9VCeA5TFx7cPMd35dzAqajWv9RnpxOm TcTvXAx3YZU5aiJP0dPEbVP64tCo2F5Z5g6p51RJ1rtHi/udMqWoEwWifZksvbf6/Y80 xZZcpqT2yPAx2Go2/OaYDv9ejPTF6RHaF0UH5IQhdB2Z6HD3wPSPGfR7dAzLrTcPQegH zIFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778850324; x=1779455124; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Qpx8RNnGHJ9ymqlzPRNI9N2p4opJtjSN86qDmoFZ1hs=; b=YbE1TRu/mKZYpL/FkEIu7GzGhLjnOra47XTNbwF3eGFo5PdbwSMVeLlLUJq51su15I 2spoWN52+izvmyFnbz6VpKxwRgMBIyGm6ff8zQRw/ya9YcSfzevue3Y4Ngd67zq6bq7H SSIYsfhcuLi06C/vX7V4w5FSPK4DCOTBzFo6dw1Jxq+4SviiSjirS4nmtOWnUq+6hCz6 0yM+rMgNgeie8dUqdrYCmNNWanIA1FDic0LvaduBmRAPOpotts3sfofW0TRAw0NqXBxB iLpo/eQSzbCstiv7ljH2Ki3IIJe6QmCrledBwMoZPJSGQrkYkfC/1d6HY9kH+W+H1rSy K5KQ== X-Forwarded-Encrypted: i=1; AFNElJ8JNsCUoN1iyY82rySnv9h+URAFxv33fAXDCI0BkRweTRGjBee4WYiQh8c7IoVC60TY5QiWItzDN20nOPw=@vger.kernel.org X-Gm-Message-State: AOJu0YzGZpaxyzavoPXI40ox9h9eyfAwzGdrQkZBbO3SgngNu65/L7Hl gA8t+gy/oa3vOIc6assJcYXjVcSiDbQTnmrTM0jcj8NsdQUUi6lSW9N0 X-Gm-Gg: Acq92OEd8FqxZa/iCozn2fEqK4lOsssYEH3LL1mQno9Qwy15XEXlwIXKHm8v7Z1EyHS FWQJdDDjM5pq2NgR6+qlfpCPjFH6lGHjltgKELKUI7RIzrt3mQrwW7aA+TYI4rnU2JrPMO4VM47 L66L+YiJOjYvNAbsirxMUEllG+ayeYxIc5neECJVlgo8F16fGkvawcyi5NX8cJjmaicJKX+vrFm WgFgjIXAQL8CvGIv9m1hK0IFRJRTIReDg/zscShXU7QKjy+TO3IxBnPmX8jXjXUDaE8guZt8UHM SVpi1quORE1UO9R/WpkppMjTjinS+VhTMwxEINHTUF3LtHm8zr9kQAu8R6fVpyggyxkKbZseaKE 2LSDWF1C+PcB8DbJYBjvLI7jXLdu4QfcoH3ex43t6VbTLL8tvTYFM1Shhjqz7aNmZBShLleoVSh +olcQHQ2zIn5z/UAqSScWEWMxnnjHjKiyAw6+wH3DeZD8TAV1owUQ= X-Received: by 2002:a05:6102:304d:b0:62f:2f1f:599b with SMTP id ada2fe7eead31-63a3d21f6e7mr1756693137.7.1778850324210; Fri, 15 May 2026 06:05:24 -0700 (PDT) Received: from i4-gl-tmk5904.ad.psu.edu ([130.203.156.186]) by smtp.gmail.com with ESMTPSA id af79cd13be357-910ba181322sm541982685a.7.2026.05.15.06.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2026 06:05:23 -0700 (PDT) From: Yuho Choi To: "David S. Miller" , David Ahern , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Simon Horman , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yuho Choi Subject: [PATCH v2] ipv6: route: Unregister netdevice notifier on BPF init failure Date: Fri, 15 May 2026 09:05:17 -0400 Message-ID: <20260515130517.779406-1-dbgh9129@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ip6_route_init() registers ip6_route_dev_notifier before registering the IPv6 route BPF iterator target. If bpf_iter_register() fails, the error path jumps to out_register_late_subsys and unwinds the RTNL handlers and late pernet subsystem, but leaves the netdevice notifier registered. Unregister the netdevice notifier in the bpf_iter_register() failure branch before continuing with the existing cleanup path. Fixes: 138d0be35b14 ("net: bpf: Add netlink and ipv6_route bpf_iter targets= ") Signed-off-by: Yuho Choi --- Chages since v1: - Unregister ip6_route_dev_notifier directlry in the bpf_iter_register() fa= ilure path. net/ipv6/route.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index cb521700cee7..de9a1d4c72d8 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -6924,8 +6924,10 @@ int __init ip6_route_init(void) #if IS_BUILTIN(CONFIG_IPV6) #if defined(CONFIG_BPF_SYSCALL) && defined(CONFIG_PROC_FS) ret =3D bpf_iter_register(); - if (ret) + if (ret) { + unregister_netdevice_notifier(&ip6_route_dev_notifier); goto out_register_late_subsys; + } #endif #endif =20 --=20 2.43.0