From: Greg KH <gregkh@linuxfoundation.org>
To: Tanuj Sharma <ertanuj96@gmail.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org,
linux-hams@vger.kernel.org, stable@vger.kernel.org,
ralf@linux-mips.org, horms@kernel.org
Subject: Re: [PATCH] net: rose: fix OOB read in CCITT facility parsing
Date: Tue, 24 Nov 2026 08:05:54 +0100 [thread overview]
Message-ID: <2026112418-freebee-tasting-68ba@gregkh> (raw)
In-Reply-To: <20261123183818.24508-1-ertanuj96@gmail.com>
On Tue, Nov 24, 2026 at 12:08:18AM +0530, Tanuj Sharma wrote:
> In rose_parse_ccitt(), the 0xC0 (variable-length) case validates that
> len >= 2 and that the length field l is in range [10, 20], but does not
> check that the remaining buffer can actually hold l + 2 bytes before
> performing memcpy operations at offsets p+7 and p+12.
>
> With a short facilities field (e.g. 2 bytes) and l=10, the memcpy calls
> read up to 15 bytes past the buffer, leaking adjacent heap data into
> the facilities struct. This data is then copied to the socket and can be
> read by userspace via getsockname()/getpeername().
>
> Add the same bounds check that rose_parse_national() already uses for
> its own 0xC0 case: if (len < 2 + l) return -1.
>
> This code was removed from mainline by commit dd8d4bc28ad72 but remains
> in the 6.12 LTS branch and all prior LTS branches.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@vger.kernel.org
> Signed-off-by: Tanuj Sharma <ertanuj96@gmail.com>
> ---
> net/rose/rose_subr.c | 2 ++
> 1 file changed, 2 insertions(+)
This file is no longer in the tree, please submit this to the
out-of-tree repo that is keeping this codebase alive as it does send
patches back to the stable kernel trees quite often.
thanks,
greg k-h
next prev parent reply other threads:[~2026-11-24 7:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 18:38 [PATCH] net: rose: fix OOB read in CCITT facility parsing Tanuj Sharma
2026-11-23 18:43 ` netdev-bot+sinfo
2026-11-24 7:05 ` Greg KH [this message]
2026-11-25 10:41 ` Bernard Pidoux
[not found] ` <CAAnb6FSz3mbTOPmXg3AAq3qJ4NaDxEeG65Jt5K7-aVMiq2_70g@mail.gmail.com>
2026-11-30 15:22 ` Bernard Pidoux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026112418-freebee-tasting-68ba@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=ertanuj96@gmail.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-hams@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ralf@linux-mips.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.