APPLIED (hirsute/5.11): [PATCH][HIRSUTE][RESEND] UBUNTU: SAUCE: apparmor: Fix build error, make sk parameter const

Andrea Righi andrea.righi at canonical.com
Mon Mar 29 11:22:43 UTC 2021


Applied to hirsute/5.11.

Thanks,
-Andrea

On Mon, Mar 29, 2021 at 10:26:15AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> 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 at canonical.com>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski at canonical.com>
> ---
> 
> V2: Add [HIRSUTE] in $SUBJECT
> 
> ---
>  security/apparmor/net.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/security/apparmor/net.c b/security/apparmor/net.c
> index 297589c6dc95..01e2c6c89b22 100644
> --- a/security/apparmor/net.c
> +++ b/security/apparmor/net.c
> @@ -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)
> -- 
> 2.30.2
> 
> 
> -- 
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team



More information about the kernel-team mailing list