Repository navigation
Commit 212cd08
selinux: fix random read in selinux_ip_postroute_compat()
In commit e446f9d ("net: synack packets can be attached to request
sockets"), I missed one remaining case of invalid skb->sk->sk_security
access.
Dmitry Vyukov got a KASan report pointing to it.
Add selinux_skb_sk() helper that is responsible to get back to the
listener if skb is attached to a request socket, instead of
duplicating the logic.
Fixes: ca6fb06 ("tcp: attach SYNACK messages to request sockets instead of listener")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Paul Moore <paul@paul-moore.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 432599d commit 212cd08
1 file changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4931 | 4931 | | |
4932 | 4932 | | |
4933 | 4933 | | |
| 4934 | + | |
| 4935 | + | |
| 4936 | + | |
| 4937 | + | |
| 4938 | + | |
| 4939 | + | |
| 4940 | + | |
| 4941 | + | |
| 4942 | + | |
| 4943 | + | |
| 4944 | + | |
| 4945 | + | |
4934 | 4946 | | |
4935 | 4947 | | |
4936 | 4948 | | |
4937 | 4949 | | |
4938 | | - | |
| 4950 | + | |
4939 | 4951 | | |
4940 | 4952 | | |
4941 | 4953 | | |
| |||
4990 | 5002 | | |
4991 | 5003 | | |
4992 | 5004 | | |
4993 | | - | |
| 5005 | + | |
4994 | 5006 | | |
4995 | 5007 | | |
4996 | 5008 | | |
| |||
5035 | 5047 | | |
5036 | 5048 | | |
5037 | 5049 | | |
5038 | | - | |
5039 | | - | |
5040 | 5050 | | |
5041 | 5051 | | |
5042 | 5052 | | |
| |||
0 commit comments