linux/net/netrom
Eric Dumazet 31642e7089 netrom: fix info-leak in nr_write_internal()
Simon Kapadia reported the following issue:

<quote>

The Online Amateur Radio Community (OARC) has recently been experimenting
with building a nationwide packet network in the UK.
As part of our experimentation, we have been testing out packet on 300bps HF,
and playing with net/rom.  For HF packet at this baud rate you really need
to make sure that your MTU is relatively low; AX.25 suggests a PACLEN of 60,
and a net/rom PACLEN of 40 to go with that.
However the Linux net/rom support didn't work with a low PACLEN;
the mkiss module would truncate packets if you set the PACLEN below about 200 or so, e.g.:

Apr 19 14:00:51 radio kernel: [12985.747310] mkiss: ax1: truncating oversized transmit packet!

This didn't make any sense to me (if the packets are smaller why would they
be truncated?) so I started investigating.
I looked at the packets using ethereal, and found that many were just huge
compared to what I would expect.
A simple net/rom connection request packet had the request and then a bunch
of what appeared to be random data following it:

</quote>

Simon provided a patch that I slightly revised:
Not only we must not use skb_tailroom(), we also do
not want to count NR_NETWORK_LEN twice.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Co-Developed-by: Simon Kapadia <szymon@kapadia.pl>
Signed-off-by: Simon Kapadia <szymon@kapadia.pl>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Tested-by: Simon Kapadia <szymon@kapadia.pl>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230524141456.1045467-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-05-25 21:02:29 -07:00
..
af_netrom.c netrom: Fix use-after-free caused by accept on already connected socket 2023-01-30 07:30:47 +00:00
Makefile
nr_dev.c ax25: constify dev_addr passing 2021-10-13 09:40:45 -07:00
nr_in.c net: netrom: nr_in: Remove redundant assignment to ns 2021-04-28 13:59:08 -07:00
nr_loopback.c net: Remove redundant if statements 2021-08-05 13:27:50 +01:00
nr_out.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
nr_route.c ax25: constify dev_addr passing 2021-10-13 09:40:45 -07:00
nr_subr.c netrom: fix info-leak in nr_write_internal() 2023-05-25 21:02:29 -07:00
nr_timer.c netrom: Fix use-after-free of a listening socket. 2023-01-24 11:54:01 +01:00
sysctl_net_netrom.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00