linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] apparmor: remove unused label
@ 2018-08-23 14:09 Arnd Bergmann
  2018-08-23 14:21 ` Kees Cook
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Arnd Bergmann @ 2018-08-23 14:09 UTC (permalink / raw)
  To: linux-security-module

After the corresponding 'goto' was removed, we get a warning
for the 'fail' label:

security/apparmor/policy_unpack.c: In function 'unpack_dfa':
security/apparmor/policy_unpack.c:426:1: error: label 'fail' defined but not used [-Werror=unused-label]

Fixes: fb5841091f28 ("apparmor: remove no-op permission check in policy_unpack")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 security/apparmor/policy_unpack.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index 3647b5834ace..96d8cf68ce65 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -423,7 +423,6 @@ static struct aa_dfa *unpack_dfa(struct aa_ext *e)
 
 	return dfa;
 
-fail:
 	aa_put_dfa(dfa);
 	return ERR_PTR(-EPROTO);
 }
-- 
2.18.0

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

* [PATCH] apparmor: remove unused label
  2018-08-23 14:09 [PATCH] apparmor: remove unused label Arnd Bergmann
@ 2018-08-23 14:21 ` Kees Cook
  2018-08-23 14:28   ` Tetsuo Handa
  2018-08-23 14:41 ` Thiago Jung Bauermann
  2018-08-23 18:21 ` John Johansen
  2 siblings, 1 reply; 6+ messages in thread
From: Kees Cook @ 2018-08-23 14:21 UTC (permalink / raw)
  To: linux-security-module

On Thu, Aug 23, 2018 at 7:09 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> After the corresponding 'goto' was removed, we get a warning
> for the 'fail' label:
>
> security/apparmor/policy_unpack.c: In function 'unpack_dfa':
> security/apparmor/policy_unpack.c:426:1: error: label 'fail' defined but not used [-Werror=unused-label]
>
> Fixes: fb5841091f28 ("apparmor: remove no-op permission check in policy_unpack")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  security/apparmor/policy_unpack.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
> index 3647b5834ace..96d8cf68ce65 100644
> --- a/security/apparmor/policy_unpack.c
> +++ b/security/apparmor/policy_unpack.c
> @@ -423,7 +423,6 @@ static struct aa_dfa *unpack_dfa(struct aa_ext *e)
>
>         return dfa;
>
> -fail:
>         aa_put_dfa(dfa);
>         return ERR_PTR(-EPROTO);
>  }
> --
> 2.18.0
>



-- 
Kees Cook
Pixel Security

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

* [PATCH] apparmor: remove unused label
  2018-08-23 14:21 ` Kees Cook
@ 2018-08-23 14:28   ` Tetsuo Handa
  0 siblings, 0 replies; 6+ messages in thread
From: Tetsuo Handa @ 2018-08-23 14:28 UTC (permalink / raw)
  To: linux-security-module

On 2018/08/23 23:21, Kees Cook wrote:
> On Thu, Aug 23, 2018 at 7:09 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>> After the corresponding 'goto' was removed, we get a warning
>> for the 'fail' label:
>>
>> security/apparmor/policy_unpack.c: In function 'unpack_dfa':
>> security/apparmor/policy_unpack.c:426:1: error: label 'fail' defined but not used [-Werror=unused-label]
>>
>> Fixes: fb5841091f28 ("apparmor: remove no-op permission check in policy_unpack")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>
> 
> -Kees
> 
>> ---
>>  security/apparmor/policy_unpack.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
>> index 3647b5834ace..96d8cf68ce65 100644
>> --- a/security/apparmor/policy_unpack.c
>> +++ b/security/apparmor/policy_unpack.c
>> @@ -423,7 +423,6 @@ static struct aa_dfa *unpack_dfa(struct aa_ext *e)
>>
>>         return dfa;
>>
>> -fail:
>>         aa_put_dfa(dfa);
>>         return ERR_PTR(-EPROTO);

If these lines are unreachable, please remove together...
And that is what Gustavo A. R. Silva reported before this patch?

>>  }
>> --
>> 2.18.0
>>
> 
> 
> 

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

* [PATCH] apparmor: remove unused label
  2018-08-23 14:09 [PATCH] apparmor: remove unused label Arnd Bergmann
  2018-08-23 14:21 ` Kees Cook
@ 2018-08-23 14:41 ` Thiago Jung Bauermann
  2018-08-23 18:21 ` John Johansen
  2 siblings, 0 replies; 6+ messages in thread
From: Thiago Jung Bauermann @ 2018-08-23 14:41 UTC (permalink / raw)
  To: linux-security-module


Arnd Bergmann <arnd@arndb.de> writes:

> After the corresponding 'goto' was removed, we get a warning
> for the 'fail' label:
>
> security/apparmor/policy_unpack.c: In function 'unpack_dfa':
> security/apparmor/policy_unpack.c:426:1: error: label 'fail' defined but not used [-Werror=unused-label]
>
> Fixes: fb5841091f28 ("apparmor: remove no-op permission check in policy_unpack")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  security/apparmor/policy_unpack.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
> index 3647b5834ace..96d8cf68ce65 100644
> --- a/security/apparmor/policy_unpack.c
> +++ b/security/apparmor/policy_unpack.c
> @@ -423,7 +423,6 @@ static struct aa_dfa *unpack_dfa(struct aa_ext *e)
>
>  	return dfa;
>
> -fail:
>  	aa_put_dfa(dfa);
>  	return ERR_PTR(-EPROTO);
>  }

Shouldn't the two lines after the label be removed as well? IIUC they're
unreachable now.

--
Thiago Jung Bauermann
IBM Linux Technology Center

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

* [PATCH] apparmor: remove unused label
  2018-08-23 14:09 [PATCH] apparmor: remove unused label Arnd Bergmann
  2018-08-23 14:21 ` Kees Cook
  2018-08-23 14:41 ` Thiago Jung Bauermann
@ 2018-08-23 18:21 ` John Johansen
  2018-08-23 21:30   ` Arnd Bergmann
  2 siblings, 1 reply; 6+ messages in thread
From: John Johansen @ 2018-08-23 18:21 UTC (permalink / raw)
  To: linux-security-module

On 08/23/2018 07:09 AM, Arnd Bergmann wrote:

thank you for the patch, but a fix for this issue was pushed to apparmor-next yesterday


> After the corresponding 'goto' was removed, we get a warning
> for the 'fail' label:
> 
> security/apparmor/policy_unpack.c: In function 'unpack_dfa':
> security/apparmor/policy_unpack.c:426:1: error: label 'fail' defined but not used [-Werror=unused-label]
> 
> Fixes: fb5841091f28 ("apparmor: remove no-op permission check in policy_unpack")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  security/apparmor/policy_unpack.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
> index 3647b5834ace..96d8cf68ce65 100644
> --- a/security/apparmor/policy_unpack.c
> +++ b/security/apparmor/policy_unpack.c
> @@ -423,7 +423,6 @@ static struct aa_dfa *unpack_dfa(struct aa_ext *e)
>  
>  	return dfa;
>  
> -fail:
>  	aa_put_dfa(dfa);
>  	return ERR_PTR(-EPROTO);
>  }
> 

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

* [PATCH] apparmor: remove unused label
  2018-08-23 18:21 ` John Johansen
@ 2018-08-23 21:30   ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2018-08-23 21:30 UTC (permalink / raw)
  To: linux-security-module

On Thu, Aug 23, 2018 at 8:21 PM John Johansen
<john.johansen@canonical.com> wrote:
>
> On 08/23/2018 07:09 AM, Arnd Bergmann wrote:
>
> thank you for the patch, but a fix for this issue was pushed to apparmor-next yesterday
>

Ok, good. As several people pointed out, my patch was also wrong, so that
saves me doing another one ;-)

     Arnd

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

end of thread, other threads:[~2018-08-23 21:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-23 14:09 [PATCH] apparmor: remove unused label Arnd Bergmann
2018-08-23 14:21 ` Kees Cook
2018-08-23 14:28   ` Tetsuo Handa
2018-08-23 14:41 ` Thiago Jung Bauermann
2018-08-23 18:21 ` John Johansen
2018-08-23 21:30   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).