Skip to contentSkip to conversation

Add release hook to LSM

PATCH In review Mirsad Goran Todorovac 3 participants 9 messages Mar 10, 2023 – Apr 11, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Add release hook to LSM

Add release() hook to the definition of the LSM modules, to enable calling destructors and deallocating allocated resources cleanly.

Cc Greg Kroah-Hartman <[email protected]>
Cc Mimi Zohar <[email protected]>
Cc Paul Moore <[email protected]>
Cc Thomas Weißschuh <[email protected]>
Cc Andy Shevchenko <[email protected]>
---
 include/linux/lsm_hooks.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/lsm_hooks.h +1 -0
index 6e156d2acffc..d5a6ab9b5eb2 100644
@@ -1724,6 +1724,7 @@ struct lsm_info {
 	unsigned long flags;	/* Optional: flags describing LSM */
 	int *enabled;		/* Optional: controlled by CONFIG_LSM */
 	int (*init)(void);	/* Required. */
+	int (*release)(void);	/* Release associated resources */
 	struct lsm_blob_sizes *blobs; /* Optional: for blob sharing. */
 };
 

--
Mirsad Goran Todorovac
Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu

System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb, Republic of Croatia
The European Union

#1 lore raw
Quoted 7 lines · Mirsad Goran Todorovac

Add release() hook to the definition of the LSM modules, to enable calling destructors and deallocating allocated resources cleanly.

I haven't given you this tag. Sorry, you must not add something which was not explicitly given.

Quoted 5 lines
Cc Greg Kroah-Hartman <[email protected]>
Cc Mimi Zohar <[email protected]>
Cc Paul Moore <[email protected]>
Cc Thomas Weißschuh <[email protected]>
Cc Andy Shevchenko <[email protected]>

Use --cc parameter to git send-email.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 11 lines · Andy Shevchenko
Quoted 7 lines · Mirsad Goran Todorovac

Add release() hook to the definition of the LSM modules, to enable calling destructors and deallocating allocated resources cleanly.

I haven't given you this tag. Sorry, you must not add something which was not explicitly given.

Mea culpa.

I misunderstood that you have approved the change when saying that I should file a formal patch. It worked with Florian Westphal in my first patch, so I thought it would be inappropriate to leave out who endorsed the patch.

Thousand apologies. This is my second patch, so I am asking for some extra grace ...

What should I do now?

Regards,
Mirsad

Quoted 7 lines
Quoted 5 lines
Cc Greg Kroah-Hartman <[email protected]>
Cc Mimi Zohar <[email protected]>
Cc Paul Moore <[email protected]>
Cc Thomas Weißschuh <[email protected]>
Cc Andy Shevchenko <[email protected]>

Use --cc parameter to git send-email.

Signature · 9 lines
Mirsad Goran Todorovac
Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu
 
System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb, Republic of Croatia
The European Union
#3 lore raw
Quoted 10 lines · Mirsad Goran Todorovac
Quoted 9 lines · Andy Shevchenko
Quoted 7 lines · Mirsad Goran Todorovac

Add release() hook to the definition of the LSM modules, to enable calling destructors and deallocating allocated resources cleanly.

Quoted 8 lines
Quoted 2 lines

I haven't given you this tag. Sorry, you must not add something which was not explicitly given.

Mea culpa.

I misunderstood that you have approved the change when saying that I should file a formal patch. It worked with Florian Westphal in my first patch, so I thought it would be inappropriate to leave out who endorsed the patch.

We have Suggested-by tag for that.

Quoted 4 lines

Thousand apologies. This is my second patch, so I am asking for some extra grace ...

What should I do now?

Wait at least a couple of days (even more, since it's weekend) for other comments and then send a v2 of the series with the comments addressed.

Btw, you may take my "smart" script [1] for sending patch series. It makes much less headache on how to do that properly.

[1]: https://github.com/andy-shev/home-bin-tools/blob/master/ge2maintainer.sh

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw
Quoted 14 lines · Andy Shevchenko
Quoted 13 lines · Mirsad Goran Todorovac
Quoted 11 lines · Andy Shevchenko
Quoted 7 lines · Mirsad Goran Todorovac

Add release() hook to the definition of the LSM modules, to enable calling destructors and deallocating allocated resources cleanly.

I haven't given you this tag. Sorry, you must not add something which was not explicitly given.

Quoted 7 lines
Quoted 5 lines

Mea culpa.

I misunderstood that you have approved the change when saying that I should file a formal patch. It worked with Florian Westphal in my first patch, so I thought it would be inappropriate to leave out who endorsed the patch.

We have Suggested-by tag for that.

Yes, I think that's what is right.

I agree that it is inappropriate to add something that was not explicitly given. It's your tag and you define the rules. :-)

Quoted 7 lines
Quoted 4 lines

Thousand apologies. This is my second patch, so I am asking for some extra grace ...

What should I do now?

Wait at least a couple of days (even more, since it's weekend) for other comments and then send a v2 of the series with the comments addressed.

Will do. It is better done right than tonight.

Quoted 4 lines

Btw, you may take my "smart" script [1] for sending patch series. It makes much less headache on how to do that properly.

[1]: https://github.com/andy-shev/home-bin-tools/blob/master/ge2maintainer.sh

You should please understand that sometimes I simply block or deadlock on some very simple things. I have not yet implemented RCUs but rely on evil spinlocks :-)

Thanks again. Then I'll take a beer and chill out a bit. Perhaps sniff around if something else is left without a destructor or a release hook, too.

However, it might be too daring to go straight into the LSM area. I am strongly depending on your experience and mentoring, and yes, you define the rules for assisting your team.

I just hope I did not break the Rules of Conduct. Tried to Cc: as many maintainers as I could.

They said that every beginning is hard. But no pain, no gain :-/

Regards,
Mirsad

Signature · 9 lines
Mirsad Goran Todorovac
Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu
 
System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb, Republic of Croatia
The European Union
#5 lore raw
In reply to Andy Shevchenko
Quoted 14 lines · Andy Shevchenko
Quoted 13 lines · Mirsad Goran Todorovac
Quoted 11 lines · Andy Shevchenko
Quoted 7 lines · Mirsad Goran Todorovac

Add release() hook to the definition of the LSM modules, to enable calling destructors and deallocating allocated resources cleanly.

I haven't given you this tag. Sorry, you must not add something which was not explicitly given.

Quoted 7 lines
Quoted 5 lines

Mea culpa.

I misunderstood that you have approved the change when saying that I should file a formal patch. It worked with Florian Westphal in my first patch, so I thought it would be inappropriate to leave out who endorsed the patch.

We have Suggested-by tag for that.

Done exactly that, and now I have to reward myself for the first successful multi-part patch submission.

Quoted 7 lines
Quoted 4 lines

Thousand apologies. This is my second patch, so I am asking for some extra grace ...

What should I do now?

Wait at least a couple of days (even more, since it's weekend) for other comments and then send a v2 of the series with the comments addressed.

Actually, Mr. Paul Moore requested the rest of the patch, so I did a complete resend immediately.

Quoted 4 lines

Btw, you may take my "smart" script [1] for sending patch series. It makes much less headache on how to do that properly.

[1]: https://github.com/andy-shev/home-bin-tools/blob/master/ge2maintainer.sh

Thanks for the tip.

It's pleasure to be working with you guys, it's a great brainstorming session and I really enjoyed it. It's a privilege to assist your excellent team.

Best regards,
Mirsad

Signature · 9 lines
Mirsad Goran Todorovac
Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu
 
System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb, Republic of Croatia
The European Union
#6 lore raw
In reply to Andy Shevchenko
Quoted 11 lines · Andy Shevchenko
Quoted 7 lines · Mirsad Goran Todorovac

Add release() hook to the definition of the LSM modules, to enable calling destructors and deallocating allocated resources cleanly.

I haven't given you this tag. Sorry, you must not add something which was not explicitly given.

Hi, Andy,

This change could have long lasting consequences if approved, and I am not continuing the patch submission without your mentoring and approval.

It is true that I assumed that you have reviewed the patch, but you did not explicitly give the Reviewed-by tag.

But I am rather new to this patch submission process, and please would you please mentor me to do this the right way.

Best regards,
Mirsad

Signature · 9 lines
Mirsad Goran Todorovac
Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu
 
System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb, Republic of Croatia
The European Union
#7 lore raw
Quoted 13 lines · Mirsad Goran Todorovac
Quoted 11 lines · Andy Shevchenko
Quoted 7 lines · Mirsad Goran Todorovac

Add release() hook to the definition of the LSM modules, to enable calling destructors and deallocating allocated resources cleanly.

I haven't given you this tag. Sorry, you must not add something which was not explicitly given.

Quoted 8 lines

This change could have long lasting consequences if approved, and I am not continuing the patch submission without your mentoring and approval.

It is true that I assumed that you have reviewed the patch, but you did not explicitly give the Reviewed-by tag.

But I am rather new to this patch submission process, and please would you please mentor me to do this the right way.

We have a nice documentation for that [1]. Please, read it in full. If some questions left, do not hesitate to ask.

[1]: https://www.kernel.org/doc/html/latest/process/submitting-patches.html

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#8 lore raw
Quoted 20 lines · Andy Shevchenko
Quoted 19 lines · Mirsad Goran Todorovac
Quoted 11 lines · Andy Shevchenko
Quoted 7 lines · Mirsad Goran Todorovac

Add release() hook to the definition of the LSM modules, to enable calling destructors and deallocating allocated resources cleanly.

I haven't given you this tag. Sorry, you must not add something which was not explicitly given.

This change could have long lasting consequences if approved, and I am not continuing the patch submission without your mentoring and approval.

It is true that I assumed that you have reviewed the patch, but you did not explicitly give the Reviewed-by tag.

Quoted 7 lines
Quoted 2 lines

But I am rather new to this patch submission process, and please would you please mentor me to do this the right way.

We have a nice documentation for that [1]. Please, read it in full. If some questions left, do not hesitate to ask.

[1]: https://www.kernel.org/doc/html/latest/process/submitting-patches.html

Hi,

I am catching up on this, and now I see that my Reviewed-by: tag to the patch proposal you just suggested was way off.

I apologise once again.

I was in clear violation of the Code of Conduct, though I thought I was doing just what it was demanded.

There is beginner's luck, but there are also newbie errors.

Reviewed-by: as per patch submission instructions implies much more than I have assumed when writing it.

But they say that a fault that makes one humble is better than the success that makes him arrogant.

Thank you for taking the time from your busy schedule to instruct me to read that fine manual, which I ought to have done by myself in the first place.

Thanks again for all the mentoring on the patch submission process.

I haven't Cc:-ed the developers and maintainers not to fill their mailboxes needlessly, but it goes to the list so this is a public formal apology.

Best regards,
Mirsad

Signature · 9 lines
Mirsad Todorovac
System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb
Republic of Croatia, the European Union

Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu