]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: fully initialize the msg wrapper skb
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 3 Jun 2019 22:16:58 +0000 (15:16 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Jun 2019 21:33:50 +0000 (14:33 -0700)
commit656e68c2f5c04b2f228f1e1130aae7b68f158af4
tree920af641fcecb8ac9956ded01c33df742c917add
parentefc1151a74bc6dcd24aa43675881a1b01a469834
net/tls: fully initialize the msg wrapper skb

If strparser gets cornered into starting a new message from
an sk_buff which already has frags, it will allocate a new
skb to become the "wrapper" around the fragments of the
message.

This new skb does not inherit any metadata fields.  In case
of TLS offload this may lead to unnecessarily re-encrypting
the message, as skb->decrypted is not set for the wrapper skb.

Try to be conservative and copy all fields of old skb
strparser's user may reasonably need.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h
net/core/skbuff.c
net/strparser/strparser.c