linux/net/dccp
Kuniyuki Iwashima 8b3639cb78 dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses.
[ Upstream commit 23be1e0e2a ]

Initially, commit 4237c75c0a ("[MLSXFRM]: Auto-labeling of child
sockets") introduced security_inet_conn_request() in some functions
where reqsk is allocated.  The hook is added just after the allocation,
so reqsk's IPv6 remote address was not initialised then.

However, SELinux/Smack started to read it in netlbl_req_setattr()
after commit e1adea9270 ("calipso: Allow request sockets to be
relabelled by the lsm.").

Commit 284904aa79 ("lsm: Relocate the IPv4 security_inet_conn_request()
hooks") fixed that kind of issue only in TCPv4 because IPv6 labeling was
not supported at that time.  Finally, the same issue was introduced again
in IPv6.

Let's apply the same fix on DCCPv6 and TCPv6.

Fixes: e1adea9270 ("calipso: Allow request sockets to be relabelled by the lsm.")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 10:29:21 +01:00
..
ccids dccp: fix undefined behavior with 'cwnd' shift in ccid2_cwnd_restart() 2018-08-07 15:34:44 -07:00
ackvec.c net: dccp: drop unneeded newline 2018-01-02 13:49:32 -05:00
ackvec.h
ccid.c dccp: drop null test before destroy functions 2015-09-15 16:49:43 -07:00
ccid.h dccp: fool proof ccid_hc_[rt]x_parse_options() 2019-02-12 19:47:21 +01:00
dccp.h dccp: Call inet6_destroy_sock() via sk->sk_destruct(). 2023-04-26 11:21:53 +02:00
diag.c
feat.c dccp: Fix memleak in __feat_register_sp 2020-01-17 19:46:58 +01:00
feat.h
input.c tcp/dccp: fix lockdep issue when SYN is backlogged 2018-10-01 15:42:13 -07:00
ipv4.c dccp: Call security_inet_conn_request() after setting IPv4 addresses. 2023-11-20 10:29:21 +01:00
ipv6.c dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses. 2023-11-20 10:29:21 +01:00
ipv6.h
Kconfig net: dccp: Remove dccpprobe module 2018-01-02 14:27:30 -05:00
Makefile net: dccp: Remove dccpprobe module 2018-01-02 14:27:30 -05:00
minisocks.c dccp: don't duplicate ccid when cloning dccp sock 2021-09-22 11:48:11 +02:00
options.c treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
output.c dccp: fix data-race around dp->dccps_mss_cache 2023-08-16 18:13:00 +02:00
proto.c dccp: annotate data-races in dccp_poll() 2023-08-30 16:31:53 +02:00
qpolicy.c
sysctl.c
timer.c dccp: fix tasklet usage 2018-05-03 15:14:57 -04:00
trace.h net: dccp: Add DCCP sendmsg trace event 2018-01-02 14:27:30 -05:00