]> git.baikalelectronics.ru Git - kernel.git/commit
s390/qeth: ensure linear access to packet headers
authorJulian Wiedmann <jwi@linux.ibm.com>
Thu, 5 Dec 2019 13:33:03 +0000 (14:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Dec 2019 20:25:05 +0000 (12:25 -0800)
commit1cd663e61e6e902ff2264267464bd2259929a63a
tree7ecd6e6bdb59ae8ddb107d0fc312c6d596393e28
parent7abb63bb9f9e7a365bbdc6909ec628018478eb1c
s390/qeth: ensure linear access to packet headers

When the RX path builds non-linear skbs, the packet headers can
currently spill over into page fragments. Depending on the packet type
and what fields we need to access in the headers, this could cause us
to go past the end of skb->data.

So for non-linear packets, copy precisely the length of the necessary
headers ('linear_len') into skb->data.
And don't copy more, upper-level protocols will peel whatever additional
packet headers they need.

Fixes: a5a090d6ef88 ("qeth: new qeth device driver")
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core_main.c