From nobody Mon Dec 1 22:34:42 2025 Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) (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 46E9436D4F9 for ; Sat, 29 Nov 2025 01:39:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764380352; cv=none; b=K7GwNM5+cfDqwP1PmSbhPWNTpLFeHoMaV9yvDFOHfHKLMUC1eKUEOKBeDc+PEThYADPqKe/wDhJ3sujl0cDpKqYF3eOyZSVvq+exWMEi33pHpOs4mlN5d2UkgVLctyhipWwb2tODY4tKHSgtILLElM3KbNpIFjnbMxHNQkFONLU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764380352; c=relaxed/simple; bh=ZfBtirPlHkQZwo3ILB9h8Ubpof36htWpg6wCm85kz2k=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=igjag2bkLjS8UWsZ4CqFuZGtjOLZphVM0rHjmFjra1Fv77EAFCcHS/2+brl6KFLa/6cQ8Zvlk5cBLmoCciU7cWNZbsAR8xUapx2lBr6qmOOoILGzncGZ/t1lLiGyI+0EDKbmUMTlj+k5sNLTXfOY8lva4lEBwkvfM6djo0kUzaE= 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.166.72 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-io1-f72.google.com with SMTP id ca18e2360f4ac-948fbd0745fso132771739f.3 for ; Fri, 28 Nov 2025 17:39:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764380350; x=1764985150; 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=wqFVoJv7hY1bn/cW89Jy1zjZ5AeXLEekpKM0gCQ/Y8A=; b=EI02iJyJUkis4SvaWx9viXyHZtN9zRZyhw0FE2RqGhMCActNu0qCEdIAwnlVnPaD5t +7gtmI6TXhEQf6Go7TW7KJmGiA66DlRj3uuWXgo1YGF6VBh4tJoGBDDQcuKJnVyjP7WO dXZCEG2dLybiqseqGdEWWbiYVGqkZwWGJQC/nXGBwYBEDebk3mziJQIcZtkxBaJqrReR hYsg8zbOvZ+hwK8ehlm7Z1GM9GgVeP+2gMvkGl3ur3oOSTMbR/meyWdzaoweK0zB3GqG 14vBP3J/8N37iBLD2AIkgAQ8/1qtvjScbZhL4skaXrUqGSEDhzh4kCORMpanmU49sNn9 rOpw== X-Gm-Message-State: AOJu0Yz3K+Lng1ozATPM6Xuk3/AbCb1ijj/PKjpTrtFUZCiOZReOqDY8 3e64OxXFxAYF0dSXA/MVAbXD/wnp/JH2jz7kn8j1ozrsi2AMEJNbjVRoCxyZvMWaGnQDJ+DI9sh 8uqxG5Zxt8n57qkzzRJDlDxeQ6YsuVD7XWubODelnlPHHasLO3clH79miVgg= X-Google-Smtp-Source: AGHT+IF+2M7EGLk8hO3XMm4N3bGrq6afWtFi83NUmFqAqfSMEFNLtDZGKvkFA4ej2e+1PJOGW4s/mXgcogNbQdjX4XwwUkIkfrLy 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:6e02:240d:b0:433:78dd:18ed with SMTP id e9e14a558f8ab-435dd0fcc7fmr129342485ab.26.1764380350308; Fri, 28 Nov 2025 17:39:10 -0800 (PST) Date: Fri, 28 Nov 2025 17:39:10 -0800 In-Reply-To: <692a2462.a70a0220.d98e3.0152.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <692a4ebe.a70a0220.d98e3.0155.GAE@google.com> Subject: Forwarded: [PATCH] net: netrom: fix memory leak in nr_output() 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] net: netrom: fix memory leak in nr_output() Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master When nr_output() fragments a large packet, it calls sock_alloc_send_skb() in a loop to allocate skbs for each fragment. If this allocation fails, the function returns without freeing the original skb that was passed in, causing a memory leak. Add the missing kfree_skb() call before returning on allocation failure. Reported-by: syzbot+d7abc36bbbb6d7d40b58@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3Dd7abc36bbbb6d7d40b58 Signed-off-by: Deepanshu Kartikey --- net/netrom/nr_out.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/netrom/nr_out.c b/net/netrom/nr_out.c index 5e531394a724..2b3cbceb0b52 100644 --- a/net/netrom/nr_out.c +++ b/net/netrom/nr_out.c @@ -43,8 +43,10 @@ void nr_output(struct sock *sk, struct sk_buff *skb) frontlen =3D skb_headroom(skb); =20 while (skb->len > 0) { - if ((skbn =3D sock_alloc_send_skb(sk, frontlen + NR_MAX_PACKET_SIZE, 0,= &err)) =3D=3D NULL) + if ((skbn =3D sock_alloc_send_skb(sk, frontlen + NR_MAX_PACKET_SIZE, 0,= &err)) =3D=3D NULL) { + kfree_skb(skb); return; + } =20 skb_reserve(skbn, frontlen); =20 --=20 2.43.0