linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: lsm: Refactor `flags_overset_lsm_set_self_attr` test
@ 2024-11-12 18:28 Amit Vadhavana
  2024-11-12 18:45 ` Casey Schaufler
  2024-11-14 16:25 ` Shuah Khan
  0 siblings, 2 replies; 9+ messages in thread
From: Amit Vadhavana @ 2024-11-12 18:28 UTC (permalink / raw)
  To: paul, jmorris, serge, casey, shuah
  Cc: ricardo, av2082000, skhan, linux-kernel-mentees,
	linux-security-module, linux-kselftest, linux-kernel

- Remove unnecessary `tctx` variable, use `ctx` directly.
- Simplified code with no functional changes.

Signed-off-by: Amit Vadhavana <av2082000@gmail.com>
---
 tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
index 66dec47e3ca3..732e89fe99c0 100644
--- a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
+++ b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
@@ -56,16 +56,15 @@ TEST(flags_zero_lsm_set_self_attr)
 TEST(flags_overset_lsm_set_self_attr)
 {
 	const long page_size = sysconf(_SC_PAGESIZE);
-	char *ctx = calloc(page_size, 1);
+	struct lsm_ctx *ctx = calloc(page_size, 1);
 	__u32 size = page_size;
-	struct lsm_ctx *tctx = (struct lsm_ctx *)ctx;
 
 	ASSERT_NE(NULL, ctx);
 	if (attr_lsm_count()) {
-		ASSERT_LE(1, lsm_get_self_attr(LSM_ATTR_CURRENT, tctx, &size,
+		ASSERT_LE(1, lsm_get_self_attr(LSM_ATTR_CURRENT, ctx, &size,
 					       0));
 	}
-	ASSERT_EQ(-1, lsm_set_self_attr(LSM_ATTR_CURRENT | LSM_ATTR_PREV, tctx,
+	ASSERT_EQ(-1, lsm_set_self_attr(LSM_ATTR_CURRENT | LSM_ATTR_PREV, ctx,
 					size, 0));
 
 	free(ctx);
-- 
2.25.1


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

* Re: [PATCH] selftests: lsm: Refactor `flags_overset_lsm_set_self_attr` test
  2024-11-12 18:28 [PATCH] selftests: lsm: Refactor `flags_overset_lsm_set_self_attr` test Amit Vadhavana
@ 2024-11-12 18:45 ` Casey Schaufler
  2024-11-14 16:25 ` Shuah Khan
  1 sibling, 0 replies; 9+ messages in thread
From: Casey Schaufler @ 2024-11-12 18:45 UTC (permalink / raw)
  To: Amit Vadhavana, paul, jmorris, serge, shuah
  Cc: ricardo, skhan, linux-kernel-mentees, linux-security-module,
	linux-kselftest, linux-kernel, Casey Schaufler

On 11/12/2024 10:28 AM, Amit Vadhavana wrote:
> - Remove unnecessary `tctx` variable, use `ctx` directly.
> - Simplified code with no functional changes.
>
> Signed-off-by: Amit Vadhavana <av2082000@gmail.com>

Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>

> ---
>  tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
> index 66dec47e3ca3..732e89fe99c0 100644
> --- a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
> +++ b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
> @@ -56,16 +56,15 @@ TEST(flags_zero_lsm_set_self_attr)
>  TEST(flags_overset_lsm_set_self_attr)
>  {
>  	const long page_size = sysconf(_SC_PAGESIZE);
> -	char *ctx = calloc(page_size, 1);
> +	struct lsm_ctx *ctx = calloc(page_size, 1);
>  	__u32 size = page_size;
> -	struct lsm_ctx *tctx = (struct lsm_ctx *)ctx;
>  
>  	ASSERT_NE(NULL, ctx);
>  	if (attr_lsm_count()) {
> -		ASSERT_LE(1, lsm_get_self_attr(LSM_ATTR_CURRENT, tctx, &size,
> +		ASSERT_LE(1, lsm_get_self_attr(LSM_ATTR_CURRENT, ctx, &size,
>  					       0));
>  	}
> -	ASSERT_EQ(-1, lsm_set_self_attr(LSM_ATTR_CURRENT | LSM_ATTR_PREV, tctx,
> +	ASSERT_EQ(-1, lsm_set_self_attr(LSM_ATTR_CURRENT | LSM_ATTR_PREV, ctx,
>  					size, 0));
>  
>  	free(ctx);

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

* Re: [PATCH] selftests: lsm: Refactor `flags_overset_lsm_set_self_attr` test
  2024-11-12 18:28 [PATCH] selftests: lsm: Refactor `flags_overset_lsm_set_self_attr` test Amit Vadhavana
  2024-11-12 18:45 ` Casey Schaufler
@ 2024-11-14 16:25 ` Shuah Khan
  2024-11-14 16:55   ` Casey Schaufler
  2024-11-27  3:38   ` Paul Moore
  1 sibling, 2 replies; 9+ messages in thread
From: Shuah Khan @ 2024-11-14 16:25 UTC (permalink / raw)
  To: Amit Vadhavana, paul, jmorris, serge, casey, shuah
  Cc: ricardo, linux-kernel-mentees, linux-security-module,
	linux-kselftest, linux-kernel, Shuah Khan

On 11/12/24 11:28, Amit Vadhavana wrote:
> - Remove unnecessary `tctx` variable, use `ctx` directly.
> - Simplified code with no functional changes.
> 

I would rephrase the short to simply say Remove unused variable,
as refactor implies more extensive changes than what this patch
is actually doing.

Please write complete sentences instead of bullet points in the
change log.

How did you find this problem? Do include the details on how
in the change log.

> Signed-off-by: Amit Vadhavana <av2082000@gmail.com>
> ---
>   tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
> index 66dec47e3ca3..732e89fe99c0 100644
> --- a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
> +++ b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
> @@ -56,16 +56,15 @@ TEST(flags_zero_lsm_set_self_attr)
>   TEST(flags_overset_lsm_set_self_attr)
>   {
>   	const long page_size = sysconf(_SC_PAGESIZE);
> -	char *ctx = calloc(page_size, 1);
> +	struct lsm_ctx *ctx = calloc(page_size, 1);

Why not name this tctx and avoid changes to the ASSERT_EQs
below?

>   	__u32 size = page_size;
> -	struct lsm_ctx *tctx = (struct lsm_ctx *)ctx;
>   
>   	ASSERT_NE(NULL, ctx);
>   	if (attr_lsm_count()) {
> -		ASSERT_LE(1, lsm_get_self_attr(LSM_ATTR_CURRENT, tctx, &size,
> +		ASSERT_LE(1, lsm_get_self_attr(LSM_ATTR_CURRENT, ctx, &size,
>   					       0));
>   	}
> -	ASSERT_EQ(-1, lsm_set_self_attr(LSM_ATTR_CURRENT | LSM_ATTR_PREV, tctx,
> +	ASSERT_EQ(-1, lsm_set_self_attr(LSM_ATTR_CURRENT | LSM_ATTR_PREV, ctx,
>   					size, 0));
>   
>   	free(ctx);

You have to change this tctx for sure.

With these changes:

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>

Paul, James,

Please do let me know if you would me to take this through
kselftest tree.

thanks,
-- Shuah



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

* Re: [PATCH] selftests: lsm: Refactor `flags_overset_lsm_set_self_attr` test
  2024-11-14 16:25 ` Shuah Khan
@ 2024-11-14 16:55   ` Casey Schaufler
  2024-11-14 17:08     ` Shuah Khan
  2024-11-27  3:38   ` Paul Moore
  1 sibling, 1 reply; 9+ messages in thread
From: Casey Schaufler @ 2024-11-14 16:55 UTC (permalink / raw)
  To: Shuah Khan, Amit Vadhavana, paul, jmorris, serge, shuah
  Cc: ricardo, linux-kernel-mentees, linux-security-module,
	linux-kselftest, linux-kernel, Casey Schaufler


On 11/14/2024 8:25 AM, Shuah Khan wrote:
> On 11/12/24 11:28, Amit Vadhavana wrote:
>> - Remove unnecessary `tctx` variable, use `ctx` directly.
>> - Simplified code with no functional changes.
>>
>
> I would rephrase the short to simply say Remove unused variable,
> as refactor implies more extensive changes than what this patch
> is actually doing.
>
> Please write complete sentences instead of bullet points in the
> change log.
>
> How did you find this problem? Do include the details on how
> in the change log.
>
>> Signed-off-by: Amit Vadhavana <av2082000@gmail.com>
>> ---
>>   tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 7 +++----
>>   1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
>> b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
>> index 66dec47e3ca3..732e89fe99c0 100644
>> --- a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
>> +++ b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
>> @@ -56,16 +56,15 @@ TEST(flags_zero_lsm_set_self_attr)
>>   TEST(flags_overset_lsm_set_self_attr)
>>   {
>>       const long page_size = sysconf(_SC_PAGESIZE);
>> -    char *ctx = calloc(page_size, 1);
>> +    struct lsm_ctx *ctx = calloc(page_size, 1);
>
> Why not name this tctx and avoid changes to the ASSERT_EQs
> below?

In the realm of linux security modules ctx is short for "context".
I used tctx here because I was lazy. It would be much better to
drop tctx, even if it means a tiny bit more change.

>
>>       __u32 size = page_size;
>> -    struct lsm_ctx *tctx = (struct lsm_ctx *)ctx;
>>         ASSERT_NE(NULL, ctx);
>>       if (attr_lsm_count()) {
>> -        ASSERT_LE(1, lsm_get_self_attr(LSM_ATTR_CURRENT, tctx, &size,
>> +        ASSERT_LE(1, lsm_get_self_attr(LSM_ATTR_CURRENT, ctx, &size,
>>                              0));
>>       }
>> -    ASSERT_EQ(-1, lsm_set_self_attr(LSM_ATTR_CURRENT |
>> LSM_ATTR_PREV, tctx,
>> +    ASSERT_EQ(-1, lsm_set_self_attr(LSM_ATTR_CURRENT |
>> LSM_ATTR_PREV, ctx,
>>                       size, 0));
>>         free(ctx);
>
> You have to change this tctx for sure.
>
> With these changes:
>
> Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
>
> Paul, James,
>
> Please do let me know if you would me to take this through
> kselftest tree.
>
> thanks,
> -- Shuah
>
>

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

* Re: [PATCH] selftests: lsm: Refactor `flags_overset_lsm_set_self_attr` test
  2024-11-14 16:55   ` Casey Schaufler
@ 2024-11-14 17:08     ` Shuah Khan
  2024-11-16 15:25       ` Amit
  0 siblings, 1 reply; 9+ messages in thread
From: Shuah Khan @ 2024-11-14 17:08 UTC (permalink / raw)
  To: Casey Schaufler, Amit Vadhavana, paul, jmorris, serge, shuah
  Cc: ricardo, linux-kernel-mentees, linux-security-module,
	linux-kselftest, linux-kernel, Shuah Khan

On 11/14/24 09:55, Casey Schaufler wrote:
> 
> On 11/14/2024 8:25 AM, Shuah Khan wrote:
>> On 11/12/24 11:28, Amit Vadhavana wrote:
>>> - Remove unnecessary `tctx` variable, use `ctx` directly.
>>> - Simplified code with no functional changes.
>>>
>>
>> I would rephrase the short to simply say Remove unused variable,
>> as refactor implies more extensive changes than what this patch
>> is actually doing.
>>
>> Please write complete sentences instead of bullet points in the
>> change log.
>>
>> How did you find this problem? Do include the details on how
>> in the change log.
>>
>>> Signed-off-by: Amit Vadhavana <av2082000@gmail.com>
>>> ---
>>>    tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 7 +++----
>>>    1 file changed, 3 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
>>> b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
>>> index 66dec47e3ca3..732e89fe99c0 100644
>>> --- a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
>>> +++ b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
>>> @@ -56,16 +56,15 @@ TEST(flags_zero_lsm_set_self_attr)
>>>    TEST(flags_overset_lsm_set_self_attr)
>>>    {
>>>        const long page_size = sysconf(_SC_PAGESIZE);
>>> -    char *ctx = calloc(page_size, 1);
>>> +    struct lsm_ctx *ctx = calloc(page_size, 1);
>>
>> Why not name this tctx and avoid changes to the ASSERT_EQs
>> below?
> 
> In the realm of linux security modules ctx is short for "context".
> I used tctx here because I was lazy. It would be much better to
> drop tctx, even if it means a tiny bit more change.
> 

Makes sense.

Amit, you can ignore this comment about tctx and ctx. Please do fix
others about the change log and short log.

thanks,
-- Shuah


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

* Re: [PATCH] selftests: lsm: Refactor `flags_overset_lsm_set_self_attr` test
  2024-11-14 17:08     ` Shuah Khan
@ 2024-11-16 15:25       ` Amit
  0 siblings, 0 replies; 9+ messages in thread
From: Amit @ 2024-11-16 15:25 UTC (permalink / raw)
  To: Shuah Khan, Casey Schaufler, paul, jmorris, serge, shuah
  Cc: ricardo, linux-kernel-mentees, linux-security-module,
	linux-kselftest, linux-kernel

On 14/11/24 10:38 pm, Shuah Khan wrote:
> On 11/14/24 09:55, Casey Schaufler wrote:
>>
>> On 11/14/2024 8:25 AM, Shuah Khan wrote:
>>> On 11/12/24 11:28, Amit Vadhavana wrote:
>>>> - Remove unnecessary `tctx` variable, use `ctx` directly.
>>>> - Simplified code with no functional changes.
>>>>
>>>
>>> I would rephrase the short to simply say Remove unused variable,
>>> as refactor implies more extensive changes than what this patch
>>> is actually doing.
>>>
>>> Please write complete sentences instead of bullet points in the
>>> change log.
V2: https://lore.kernel.org/all/20241116152136.10635-1-av2082000@gmail.com/
>>> >>> How did you find this problem? Do include the details on how
>>> in the change log.
While exploring the kselftest framework. I found the this problem.
>>>
>>>> Signed-off-by: Amit Vadhavana <av2082000@gmail.com>
>>>> ---
>>>>    tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 7 +++----
>>>>    1 file changed, 3 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
>>>> b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
>>>> index 66dec47e3ca3..732e89fe99c0 100644
>>>> --- a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
>>>> +++ b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
>>>> @@ -56,16 +56,15 @@ TEST(flags_zero_lsm_set_self_attr)
>>>>    TEST(flags_overset_lsm_set_self_attr)
>>>>    {
>>>>        const long page_size = sysconf(_SC_PAGESIZE);
>>>> -    char *ctx = calloc(page_size, 1);
>>>> +    struct lsm_ctx *ctx = calloc(page_size, 1);
>>>
>>> Why not name this tctx and avoid changes to the ASSERT_EQs
>>> below?
>>
>> In the realm of linux security modules ctx is short for "context".
>> I used tctx here because I was lazy. It would be much better to
>> drop tctx, even if it means a tiny bit more change.
>>
> 
> Makes sense.
> 
> Amit, you can ignore this comment about tctx and ctx. Please do fix
> others about the change log and short log.
> 
> thanks,
> -- Shuah
> 

-- 
Thanks,
Amit V.

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

* Re: [PATCH] selftests: lsm: Refactor `flags_overset_lsm_set_self_attr` test
  2024-11-14 16:25 ` Shuah Khan
  2024-11-14 16:55   ` Casey Schaufler
@ 2024-11-27  3:38   ` Paul Moore
  2024-12-04  0:00     ` Shuah Khan
  1 sibling, 1 reply; 9+ messages in thread
From: Paul Moore @ 2024-11-27  3:38 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Amit Vadhavana, jmorris, serge, casey, shuah, ricardo,
	linux-kernel-mentees, linux-security-module, linux-kselftest,
	linux-kernel

On Thu, Nov 14, 2024 at 11:25 AM Shuah Khan <skhan@linuxfoundation.org> wrote:
> On 11/12/24 11:28, Amit Vadhavana wrote:
> > - Remove unnecessary `tctx` variable, use `ctx` directly.
> > - Simplified code with no functional changes.
> >
>
> I would rephrase the short to simply say Remove unused variable,
> as refactor implies more extensive changes than what this patch
> is actually doing.
>
> Please write complete sentences instead of bullet points in the
> change log.
>
> How did you find this problem? Do include the details on how
> in the change log.
>
> > Signed-off-by: Amit Vadhavana <av2082000@gmail.com>
> > ---
> >   tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 7 +++----
> >   1 file changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
> > index 66dec47e3ca3..732e89fe99c0 100644
> > --- a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
> > +++ b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
> > @@ -56,16 +56,15 @@ TEST(flags_zero_lsm_set_self_attr)
> >   TEST(flags_overset_lsm_set_self_attr)
> >   {
> >       const long page_size = sysconf(_SC_PAGESIZE);
> > -     char *ctx = calloc(page_size, 1);
> > +     struct lsm_ctx *ctx = calloc(page_size, 1);
>
> Why not name this tctx and avoid changes to the ASSERT_EQs
> below?
>
> >       __u32 size = page_size;
> > -     struct lsm_ctx *tctx = (struct lsm_ctx *)ctx;
> >
> >       ASSERT_NE(NULL, ctx);
> >       if (attr_lsm_count()) {
> > -             ASSERT_LE(1, lsm_get_self_attr(LSM_ATTR_CURRENT, tctx, &size,
> > +             ASSERT_LE(1, lsm_get_self_attr(LSM_ATTR_CURRENT, ctx, &size,
> >                                              0));
> >       }
> > -     ASSERT_EQ(-1, lsm_set_self_attr(LSM_ATTR_CURRENT | LSM_ATTR_PREV, tctx,
> > +     ASSERT_EQ(-1, lsm_set_self_attr(LSM_ATTR_CURRENT | LSM_ATTR_PREV, ctx,
> >                                       size, 0));
> >
> >       free(ctx);
>
> You have to change this tctx for sure.
>
> With these changes:
>
> Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
>
> Paul, James,
>
> Please do let me know if you would me to take this through
> kselftest tree.

Amit has already posted a v2 with the requested changes, but I wanted
to get back to you on this even if this patch is outdated ... Shuah,
what is your preference for things like this?  My general policy is
that patches only affecting one subsystem tree should be taken by the
associated subsystem to minimize merge headaches and other ugliness,
however, the kselftest is an interesting subsystem in that it relies
so heavily on others that I'm not sure my policy makes as much sense
here :)

-- 
paul-moore.com

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

* Re: [PATCH] selftests: lsm: Refactor `flags_overset_lsm_set_self_attr` test
  2024-11-27  3:38   ` Paul Moore
@ 2024-12-04  0:00     ` Shuah Khan
  2024-12-04  3:45       ` Paul Moore
  0 siblings, 1 reply; 9+ messages in thread
From: Shuah Khan @ 2024-12-04  0:00 UTC (permalink / raw)
  To: Paul Moore
  Cc: Amit Vadhavana, jmorris, serge, casey, shuah, ricardo,
	linux-kernel-mentees, linux-security-module, linux-kselftest,
	linux-kernel, Shuah Khan

On 11/26/24 20:38, Paul Moore wrote:
> On Thu, Nov 14, 2024 at 11:25 AM Shuah Khan <skhan@linuxfoundation.org> wrote:
>> On 11/12/24 11:28, Amit Vadhavana wrote:
>>> - Remove unnecessary `tctx` variable, use `ctx` directly.
>>> - Simplified code with no functional changes.
>>>
>>
>> I would rephrase the short to simply say Remove unused variable,
>> as refactor implies more extensive changes than what this patch
>> is actually doing.
>>
>> Please write complete sentences instead of bullet points in the
>> change log.
>>
>> How did you find this problem? Do include the details on how
>> in the change log.
>>
>>> Signed-off-by: Amit Vadhavana <av2082000@gmail.com>
>>> ---
>>>    tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 7 +++----
>>>    1 file changed, 3 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
>>> index 66dec47e3ca3..732e89fe99c0 100644
>>> --- a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
>>> +++ b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
>>> @@ -56,16 +56,15 @@ TEST(flags_zero_lsm_set_self_attr)
>>>    TEST(flags_overset_lsm_set_self_attr)
>>>    {
>>>        const long page_size = sysconf(_SC_PAGESIZE);
>>> -     char *ctx = calloc(page_size, 1);
>>> +     struct lsm_ctx *ctx = calloc(page_size, 1);
>>
>> Why not name this tctx and avoid changes to the ASSERT_EQs
>> below?
>>
>>>        __u32 size = page_size;
>>> -     struct lsm_ctx *tctx = (struct lsm_ctx *)ctx;
>>>
>>>        ASSERT_NE(NULL, ctx);
>>>        if (attr_lsm_count()) {
>>> -             ASSERT_LE(1, lsm_get_self_attr(LSM_ATTR_CURRENT, tctx, &size,
>>> +             ASSERT_LE(1, lsm_get_self_attr(LSM_ATTR_CURRENT, ctx, &size,
>>>                                               0));
>>>        }
>>> -     ASSERT_EQ(-1, lsm_set_self_attr(LSM_ATTR_CURRENT | LSM_ATTR_PREV, tctx,
>>> +     ASSERT_EQ(-1, lsm_set_self_attr(LSM_ATTR_CURRENT | LSM_ATTR_PREV, ctx,
>>>                                        size, 0));
>>>
>>>        free(ctx);
>>
>> You have to change this tctx for sure.
>>
>> With these changes:
>>
>> Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
>>
>> Paul, James,
>>
>> Please do let me know if you would me to take this through
>> kselftest tree.
> 
> Amit has already posted a v2 with the requested changes, but I wanted
> to get back to you on this even if this patch is outdated ... Shuah,
> what is your preference for things like this?  My general policy is
> that patches only affecting one subsystem tree should be taken by the
> associated subsystem to minimize merge headaches and other ugliness,
> however, the kselftest is an interesting subsystem in that it relies
> so heavily on others that I'm not sure my policy makes as much sense
> here :)
> 

kselftest patches usually go through subsystem trees because of the
merge problems you mentioned. I take them through kselftest tree
if subsystem maintainers want me to. Some do and I pick them up.

I pick up patches if I don't see response from subsystem maintainers.

thanks,
-- Shuah

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

* Re: [PATCH] selftests: lsm: Refactor `flags_overset_lsm_set_self_attr` test
  2024-12-04  0:00     ` Shuah Khan
@ 2024-12-04  3:45       ` Paul Moore
  0 siblings, 0 replies; 9+ messages in thread
From: Paul Moore @ 2024-12-04  3:45 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Amit Vadhavana, jmorris, serge, casey, shuah, ricardo,
	linux-kernel-mentees, linux-security-module, linux-kselftest,
	linux-kernel

On Tue, Dec 3, 2024 at 7:00 PM Shuah Khan <skhan@linuxfoundation.org> wrote:
>
> kselftest patches usually go through subsystem trees because of the
> merge problems you mentioned. I take them through kselftest tree
> if subsystem maintainers want me to. Some do and I pick them up.
>
> I pick up patches if I don't see response from subsystem maintainers.

Thanks for the clarification.

-- 
paul-moore.com

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

end of thread, other threads:[~2024-12-04  3:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-12 18:28 [PATCH] selftests: lsm: Refactor `flags_overset_lsm_set_self_attr` test Amit Vadhavana
2024-11-12 18:45 ` Casey Schaufler
2024-11-14 16:25 ` Shuah Khan
2024-11-14 16:55   ` Casey Schaufler
2024-11-14 17:08     ` Shuah Khan
2024-11-16 15:25       ` Amit
2024-11-27  3:38   ` Paul Moore
2024-12-04  0:00     ` Shuah Khan
2024-12-04  3:45       ` Paul Moore

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).