lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 10 Feb 2022 09:19:54 +0100
From:   Petr Mladek <pmladek@...e.com>
To:     Luis Chamberlain <mcgrof@...nel.org>
Cc:     Vimal Agrawal <avimalin@...il.com>,
        Maninder Singh <maninder1.s@...sung.com>, rostedt@...dmis.org,
        senozhatsky@...omium.org, andriy.shevchenko@...ux.intel.com,
        linux@...musvillemoes.dk, akpm@...ux-foundation.org,
        wangkefeng.wang@...wei.com, mbenes@...e.cz, swboyd@...omium.org,
        ojeda@...nel.org, linux-kernel@...r.kernel.org, will@...nel.org,
        catalin.marinas@....com, Vaneet Narang <v.narang@...sung.com>,
        Aaron Tomlin <atomlin@...hat.com>
Subject: Re: [PATCH 1/1] kallsyms: print module name in %ps/S case when
 KALLSYMS is disabled

On Wed 2022-02-09 15:02:06, Luis Chamberlain wrote:
> On Wed, Feb 09, 2022 at 12:40:38PM +0100, Petr Mladek wrote:
> > > --- a/include/linux/kallsyms.h
> > > +++ b/include/linux/kallsyms.h
> > > @@ -163,6 +163,33 @@ static inline bool kallsyms_show_value(const struct cred *cred)
> > >  	return false;
> > >  }
> > >  
> > > +#ifdef CONFIG_MODULES
> > > +static inline int fill_minimal_module_info(char *sym, int size, unsigned long value)
> > > +{
> > > +	struct module *mod;
> > > +	unsigned long offset;
> > > +	int ret = 0;
> > > +
> > > +	preempt_disable();
> > > +	mod = __module_address(value);
> > > +	if (mod) {
> > > +		offset = value - (unsigned long)mod->core_layout.base;
> > > +		snprintf(sym, size - 1, "0x%lx+0x%lx [%s]",
> > > +				(unsigned long)mod->core_layout.base, offset, mod->name);
> > > +
> > > +		sym[size - 1] = '\0';
> > > +		ret = 1;
> > > +	}
> > > +
> > > +	preempt_enable();
> > > +	return ret;
> > > +}
> > 
> > It looks too big for an inlined function. Anyway, we will need
> > something even more complex, see below.
> 
> Interesting, these observations might apply to Vimal's work as well [0].
> 
> [0] https://lkml.kernel.org/r/YgKyC4ZRud0JW1PF@bombadil.infradead.org

Honestly, I am not sure what is the best practice. My understanding is
that inlined functions are used primary for speed up at runtime.

Anyway, there is the huge patchset that tries to optimize kernel build
time by optimizing headers, see
https://lore.kernel.org/lkml/YdIfz+LMewetSaEB@gmail.com/T/

This is from the cover letter:

<paste>
Techniques used by the fast-headers tree to reduce header size & dependencies:
[...]
 - Uninlining: there's a number of unnecessary inline functions that also
   couple otherwise unrelated headers to each other. The fast-headers tree
   contains over 100 uninlining commits.
</paste>

It is probably less important for some local includes. I am not sure how
widely is kallsyms.h included.

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ