Re: [PATCH] net: wan: lapbether: validate frame length and headroom in lapbeth_rcv() and xmit

From: Martin Schiller

Date: Mon Nov 23 2026 - 13:27:36 EST


On Mon, 21 Sep 2026 00:34:45 +0200, netdev-bot wrote:
> - [High] The commit message describes two changes that are not present in
> the diff.
> - [High] In lapbeth_rcv() (drivers/net/wan/lapbether.c:135-142) the wire-
> supplied 2-byte length `len = skb->data[0] + skb->data[1] * 256;` is…

I agree with the review. The useful part of the change is the switch
from skb_trim() to pskb_trim_rcsum(): skb_trim() warns and does not
trim at all if the received skb is nonlinear. That is what the commit
message should describe.

Hui, for a v2 for net, as a new thread with [PATCH net v2] in the
subject, please:

- describe the actual change and its effect;
- drop frames whose length field is larger than the received data,
as the subject promises;
- count skb->len after the trim instead of the length field;
- drop the Assisted-by: line, as for the lapb_decode() patch.

Charging the receive counters to the Ethernet device instead of the
LAPB device is a separate issue and can be a separate patch.

If you don't have time for these two patches, let me know and I'll
take them over.