]> 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)
commit97101e4b28c1942c854d2c3a34e1e7f694fa61a8
tree920af641fcecb8ac9956ded01c33df742c917add
parent3ff78902eacbfa976a0e301552d21229e102468d
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