All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] apparmor: remove redundant pointer 'info'
@ 2018-07-14 16:19 ` Colin King
  0 siblings, 0 replies; 9+ messages in thread
From: Colin King @ 2018-07-14 16:19 UTC (permalink / raw)
  To: John Johansen, James Morris, Serge E . Hallyn, linux-security-module
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Pointer 'info' is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
warning: variable 'info' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 security/apparmor/domain.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
index 098d546d8253..410d9ce09861 100644
--- a/security/apparmor/domain.c
+++ b/security/apparmor/domain.c
@@ -1006,7 +1006,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
 					 const char *name, bool sibling)
 {
 	struct aa_profile *root, *hat = NULL;
-	const char *info = NULL;
 	int error = 0;
 
 	if (sibling && PROFILE_IS_HAT(profile)) {
@@ -1014,7 +1013,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
 	} else if (!sibling && !PROFILE_IS_HAT(profile)) {
 		root = aa_get_profile(profile);
 	} else {
-		info = "conflicting target types";
 		error = -EPERM;
 		goto audit;
 	}
@@ -1025,10 +1023,8 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
 		if (COMPLAIN_MODE(profile)) {
 			hat = aa_new_null_profile(profile, true, name,
 						  GFP_KERNEL);
-			if (!hat) {
-				info = "failed null profile create";
+			if (!hat)
 				error = -ENOMEM;
-			}
 		}
 	}
 	aa_put_profile(root);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] apparmor: remove redundant pointer 'info'
@ 2018-07-14 16:19 ` Colin King
  0 siblings, 0 replies; 9+ messages in thread
From: Colin King @ 2018-07-14 16:19 UTC (permalink / raw)
  To: linux-security-module

From: Colin Ian King <colin.king@canonical.com>

Pointer 'info' is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
warning: variable 'info' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 security/apparmor/domain.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
index 098d546d8253..410d9ce09861 100644
--- a/security/apparmor/domain.c
+++ b/security/apparmor/domain.c
@@ -1006,7 +1006,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
 					 const char *name, bool sibling)
 {
 	struct aa_profile *root, *hat = NULL;
-	const char *info = NULL;
 	int error = 0;
 
 	if (sibling && PROFILE_IS_HAT(profile)) {
@@ -1014,7 +1013,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
 	} else if (!sibling && !PROFILE_IS_HAT(profile)) {
 		root = aa_get_profile(profile);
 	} else {
-		info = "conflicting target types";
 		error = -EPERM;
 		goto audit;
 	}
@@ -1025,10 +1023,8 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
 		if (COMPLAIN_MODE(profile)) {
 			hat = aa_new_null_profile(profile, true, name,
 						  GFP_KERNEL);
-			if (!hat) {
-				info = "failed null profile create";
+			if (!hat)
 				error = -ENOMEM;
-			}
 		}
 	}
 	aa_put_profile(root);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] apparmor: remove redundant pointer 'info'
@ 2018-07-14 16:19 ` Colin King
  0 siblings, 0 replies; 9+ messages in thread
From: Colin King @ 2018-07-14 16:19 UTC (permalink / raw)
  To: linux-security-module

From: Colin Ian King <colin.king@canonical.com>

Pointer 'info' is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
warning: variable 'info' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 security/apparmor/domain.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
index 098d546d8253..410d9ce09861 100644
--- a/security/apparmor/domain.c
+++ b/security/apparmor/domain.c
@@ -1006,7 +1006,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
 					 const char *name, bool sibling)
 {
 	struct aa_profile *root, *hat = NULL;
-	const char *info = NULL;
 	int error = 0;
 
 	if (sibling && PROFILE_IS_HAT(profile)) {
@@ -1014,7 +1013,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
 	} else if (!sibling && !PROFILE_IS_HAT(profile)) {
 		root = aa_get_profile(profile);
 	} else {
-		info = "conflicting target types";
 		error = -EPERM;
 		goto audit;
 	}
@@ -1025,10 +1023,8 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
 		if (COMPLAIN_MODE(profile)) {
 			hat = aa_new_null_profile(profile, true, name,
 						  GFP_KERNEL);
-			if (!hat) {
-				info = "failed null profile create";
+			if (!hat)
 				error = -ENOMEM;
-			}
 		}
 	}
 	aa_put_profile(root);
-- 
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] apparmor: remove redundant pointer 'info'
  2018-07-14 16:19 ` Colin King
  (?)
@ 2018-07-20 10:31   ` John Johansen
  -1 siblings, 0 replies; 9+ messages in thread
From: John Johansen @ 2018-07-20 10:31 UTC (permalink / raw)
  To: Colin King, James Morris, Serge E . Hallyn, linux-security-module
  Cc: kernel-janitors, linux-kernel

On 07/14/2018 09:19 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Pointer 'info' is being assigned but is never used hence it is
> redundant and can be removed.
> 
> Cleans up clang warning:
> warning: variable 'info' set but not used [-Wunused-but-set-variable]
> 
NAK,

real problem wrong fix, instead of deleting the additional context info
we need to be auditing it

diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
index 098d546d8253..08c88de0ffda 100644
--- a/security/apparmor/domain.c
+++ b/security/apparmor/domain.c
@@ -1036,7 +1036,7 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
 audit:
 	aa_audit_file(profile, &nullperms, OP_CHANGE_HAT, AA_MAY_CHANGEHAT,
 		      name, hat ? hat->base.hname : NULL,
-		      hat ? &hat->label : NULL, GLOBAL_ROOT_UID, NULL,
+		      hat ? &hat->label : NULL, GLOBAL_ROOT_UID, info,
 		      error);
 	if (!hat || (error && error != -ENOENT))
 		return ERR_PTR(error);

I pushed this fix into apparmor-next



> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  security/apparmor/domain.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
> index 098d546d8253..410d9ce09861 100644
> --- a/security/apparmor/domain.c
> +++ b/security/apparmor/domain.c
> @@ -1006,7 +1006,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>  					 const char *name, bool sibling)
>  {
>  	struct aa_profile *root, *hat = NULL;
> -	const char *info = NULL;
>  	int error = 0;
>  
>  	if (sibling && PROFILE_IS_HAT(profile)) {
> @@ -1014,7 +1013,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>  	} else if (!sibling && !PROFILE_IS_HAT(profile)) {
>  		root = aa_get_profile(profile);
>  	} else {
> -		info = "conflicting target types";
>  		error = -EPERM;
>  		goto audit;
>  	}
> @@ -1025,10 +1023,8 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>  		if (COMPLAIN_MODE(profile)) {
>  			hat = aa_new_null_profile(profile, true, name,
>  						  GFP_KERNEL);
> -			if (!hat) {
> -				info = "failed null profile create";
> +			if (!hat)
>  				error = -ENOMEM;
> -			}
>  		}
>  	}
>  	aa_put_profile(root);
> 


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] apparmor: remove redundant pointer 'info'
@ 2018-07-20 10:31   ` John Johansen
  0 siblings, 0 replies; 9+ messages in thread
From: John Johansen @ 2018-07-20 10:31 UTC (permalink / raw)
  To: linux-security-module

On 07/14/2018 09:19 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Pointer 'info' is being assigned but is never used hence it is
> redundant and can be removed.
> 
> Cleans up clang warning:
> warning: variable 'info' set but not used [-Wunused-but-set-variable]
> 
NAK,

real problem wrong fix, instead of deleting the additional context info
we need to be auditing it

diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
index 098d546d8253..08c88de0ffda 100644
--- a/security/apparmor/domain.c
+++ b/security/apparmor/domain.c
@@ -1036,7 +1036,7 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
 audit:
 	aa_audit_file(profile, &nullperms, OP_CHANGE_HAT, AA_MAY_CHANGEHAT,
 		      name, hat ? hat->base.hname : NULL,
-		      hat ? &hat->label : NULL, GLOBAL_ROOT_UID, NULL,
+		      hat ? &hat->label : NULL, GLOBAL_ROOT_UID, info,
 		      error);
 	if (!hat || (error && error != -ENOENT))
 		return ERR_PTR(error);

I pushed this fix into apparmor-next



> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  security/apparmor/domain.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
> index 098d546d8253..410d9ce09861 100644
> --- a/security/apparmor/domain.c
> +++ b/security/apparmor/domain.c
> @@ -1006,7 +1006,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>  					 const char *name, bool sibling)
>  {
>  	struct aa_profile *root, *hat = NULL;
> -	const char *info = NULL;
>  	int error = 0;
>  
>  	if (sibling && PROFILE_IS_HAT(profile)) {
> @@ -1014,7 +1013,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>  	} else if (!sibling && !PROFILE_IS_HAT(profile)) {
>  		root = aa_get_profile(profile);
>  	} else {
> -		info = "conflicting target types";
>  		error = -EPERM;
>  		goto audit;
>  	}
> @@ -1025,10 +1023,8 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>  		if (COMPLAIN_MODE(profile)) {
>  			hat = aa_new_null_profile(profile, true, name,
>  						  GFP_KERNEL);
> -			if (!hat) {
> -				info = "failed null profile create";
> +			if (!hat)
>  				error = -ENOMEM;
> -			}
>  		}
>  	}
>  	aa_put_profile(root);
> 


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] apparmor: remove redundant pointer 'info'
@ 2018-07-20 10:31   ` John Johansen
  0 siblings, 0 replies; 9+ messages in thread
From: John Johansen @ 2018-07-20 10:31 UTC (permalink / raw)
  To: linux-security-module

On 07/14/2018 09:19 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Pointer 'info' is being assigned but is never used hence it is
> redundant and can be removed.
> 
> Cleans up clang warning:
> warning: variable 'info' set but not used [-Wunused-but-set-variable]
> 
NAK,

real problem wrong fix, instead of deleting the additional context info
we need to be auditing it

diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
index 098d546d8253..08c88de0ffda 100644
--- a/security/apparmor/domain.c
+++ b/security/apparmor/domain.c
@@ -1036,7 +1036,7 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
 audit:
 	aa_audit_file(profile, &nullperms, OP_CHANGE_HAT, AA_MAY_CHANGEHAT,
 		      name, hat ? hat->base.hname : NULL,
-		      hat ? &hat->label : NULL, GLOBAL_ROOT_UID, NULL,
+		      hat ? &hat->label : NULL, GLOBAL_ROOT_UID, info,
 		      error);
 	if (!hat || (error && error != -ENOENT))
 		return ERR_PTR(error);

I pushed this fix into apparmor-next



> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  security/apparmor/domain.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
> index 098d546d8253..410d9ce09861 100644
> --- a/security/apparmor/domain.c
> +++ b/security/apparmor/domain.c
> @@ -1006,7 +1006,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>  					 const char *name, bool sibling)
>  {
>  	struct aa_profile *root, *hat = NULL;
> -	const char *info = NULL;
>  	int error = 0;
>  
>  	if (sibling && PROFILE_IS_HAT(profile)) {
> @@ -1014,7 +1013,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>  	} else if (!sibling && !PROFILE_IS_HAT(profile)) {
>  		root = aa_get_profile(profile);
>  	} else {
> -		info = "conflicting target types";
>  		error = -EPERM;
>  		goto audit;
>  	}
> @@ -1025,10 +1023,8 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>  		if (COMPLAIN_MODE(profile)) {
>  			hat = aa_new_null_profile(profile, true, name,
>  						  GFP_KERNEL);
> -			if (!hat) {
> -				info = "failed null profile create";
> +			if (!hat)
>  				error = -ENOMEM;
> -			}
>  		}
>  	}
>  	aa_put_profile(root);
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] apparmor: remove redundant pointer 'info'
  2018-07-20 10:31   ` John Johansen
  (?)
@ 2018-07-20 10:57     ` Colin Ian King
  -1 siblings, 0 replies; 9+ messages in thread
From: Colin Ian King @ 2018-07-20 10:57 UTC (permalink / raw)
  To: John Johansen, James Morris, Serge E . Hallyn, linux-security-module
  Cc: kernel-janitors, linux-kernel

On 20/07/18 11:31, John Johansen wrote:
> On 07/14/2018 09:19 AM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Pointer 'info' is being assigned but is never used hence it is
>> redundant and can be removed.
>>
>> Cleans up clang warning:
>> warning: variable 'info' set but not used [-Wunused-but-set-variable]
>>
> NAK,
> 
> real problem wrong fix, instead of deleting the additional context info
> we need to be auditing it

Ah, thanks for fixing that.

Colin

> 
> diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
> index 098d546d8253..08c88de0ffda 100644
> --- a/security/apparmor/domain.c
> +++ b/security/apparmor/domain.c
> @@ -1036,7 +1036,7 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>  audit:
>  	aa_audit_file(profile, &nullperms, OP_CHANGE_HAT, AA_MAY_CHANGEHAT,
>  		      name, hat ? hat->base.hname : NULL,
> -		      hat ? &hat->label : NULL, GLOBAL_ROOT_UID, NULL,
> +		      hat ? &hat->label : NULL, GLOBAL_ROOT_UID, info,
>  		      error);
>  	if (!hat || (error && error != -ENOENT))
>  		return ERR_PTR(error);
> 
> I pushed this fix into apparmor-next
> 
> 
> 
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>  security/apparmor/domain.c | 6 +-----
>>  1 file changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
>> index 098d546d8253..410d9ce09861 100644
>> --- a/security/apparmor/domain.c
>> +++ b/security/apparmor/domain.c
>> @@ -1006,7 +1006,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>>  					 const char *name, bool sibling)
>>  {
>>  	struct aa_profile *root, *hat = NULL;
>> -	const char *info = NULL;
>>  	int error = 0;
>>  
>>  	if (sibling && PROFILE_IS_HAT(profile)) {
>> @@ -1014,7 +1013,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>>  	} else if (!sibling && !PROFILE_IS_HAT(profile)) {
>>  		root = aa_get_profile(profile);
>>  	} else {
>> -		info = "conflicting target types";
>>  		error = -EPERM;
>>  		goto audit;
>>  	}
>> @@ -1025,10 +1023,8 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>>  		if (COMPLAIN_MODE(profile)) {
>>  			hat = aa_new_null_profile(profile, true, name,
>>  						  GFP_KERNEL);
>> -			if (!hat) {
>> -				info = "failed null profile create";
>> +			if (!hat)
>>  				error = -ENOMEM;
>> -			}
>>  		}
>>  	}
>>  	aa_put_profile(root);
>>
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] apparmor: remove redundant pointer 'info'
@ 2018-07-20 10:57     ` Colin Ian King
  0 siblings, 0 replies; 9+ messages in thread
From: Colin Ian King @ 2018-07-20 10:57 UTC (permalink / raw)
  To: linux-security-module

On 20/07/18 11:31, John Johansen wrote:
> On 07/14/2018 09:19 AM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Pointer 'info' is being assigned but is never used hence it is
>> redundant and can be removed.
>>
>> Cleans up clang warning:
>> warning: variable 'info' set but not used [-Wunused-but-set-variable]
>>
> NAK,
> 
> real problem wrong fix, instead of deleting the additional context info
> we need to be auditing it

Ah, thanks for fixing that.

Colin

> 
> diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
> index 098d546d8253..08c88de0ffda 100644
> --- a/security/apparmor/domain.c
> +++ b/security/apparmor/domain.c
> @@ -1036,7 +1036,7 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>  audit:
>  	aa_audit_file(profile, &nullperms, OP_CHANGE_HAT, AA_MAY_CHANGEHAT,
>  		      name, hat ? hat->base.hname : NULL,
> -		      hat ? &hat->label : NULL, GLOBAL_ROOT_UID, NULL,
> +		      hat ? &hat->label : NULL, GLOBAL_ROOT_UID, info,
>  		      error);
>  	if (!hat || (error && error != -ENOENT))
>  		return ERR_PTR(error);
> 
> I pushed this fix into apparmor-next
> 
> 
> 
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>  security/apparmor/domain.c | 6 +-----
>>  1 file changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
>> index 098d546d8253..410d9ce09861 100644
>> --- a/security/apparmor/domain.c
>> +++ b/security/apparmor/domain.c
>> @@ -1006,7 +1006,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>>  					 const char *name, bool sibling)
>>  {
>>  	struct aa_profile *root, *hat = NULL;
>> -	const char *info = NULL;
>>  	int error = 0;
>>  
>>  	if (sibling && PROFILE_IS_HAT(profile)) {
>> @@ -1014,7 +1013,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>>  	} else if (!sibling && !PROFILE_IS_HAT(profile)) {
>>  		root = aa_get_profile(profile);
>>  	} else {
>> -		info = "conflicting target types";
>>  		error = -EPERM;
>>  		goto audit;
>>  	}
>> @@ -1025,10 +1023,8 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>>  		if (COMPLAIN_MODE(profile)) {
>>  			hat = aa_new_null_profile(profile, true, name,
>>  						  GFP_KERNEL);
>> -			if (!hat) {
>> -				info = "failed null profile create";
>> +			if (!hat)
>>  				error = -ENOMEM;
>> -			}
>>  		}
>>  	}
>>  	aa_put_profile(root);
>>
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] apparmor: remove redundant pointer 'info'
@ 2018-07-20 10:57     ` Colin Ian King
  0 siblings, 0 replies; 9+ messages in thread
From: Colin Ian King @ 2018-07-20 10:57 UTC (permalink / raw)
  To: linux-security-module

On 20/07/18 11:31, John Johansen wrote:
> On 07/14/2018 09:19 AM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Pointer 'info' is being assigned but is never used hence it is
>> redundant and can be removed.
>>
>> Cleans up clang warning:
>> warning: variable 'info' set but not used [-Wunused-but-set-variable]
>>
> NAK,
> 
> real problem wrong fix, instead of deleting the additional context info
> we need to be auditing it

Ah, thanks for fixing that.

Colin

> 
> diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
> index 098d546d8253..08c88de0ffda 100644
> --- a/security/apparmor/domain.c
> +++ b/security/apparmor/domain.c
> @@ -1036,7 +1036,7 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>  audit:
>  	aa_audit_file(profile, &nullperms, OP_CHANGE_HAT, AA_MAY_CHANGEHAT,
>  		      name, hat ? hat->base.hname : NULL,
> -		      hat ? &hat->label : NULL, GLOBAL_ROOT_UID, NULL,
> +		      hat ? &hat->label : NULL, GLOBAL_ROOT_UID, info,
>  		      error);
>  	if (!hat || (error && error != -ENOENT))
>  		return ERR_PTR(error);
> 
> I pushed this fix into apparmor-next
> 
> 
> 
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>  security/apparmor/domain.c | 6 +-----
>>  1 file changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
>> index 098d546d8253..410d9ce09861 100644
>> --- a/security/apparmor/domain.c
>> +++ b/security/apparmor/domain.c
>> @@ -1006,7 +1006,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>>  					 const char *name, bool sibling)
>>  {
>>  	struct aa_profile *root, *hat = NULL;
>> -	const char *info = NULL;
>>  	int error = 0;
>>  
>>  	if (sibling && PROFILE_IS_HAT(profile)) {
>> @@ -1014,7 +1013,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>>  	} else if (!sibling && !PROFILE_IS_HAT(profile)) {
>>  		root = aa_get_profile(profile);
>>  	} else {
>> -		info = "conflicting target types";
>>  		error = -EPERM;
>>  		goto audit;
>>  	}
>> @@ -1025,10 +1023,8 @@ static struct aa_label *build_change_hat(struct aa_profile *profile,
>>  		if (COMPLAIN_MODE(profile)) {
>>  			hat = aa_new_null_profile(profile, true, name,
>>  						  GFP_KERNEL);
>> -			if (!hat) {
>> -				info = "failed null profile create";
>> +			if (!hat)
>>  				error = -ENOMEM;
>> -			}
>>  		}
>>  	}
>>  	aa_put_profile(root);
>>
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-07-20 10:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-14 16:19 [PATCH] apparmor: remove redundant pointer 'info' Colin King
2018-07-14 16:19 ` Colin King
2018-07-14 16:19 ` Colin King
2018-07-20 10:31 ` John Johansen
2018-07-20 10:31   ` John Johansen
2018-07-20 10:31   ` John Johansen
2018-07-20 10:57   ` Colin Ian King
2018-07-20 10:57     ` Colin Ian King
2018-07-20 10:57     ` Colin Ian King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.