🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #22463

Re: [PATCH] net: rose: fix OOB read in CCITT facility parsing

#22463
From: Bernard Pidoux
Date: Wed, 25 Nov 2026 10:41
50 lines
13265 bytes
Hi Tanuj,

Thank you for the fix. I take care of the ROSE code in the out-of-tree
repository Greg mentioned, and I run these modules on a small ROSE/FPAC
network, so here is a review.

The bug is real. rose_parse_ccitt() never checks that the 0xC0 entry
fits in what is left of the facilities field, while
rose_parse_national() does. I reproduced it in user space by building
rose_parse_facilities(), rose_parse_national() and rose_parse_ccitt()
unchanged with AddressSanitizer: a 4-byte facilities field
"00 0F C9 0A" (CCITT, DEST_NSAP, l = 10, the 10 bytes missing) at the
end of the buffer gives a heap-buffer-overflow read in
rose_parse_ccitt() (the memcpy() from p + 7). With your patch the entry
is rejected and AddressSanitizer stays quiet.

Two points in the commit message are not right, though:

- It is not only 6.12 and older. 6.18.y has the same code (checked in
  v6.18.65), and so does the out-of-tree repository.

- The data read past the buffer does not reach user space. When
  rose_parse_ccitt() returns more than it was given,
  rose_parse_facilities() catches it with
  WARN_ON(len >= facilities_len) and returns 0. Both callers,
  rose_rx_call_request() and rose_route_frame(), then clear the call,
  and the facilities struct, a local variable, is dropped. getsockname()
  and getpeername() never see it. The user-space test above goes the
  same way: the WARN_ON fires and the parse fails.

So the effect is an out-of-bounds read of up to about 20 bytes past the
facilities field, and a WARN that any ROSE neighbour can trigger from
the air or over AXUDP with a crafted CALL REQUEST, which means a reboot
on a system with panic_on_warn set. That is still worth fixing, and
your two lines are the right fix.

As Greg said, please open a pull request at

  https://github.com/linux-netdev/mod-orphan

with the commit message updated as above (and the answer to the netdev
bot's question about how the bug was found). Once it is merged there,
it will go to the stable maintainers for 6.12.y and 6.18.y with the
next batch of fixes from that repository. If you would rather not deal
with GitHub, tell me and I will carry it there with you as the author.

Reviewed-by: Bernard Pidoux <bernard.f6bvp@gmail.com>

73 de Bernard, F6BVP
Technical Details
Message-ID: <20261125104157.265662-1-bernard.f6bvp@gmail.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371238-linux-kernel-netdev=dewy.ru
References: <20261123183818.24508-1-ertanuj96@gmail.com> <2026112418-freebee-tasting-68ba@gregkh>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371238-linux-kernel-netdev=dewy.ru
From: bernard.f6bvp@gmail.com (Bernard Pidoux)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] net: rose: fix OOB read in CCITT facility parsing
Date: Wed, 25 Nov 2026 11:41:57 +0100
Organization: Usenet Network
Message-ID: <20261125104157.265662-1-bernard.f6bvp@gmail.com>
References: <20261123183818.24508-1-ertanuj96@gmail.com> <2026112418-freebee-tasting-68ba@gregkh>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="184378"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:FZ2kJcMeO3EP2NZ/rjYW97AgvGs= sha256:KbPK6Doqxxz0cc7rE8o4YvS1Gf29aFTx8ZRIYlONh7o=
	sha1:X163mpOkdoIZcuvB2Y9FoFvkDpw= sha256:/Zr+Nb2XQQEQpfHB4SFECDwjjrW14pDpKYuu/Zw3v9A=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 26C02125E55; Wed, 25 Nov 2026 13:42:51 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.049
X-Spam-Status: No, score=-2.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FORGED_GMAIL_RCVD=1,
	FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id DjdompD_bqLx;
	Wed, 25 Nov 2026 13:42:47 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-371238-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 97A60125E52; Wed, 25 Nov 2026 13:42:31 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id ACEAB34CDC; Wed, 25 Nov 2026 10:42:28 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795603347;
	b=3r9uxUFwrUvIwoLpi7QsW2zphAiJLFpZrMiedcaRZMtSMhCU80vdtU4uPig23cioxLUM
	 IH/274jOCXBjit2h91K+rlSldYGh1Dkj4eKwNkcGqrsGLuI3VhfMSlqZThGcylQnXvyST
	 v5Nc7VpQyHuB2MDYZIAN2MGXqbJBkBlOdTuuvcO0G0q6iPaFKrvQBFj7hlGxL2uH0BNv3
	 6fh3krYevYGhl8vB8nIsWfOAQsBl8XGsAHqrDpYInguwml/lV51P8pw42KvyZ4YybLTUU
	 kLheOUeY0MnF3LvLslF1Id6XkTts9bAX2sP3rTxfjtzpfEf/aKJ3QtnT5FOTwsXKIkQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795603347;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-ID:
	 X-Mailer:In-Reply-To:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Transfer-Encoding;
	bh=2itv7AcVBputKhN6p3kMxHNEdUzZvUrvuaoBxgjz4ao=;
	b=163VbsE59Lp4ZamoqWvy2Sva3JLT0ZzW6iIt8ZS94kv1Cfljn7fnJKYrYMAPMJoxUq2L
	 6rfer1jvFkU0HL49/wlRH4XoSRRtxs5YX0N8eOwRORxrcG1MXLwx9lPghjs3w8+f/DcJU
	 qiYmoIXapkXoT4sRHvoUcC2DerUTqyEwoFLrZtuQDprbOPPNkHSbvY0yr1nGECJR/QFW1
	 HSUOBoKLtS2kxztP8GFy3x42/ycq7c01JmyhmUcLe4cL9oKhHCSCr0AteA1RrSwhW0pBw
	 8TyDnSxiXB2Qu4lq24iiWTJRAoLtF9gXsKCoH505tOS21FfUgvE6uXwz6UfyvpSyFaQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=GTOC9omH;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id D9582606A339;
	Wed, 25 Nov 2026 10:42:27 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=GTOC9omH
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.41
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795603347;
	b=MQR/DFChW0mmuctYom/TdK7C0f1AkCoOelCa9DHT26XY0WibyByQJPWNRLCkx00zBReW
	 qpFX5mVBA+6raydEzqmTVUZjV6gFuHV3aujgoDoc86wiaxDHnuIR8I1kUiELOMhHdrK3Z
	 mxqlpUUoDeDxQjjX1vkhqH1cZYKancN/gOwwMOZF+caEIitfTWr5OFBHAnPJKd2cn1Jwl
	 TLO5jRYLo+iKnCk6ugHh5uhY8ZEvTtIgyQOlkr39590/ezJX9mMgKPQnONr78Y/mqPS0H
	 dSphxe0sYbXmjLM2OmkfRelShfbZBGhz08QlxdmbQ5CvcUag+2kK3ADslGGiyQ/gnkw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795603347;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 MIME-Version:Content-Transfer-Encoding;
	bh=2itv7AcVBputKhN6p3kMxHNEdUzZvUrvuaoBxgjz4ao=;
	b=Z7MBYRFIrAnb6jHn6A+/mBQ9XFDuojUD+/KJlTJmprLLxZ3r3yAFp1OJpsUAUWLJVlzG
	 d2nMu3ReCUHnzV2C4gyM54AwVOI9H6cNqoIEeVZQZxN50iK+yoB+iAYX4DOH7TGvRVp+q
	 4KcFpsLa0QEhuWHNhzmqo3ru7GiFPmEF1GrvjaYwSxAQxKut18kZDmho6EzF0JDV18Wsd
	 p27wfzbrX+0JHYGV+dYKolFDVqj6dVXjjuyMY7ZiL32KWcugGLcCdJg083u0ORVtbgCSQ
	 jT/JZ9FVhwOB4+NFPVJzyzO7V0Ry7XJYgnETCcag71euFHxx2QmXUmAC+8ZTYpA0Gqw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=GTOC9omH;
	arc=none smtp.remote-ip=209.85.128.41
X-Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 523B8606A327
	for <netdev@vger.kernel.org>; Wed, 25 Nov 2026 10:42:26 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 523B8606A327
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4bb77a462c6so48464875e9.1
        for <netdev@vger.kernel.org>; Wed, 25 Nov 2026 02:42:26 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1795603344; x=1796208144; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=2itv7AcVBputKhN6p3kMxHNEdUzZvUrvuaoBxgjz4ao=;
        b=GTOC9omHlN755K9A45vsxlj2kZzH2TydJr26tT2j1VdKH9AuU2YpjdDZrdVu+PvyNw
         FjD3/41LirizaeyE51QeopzgMvhb00wccT5F+DmamieIWvGOpYd8mhXlkklBrAqpUEPB
         eX1cFlBg0IZ6I06TcveXFCS1CsxjnhOYxeTOJv/4P/fYS21byIWQa0uWI0wcCYEoJiY7
         I3xO4QUwcocd5fZN31rbnVLiZejYU+mGtwBRIKZNz3IGyN1ZLOE+eEorxL5pA/9p7YkJ
         6/w4cqjt8ZnhZ/zTdb6HCv5SxBGWFIMsWYgQeArmIA2xsnkr7bLOSmuHz9mG4+ftnZsX
         Qaew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1795603345; x=1796208145;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=2itv7AcVBputKhN6p3kMxHNEdUzZvUrvuaoBxgjz4ao=;
        b=Z53pHsi2bGPCKhU3TSL2pe5cl5uVMVxQcH6uwyWIn7wCBSZSi5FqQw6usqWzkw9lyO
         bxc9s8WlWdRXdus9112ox9+AVWHY1PZROrnbCC0oy1+kuIE8sBgTYk7swl7p+NV4sb5x
         W/K0zcl4vfmh0DyqnI+USAAV0YDEjJ9tdK/2qO/S4Dk4vk+FVFXpxIfAGJti7Dh+eK80
         PF9EN1du1uEjY6NHyiNIDdo8azWzVK14mGYDZuibj6Slyw7mCnDf9/s4IePSxwhBC6JC
         OaVwas1Wl6izPj0EiNKztNBQzjjW2ftL10k+mKkdumsk+/ZW1ICnHl031ZC0MFa+idov
         kFvQ==
X-Forwarded-Encrypted: i=1; AL+hErGXhNyWamPkfhyTzPS6reG/ytSGLk1HYzhoUhTnYcteAUHdeqTZbLFaBqanTJAjwaxDjIRYlFU=@vger.kernel.org
X-Gm-Message-State: APuU4Z+hbwx+kXcvMOb3pmdpE2X6OkWxWKtSM8TCeq6qfha6Skv0sWN8
	ktk0h55Tc95WzX8RUDitGysSlPQxZpbJzMeLYbVv+jodaVU0PvN188DAm2xipw==
X-Gm-Gg: AZFdTZeQbbM9gw9c/WGTiCEvBrPySrBoS28469PYiBsS8xC5FFgxAerOe6TwXQjRRYz
	RbRRLj8JWYZcUQMTw3ifX8dQzh+LgT4vwSIeF8A3U0dBN0bPUHb2UnSZjHPYTeDHODI1PuHjjhn
	rcs4iu2A9LiHhk2kqbhFsGnduBC4eyBqdTryRz/Nd6EXqPJbySX/WScym6v8P8RseFbBLs1vEKk
	dq/Qo5KU7R3tPDDOV8E16GEx9Ip1YJB19uEyt2D6/6xXHAVv6IjTHd+5NKYb7eBw958OXfXn4AD
	Ed3MaljjEjXOuAKuwt2h0mhkyG2QQy1b9raccjyRZ6Ag39I+aqHyx1OyU+b2M7za4yYm31Kv7Cx
	Ad5Ld/ONErGFIQYII4p2C3ejujBwScU197u7qabAooREoIQ+BDuXZWMQ3uTU941bKsS4d2wicOh
	WXsHunGmEw93QsIc9ImVjMggf5FmFMNrg5hMClBBhavyo6LoiDO+f2SYOYL/Q/C9n181VNhlMcg
	XIOopX7q96kjw/Fs8bhN4M+G1bw+/kZH4zhq7jg7kBtH3l7hx0FF0Amvm6N8g3KTfI32VnsdMLE
	2o0GxweGDGdl8/78VyEqTXFMcxT9GdW+D4v3vn2tvspNsdAz+BIRnvnkUe3RRCF7ZRm+j/RC7Q7
	0wd2I6w==
X-Received: by 2002:a7b:cbc8:0:b0:4a1:d49e:9ce with SMTP id 5b1f17b1804b1-4bb860f6ae9mr298157935e9.2.1795603344300;
        Wed, 25 Nov 2026 02:42:24 -0800 (PST)
X-Received: from ubuntu-f6bvp (lfbn-idf1-1-304-238.w86-195.abo.wanadoo.fr. [86.195.26.238])
        by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6b2050f1sm33160630f8f.38.2026.11.25.02.42.23
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Wed, 25 Nov 2026 02:42:23 -0800 (PST)
X-Cc: Greg KH <gregkh@linuxfoundation.org>,
	davem@davemloft.net,
	edumazet@google.com,
	kuba@kernel.org,
	pabeni@redhat.com,
	horms@kernel.org,
	ralf@linux-mips.org,
	netdev@vger.kernel.org,
	linux-hams@vger.kernel.org,
	stable@vger.kernel.org
X-Mailer: git-send-email 2.53.0
X-In-Reply-To: <2026112418-freebee-tasting-68ba@gregkh>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list