The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* Question about strings of string_choices.h
@ 2025-02-25  1:43 Kuninori Morimoto
  2025-02-25  3:29 ` Kees Cook
  0 siblings, 1 reply; 3+ messages in thread
From: Kuninori Morimoto @ 2025-02-25  1:43 UTC (permalink / raw)
  To: Kees Cook, Andy Shevchenko; +Cc: linux-hardening, linux-kernel


Hi Kees, Andy

I would like to use string_choices helper, and want to add well used
but not yet supported strings. But before that I would like to ask one
thing about it.

I wonder is it guaranteed that the strings were persist after the
function returned ? In normally, function local variable will disappear
when it returns from the function. But I'm not sure in case of
static inline const, etc.

If it is guaranteed, I'm very happy.

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Re: Question about strings of string_choices.h
  2025-02-25  1:43 Question about strings of string_choices.h Kuninori Morimoto
@ 2025-02-25  3:29 ` Kees Cook
  2025-02-25  3:40   ` Kuninori Morimoto
  0 siblings, 1 reply; 3+ messages in thread
From: Kees Cook @ 2025-02-25  3:29 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Andy Shevchenko, linux-hardening, linux-kernel

On Tue, Feb 25, 2025 at 01:43:55AM +0000, Kuninori Morimoto wrote:
> 
> Hi Kees, Andy
> 
> I would like to use string_choices helper, and want to add well used
> but not yet supported strings. But before that I would like to ask one
> thing about it.
> 
> I wonder is it guaranteed that the strings were persist after the
> function returned ? In normally, function local variable will disappear
> when it returns from the function. But I'm not sure in case of
> static inline const, etc.
> 
> If it is guaranteed, I'm very happy.

Yes, the compiler puts them in the .rodata section, so they will always
be present.

-Kees

-- 
Kees Cook

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

* Re: Question about strings of string_choices.h
  2025-02-25  3:29 ` Kees Cook
@ 2025-02-25  3:40   ` Kuninori Morimoto
  0 siblings, 0 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2025-02-25  3:40 UTC (permalink / raw)
  To: Kees Cook; +Cc: Andy Shevchenko, linux-hardening, linux-kernel


Hi Kees

> > I would like to use string_choices helper, and want to add well used
> > but not yet supported strings. But before that I would like to ask one
> > thing about it.
> > 
> > I wonder is it guaranteed that the strings were persist after the
> > function returned ? In normally, function local variable will disappear
> > when it returns from the function. But I'm not sure in case of
> > static inline const, etc.
> > 
> > If it is guaranteed, I'm very happy.
> 
> Yes, the compiler puts them in the .rodata section, so they will always
> be present.

Thanks. Nice to know !

Best regards
---
Kuninori Morimoto

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

end of thread, other threads:[~2025-02-25  3:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-25  1:43 Question about strings of string_choices.h Kuninori Morimoto
2025-02-25  3:29 ` Kees Cook
2025-02-25  3:40   ` Kuninori Morimoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox