]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'sctp-=security-hook-fixes'
authorDavid S. Miller <davem@davemloft.net>
Wed, 3 Nov 2021 11:09:21 +0000 (11:09 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 Nov 2021 11:09:21 +0000 (11:09 +0000)
commit50af2c445f181e2c8e4a363d52f496fbc97d42f1
tree8340d44e4090a192e8ce269bcf7cfa759425501c
parent0d08746572966081e4ee141bcf3edb1931b68610
parenta24d3558bf3704cebf2006e46500264bbba7ff9b
Merge branch 'sctp-=security-hook-fixes'

Xin Long says:

====================
security: fixups for the security hooks in sctp

There are a couple of problems in the currect security hooks in sctp:

1. The hooks incorrectly treat sctp_endpoint in SCTP as request_sock in
   TCP, while it's in fact no more than an extension of the sock, and
   represents the local host. It is created when sock is created, not
   when a conn request comes. sctp_association is actually the correct
   one to represent the connection, and created when a conn request
   arrives.

2. security_sctp_assoc_request() hook should also be called in processing
   COOKIE ECHO, as that's the place where the real assoc is created and
   used in the future.

The problems above may cause accept sk, peeloff sk or client sk having
the incorrect security labels.

So this patchset is to change some hooks and pass asoc into them and save
these secids into asoc, as well as add the missing sctp_assoc_request
hook into the COOKIE ECHO processing.

v1->v2:
  - See each patch, and thanks the help from Ondrej, Paul and Richard.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>