Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94638198 authored by Willem de Bruijn's avatar Willem de Bruijn Committed by Gerrit - the friendly Code Review server
Browse files

rose: limit sk_filter trim to payload



Sockets can have a filter program attached that drops or trims
incoming packets based on the filter program return value.

Rose requires data packets to have at least ROSE_MIN_LEN bytes. It
verifies this on arrival in rose_route_frame and unconditionally pulls
the bytes in rose_recvmsg. The filter can trim packets to below this
value in-between, causing pull to fail, leaving the partial header at
the time of skb_copy_datagram_msg.

Place a lower bound on the size to which sk_filter may trim packets
by introducing sk_filter_trim_cap and call this for rose packets.

CRs-Fixed: 1089895
Change-Id: Idc52737bc96097a9220dfe47bb76e94ff1026a05
Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Git-commit: f4979fcea7fd36d8e2f556abef86f80e0d5af1ba
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


[subashab@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent 3703895d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment