Hi Tanuj,
Thank you for the answer.
One thing to know before you open the pull request: the mod-orphan
main branch has moved since your patch.
While reviewing your fix, I found two smaller bounds problems in the
same facility parsing code.
They are independent of yours, and they were merged today as pull request #96:
04f81e5 rose: test the length before the next byte in the facility loops
b4451d3 rose: count the length byte when checking the facilities length
The first one changes the loop condition in rose_parse_national() and
rose_parse_ccitt() to "len > 0 && *p != 0x00", so the byte after the
field is no longer read when nothing is left.
The second one makes rose_parse_facilities() reject facilities_len ==
packet_len, which was accepted with one byte missing.
They complement your fix and do not replace it.
The 0xC0 case of rose_parse_ccitt() still has no "len < 2 + l" check
on the current main, and your two lines still apply cleanly on top.
Please base your branch on the current main.
Once your pull request is merged, I will send it to the stable
maintainers for 6.12.y and 6.18.y together with these two commits.
73 de Bernard, F6BVP
Re: [PATCH] net: rose: fix OOB read in CCITT facility parsing
- From
- bern…@gmail.com (Bernard Pidoux)
- Organization
- Usenet Network
- Message-ID
- <CAFAa3YAEhKBBzQxnUOhEgoWPuM1V55Y=4bXfZ2i62ApXmu=t…@mail.gmail.com>
- Date
- Newsgroups
- linux.kernel.netdev