linux/net/atm
Eric Dumazet ecc7253683 pppoatm: ensure a writable skb header and linear data
In pppoatm_send(), LLC encapsulation checks whether there is sufficient
headroom for the 4-byte LLC header, but does not ensure that the skb header
is writable.

Normal transmit packets passing through ppp_start_xmit() have their header
unshared via skb_cow_head(). However, packets can also reach pppoatm_send()
via PPP channel bridging (PPPIOCBRIDGECHAN) without going through
ppp_start_xmit().

Use skb_cow_head() to ensure both sufficient headroom and a writable
header before pushing the LLC header.

While at it:
- Call pskb_may_pull(skb, 1) before inspecting skb->data[0] to prevent
  out-of-bounds reads on zero-length or non-linear frames (e.g. from
  bridging).
- Defer SC_COMP_PROT protocol compression until after pppoatm_may_send()
  succeeds. This eliminates the temporary skb allocation on admission failure
  and completely removes the fragile "undo" heuristic at the nospace label,
  avoiding any risk of reading uninitialized headroom or performing an
  unbalanced skb_push().

Fixes: 4cf476ced4 ("ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260912233048.3977192-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-15 17:07:01 -07:00
..
atm_misc.c atm: remove unused exported helpers 2026-07-29 17:54:58 -07:00
atm_sysfs.c atm: remove the local ATM (NSAP) address registry 2026-06-16 08:53:52 -07:00
br2684.c atm: remove SVC socket support and the signaling daemon interface 2026-06-16 08:53:52 -07:00
common.c net/atm: fix slab-out-of-bounds read in vcc_setsockopt() 2026-08-06 09:29:14 -07:00
common.h atm: remove SVC socket support and the signaling daemon interface 2026-06-16 08:53:52 -07:00
ioctl.c atm: remove orphaned uAPI for deleted drivers, protocols and SVCs 2026-06-16 08:53:53 -07:00
Kconfig net: remove unused ATM protocols and legacy ATM device drivers 2026-04-23 12:21:14 -07:00
Makefile atm: remove SVC socket support and the signaling daemon interface 2026-06-16 08:53:52 -07:00
pppoatm.c pppoatm: ensure a writable skb header and linear data 2026-09-15 17:07:01 -07:00
proc.c atm: remove SVC socket support and the signaling daemon interface 2026-06-16 08:53:52 -07:00
protocols.h atm: remove AAL3/4 transport support 2026-06-16 08:53:51 -07:00
pvc.c atm: convert to getsockopt_iter 2026-05-22 11:11:09 -07:00
raw.c atm: remove the unused pre_send and send_bh device operations 2026-06-16 08:53:52 -07:00
resources.c atm: remove SVC socket support and the signaling daemon interface 2026-06-16 08:53:52 -07:00
resources.h atm: lift copyin from atm_dev_ioctl() 2020-05-20 20:31:35 -04:00