]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
UBUNTU: SAUCE: apparmor: Fix build error, make sk parameter const
authorColin Ian King <colin.king@canonical.com>
Mon, 29 Mar 2021 09:26:15 +0000 (10:26 +0100)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Apr 2021 20:42:19 +0000 (15:42 -0500)
Make the sk parameter const to fix a build error with clang:

security/apparmor/net.c:143:35: error: passing 'const struct sock *' to
parameter of type 'struct sock *' discards qualifiers
[-Werror,-Wincompatible-pointer-types-discards-qualifiers]
                        audit_unix_sk_addr(ab, "addr", sa->u.net->sk);
                                                       ^~~~~~~~~~~~~
/home/ubuntu/hirsute/security/apparmor/net.c:98:24: note: passing argument
to parameter 'sk' here
                               struct sock *sk)
                                            ^

Fixes: 2775e0786896 ("UBUNTU: SAUCE: apparmor: af_unix mediation")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
security/apparmor/net.c

index e2e759b21e44131bd454c1170370b7bddab4e5f9..f379aec0f7e6cd4fa76b2c9c2c0f33eab390e01f 100644 (file)
@@ -95,7 +95,7 @@ static void audit_unix_addr(struct audit_buffer *ab, const char *str,
 }
 
 static void audit_unix_sk_addr(struct audit_buffer *ab, const char *str,
-                              struct sock *sk)
+                              const struct sock *sk)
 {
        struct unix_sock *u = unix_sk(sk);
        if (u && u->addr)