* Re: [PATCH v2 1/2] vsprintf: Only export no_hash_pointers to test module
[not found] ` <20260504135014-f477a0fe-1af6-4a85-9259-3056a13c0d1f@linutronix.de>
@ 2026-05-04 14:11 ` Andy Shevchenko
2026-05-14 11:58 ` Petr Mladek
1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2026-05-04 14:11 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Andrew Morton, Petr Mladek, Steven Rostedt, Rasmus Villemoes,
Sergey Senozhatsky, linux-kernel
On Mon, May 04, 2026 at 01:53:47PM +0200, Thomas Weißschuh wrote:
> On Mon, May 04, 2026 at 01:57:31PM +0300, Andy Shevchenko wrote:
> > On Mon, May 04, 2026 at 12:43:40PM +0200, Thomas Weißschuh wrote:
...
> > > -EXPORT_SYMBOL_GPL(no_hash_pointers);
> >
> > > +#if IS_MODULE(CONFIG_PRINTF_KUNIT_TEST)
> > > +EXPORT_SYMBOL_FOR_MODULES(no_hash_pointers, "printf_kunit");
> > > +#endif
> >
> > But do we need that ugly ifdeffery? the infrastructure should handle that.
>
> Where does the generic infrastructure take the kconfig option into account?
Nowhere, but my point that it's taken care of at run-time.
> > (Also, if I build a module separately after the kernel, it won't work.)
>
> Only if it was not enabled when the kernel was built.
>
> But if people are unhappy with the ifdeffery, I'm fine with dropping it.
> It is not a hard requirement at all.
I think it's unnecessary to have. But I'm not a maintainer of this code.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/2] vsprintf: Only export no_hash_pointers to test module
[not found] ` <20260504135014-f477a0fe-1af6-4a85-9259-3056a13c0d1f@linutronix.de>
2026-05-04 14:11 ` [PATCH v2 1/2] vsprintf: Only export no_hash_pointers to test module Andy Shevchenko
@ 2026-05-14 11:58 ` Petr Mladek
1 sibling, 0 replies; 3+ messages in thread
From: Petr Mladek @ 2026-05-14 11:58 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Andy Shevchenko, Andrew Morton, Steven Rostedt, Rasmus Villemoes,
Sergey Senozhatsky, linux-kernel
On Mon 2026-05-04 13:53:47, Thomas Weißschuh wrote:
> On Mon, May 04, 2026 at 01:57:31PM +0300, Andy Shevchenko wrote:
> > On Mon, May 04, 2026 at 12:43:40PM +0200, Thomas Weißschuh wrote:
> > > Aside from the printf test module, no module should ever use this symbol.
> >
> > ...
> >
> > > -EXPORT_SYMBOL_GPL(no_hash_pointers);
> >
> > > +#if IS_MODULE(CONFIG_PRINTF_KUNIT_TEST)
> > > +EXPORT_SYMBOL_FOR_MODULES(no_hash_pointers, "printf_kunit");
> > > +#endif
> >
> > But do we need that ugly ifdeffery? the infrastructure should handle that.
>
> Where does the generic infrastructure take the kconfig option into account?
My understanding is that it does not harm when the symbol is exported
even when the related module is built-in or not built at all. The important
thing is that it is exported only for this particular module (name).
BTW: I have just tried to remove the ifdeffery and use a built-in
printf_kunit and it works fine.
> > (Also, if I build a module separately after the kernel, it won't work.)
>
> Only if it was not enabled when the kernel was built.
>
> But if people are unhappy with the ifdeffery, I'm fine with dropping it.
> It is not a hard requirement at all.
Yeah, I would prefer to remove the ifdeffery. It does not look worth
it.
Without the ifdeffery:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Tested-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
PS: No need to send v3, I could remove the ifdeffery when pushing the patch.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 2/2] vsprintf: Add test for restricted kernel pointers
[not found] ` <afh70XpLJD0RXPJu@ashevche-desk.local>
@ 2026-05-14 13:06 ` Petr Mladek
0 siblings, 0 replies; 3+ messages in thread
From: Petr Mladek @ 2026-05-14 13:06 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Thomas Weißschuh, Andrew Morton, Steven Rostedt,
Rasmus Villemoes, Sergey Senozhatsky, linux-kernel
On Mon 2026-05-04 13:58:25, Andy Shevchenko wrote:
> On Mon, May 04, 2026 at 12:43:41PM +0200, Thomas Weißschuh wrote:
> > Fill out the tests for restricted kernel pointers, using the %pK format.
>
> ...
>
> > +#if IS_MODULE(CONFIG_PRINTF_KUNIT_TEST)
> > +EXPORT_SYMBOL_FOR_MODULES(kptr_restrict, "printf_kunit");
> > +#endif
>
> Same Q here.
Same here.
With the ifdeffs removed:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Tested-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
PS: No need to send v3. I could remove the ifdeffs when committing
the patchset. I am going to commit it tomorrow unless anyone
complains.
I am sorry for the late review and short notice before committing.
I had vacation last 5 days. And I am traveling next week.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-14 13:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260504-restricted-pointers-kunit-test-v2-0-19e8b1c0fbeb@linutronix.de>
[not found] ` <20260504-restricted-pointers-kunit-test-v2-1-19e8b1c0fbeb@linutronix.de>
[not found] ` <afh7m3LArilsJyzc@ashevche-desk.local>
[not found] ` <20260504135014-f477a0fe-1af6-4a85-9259-3056a13c0d1f@linutronix.de>
2026-05-04 14:11 ` [PATCH v2 1/2] vsprintf: Only export no_hash_pointers to test module Andy Shevchenko
2026-05-14 11:58 ` Petr Mladek
[not found] ` <20260504-restricted-pointers-kunit-test-v2-2-19e8b1c0fbeb@linutronix.de>
[not found] ` <afh70XpLJD0RXPJu@ashevche-desk.local>
2026-05-14 13:06 ` [PATCH v2 2/2] vsprintf: Add test for restricted kernel pointers Petr Mladek
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.