From nobody Sat Feb 7 17:55:15 2026 Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) (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 BCABF31D380 for ; Fri, 16 Jan 2026 02:19:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.71 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529959; cv=none; b=onZv0+yYW3aU3oAXEIxiP3fu0JWIFxLD+TfcELVhQYrOWaT+UNTFlDheYIQ4rWjy8R2cWK7urYPLV6PwrNyTxAiyrXomtSqCh1QbM8WHIoAuL+JPUXBGhbD+Up/d9bJ0b0cdYAJ3SXboaKaUYKpMDXt9Xou1EzmZkcNBXsz042U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529959; c=relaxed/simple; bh=xaCbO7nyIphz3gAyDNhSp+1hgJ60PK9NEAd2H+MlnJQ=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=leOKmPm8S9ny3fXkTtPuqAbijLx/ORqcfP/9qx9Rn55v8IkCe4J044l3MnYA9dqf0sIpEJV6dVoUcjzDikC2M8DNFL5LlAKVflbPYFGaCijIcwONg6OMy1l0LVbOYC+i67kRlEiWO/YmEzv3Zt7KbqomPFp+lREVWyPpgSgq03E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f71.google.com with SMTP id 006d021491bc7-661066bdfb9so4502573eaf.1 for ; Thu, 15 Jan 2026 18:19:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768529956; x=1769134756; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=S2AkY/j7cfuPDg3BUPQQi4tSnGE59GZQ0qLyLmeB+Sw=; b=KWbp5NRT2Bn5I6qjUl15vuEGCZ7WqtDlSpUe1gFOjXuO+q5IVlk+kjIiKFZfs4SazF BaWSk/af1aIhIl4oBVJtkanSQcVPojSJPpYTsTbM3TGbrQtoe8Y+3j+FVo5Qezvnp+WM Wiwo1oPx77WBErvlcU22iPIn3z64Q/+aIwVB/7g3T7Hdw7iAA+rPPP61jDx6rUzNYcOQ o267ZA3hfRQRuW76Lvup2Lg4JDrSqhuQep9Wld+jtDl78wkHPIWOo5OZoaM1NOrcBHso eM0MU5KUpONyE/dsQerr07OGrQnSutKRYgigJGt71IuwMwLm9RCzqNBKgZNXpGTxirdW 59jw== X-Gm-Message-State: AOJu0YyGnXEzg/bOGsZTx9UYKkFH4xKaWD/EqwEeA5gji8LpmPTTO9cM Mkbb55kmg1gvVU9Pipcjzxm4dSsPmWlC48D5dg3CdiprpAMzKGWzhu4E/SR0fA89WURIG+y7cZw /gxKlMu3bUEVpMRokIH6J5Xk6TEtv2F0XJ8edjc+kXzIUpAOrFh2STjF2zXo= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:2294:b0:65f:71ec:4eb4 with SMTP id 006d021491bc7-661179cac7dmr686108eaf.60.1768529956435; Thu, 15 Jan 2026 18:19:16 -0800 (PST) Date: Thu, 15 Jan 2026 18:19:16 -0800 In-Reply-To: <69694849.050a0220.58bed.0025.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6969a024.050a0220.58bed.0036.GAE@google.com> Subject: Forwarded: [PATCH] netrom: fix memory leak in nr_add_node() From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] netrom: fix memory leak in nr_add_node() Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master When nr_add_node() creates a new neighbor but the route quality is too low to be added (node already has 3 routes with better quality), the newly allocated neighbor is never used but remains in the neighbor list with refcount=3D1, causing a memory leak. Fix by checking if the new neighbor was actually used (count > 0) and removing it from the list if not. Reported-by: syzbot+3f2d46b6e62b8dd546d3@syzkaller.appspotmail.com Signed-off-by: Deepanshu Kartikey --- net/netrom/nr_route.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c index b94cb2ffbaf8..4b85bacb7f65 100644 --- a/net/netrom/nr_route.c +++ b/net/netrom/nr_route.c @@ -100,6 +100,7 @@ static int __must_check nr_add_node(ax25_address *nr, c= onst char *mnemonic, { struct nr_node *nr_node; struct nr_neigh *nr_neigh; + bool new_neigh =3D false; int i, found; struct net_device *odev; =20 @@ -172,6 +173,7 @@ static int __must_check nr_add_node(ax25_address *nr, c= onst char *mnemonic, } } =20 + new_neigh =3D true; spin_lock_bh(&nr_neigh_list_lock); hlist_add_head(&nr_neigh->neigh_node, &nr_neigh_list); nr_neigh_hold(nr_neigh); @@ -279,6 +281,9 @@ static int __must_check nr_add_node(ax25_address *nr, c= onst char *mnemonic, } } =20 + if (new_neigh && nr_neigh->count =3D=3D 0) + nr_remove_neigh(nr_neigh); + nr_neigh_put(nr_neigh); nr_node_unlock(nr_node); nr_node_put(nr_node); --=20 2.43.0