Re: [PATCH 0/3] Unexport kallsyms_lookup_name() and kallsyms_on_each_symbol()

From: Greg Kroah-Hartman
Date: Mon Mar 02 2020 - 14:38:37 EST


On Mon, Mar 02, 2020 at 02:28:11PM -0500, Mathieu Desnoyers wrote:
> On 21-Feb-2020 11:44:01 AM, Will Deacon wrote:
> > Hi folks,
> >
> > Despite having just a single modular in-tree user that I could spot,
> > kallsyms_lookup_name() is exported to modules and provides a mechanism
> > for out-of-tree modules to access and invoke arbitrary, non-exported
> > kernel symbols when kallsyms is enabled.
> >
> > This patch series fixes up that one user and unexports the symbol along
> > with kallsyms_on_each_symbol(), since that could also be abused in a
> > similar manner.
>
> Hi,
>
> I maintain a GPL kernel tracer (LTTng) since 2005 which happens to be
> out-of-tree, even though we have made unsuccessful attempts to upstream
> it in the past. It uses kallsyms_lookup_name() to fetch a few symbols. I
> would be very glad to have them GPL-exported upstream rather than
> relying on this work-around. Here is the list of symbols we would need
> to GPL-export:
>
> stack_trace_save
> stack_trace_save_user
> vmalloc_sync_all (CONFIG_X86)
> get_pfnblock_flags_mask
> disk_name
> block_class
> disk_type

I hate to ask, but why does anyone need block_class? or disk_name or
disk_type? I need to put them behind a driver core namespace or
something soon...

thanks,

greg k-h