diff options
author | David S. Miller <davem@davemloft.net> | 2023-07-14 08:27:33 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-07-14 08:27:33 +0100 |
commit | f63cfa103be9b16c4491f1d58bbef3616fc61a92 (patch) | |
tree | 17b02304475d9e7bc93574f2225a68d48523c134 /security/selinux/hooks.c | |
parent | def3833fc6022c7f23bd4fd66ba5ed65c6b23272 (diff) | |
parent | dc4c399d215d76689ebadec7ed3184bcf213e2ee (diff) |
Merge branch 'sk-const'
Guillaume Nault says:
====================
net: Mark the sk parameter of routing functions as 'const'.
The sk_getsecid security hook prevents the use of a const sk pointer in
several routing functions. Since this hook should only read sk data,
make its sk argument const (patch 1), then constify the sk parameter of
various routing functions (patches 2-4).
Build-tested with make allmodconfig.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index d06e350fedee..2bdc48dd8670 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -5167,12 +5167,12 @@ static void selinux_sk_clone_security(const struct sock *sk, struct sock *newsk) selinux_netlbl_sk_security_reset(newsksec); } -static void selinux_sk_getsecid(struct sock *sk, u32 *secid) +static void selinux_sk_getsecid(const struct sock *sk, u32 *secid) { if (!sk) *secid = SECINITSID_ANY_SOCKET; else { - struct sk_security_struct *sksec = sk->sk_security; + const struct sk_security_struct *sksec = sk->sk_security; *secid = sksec->sid; } |