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:   Mon, 14 Feb 2022 11:31:20 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Anshuman Khandual' <anshuman.khandual@....com>,
        Christophe Leroy <christophe.leroy@...roup.eu>,
        Andrew Morton <akpm@...ux-foundation.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: RE: [PATCH v6] mm: Uninline copy_overflow()

From: Anshuman Khandual
> Sent: 14 February 2022 09:54
...
> > With -Winline, GCC tells:
> >
> > 	/include/linux/thread_info.h:212:20: warning: inlining failed in call to 'copy_overflow': call
> is unlikely and code size would grow [-Winline]
> >
> > copy_overflow() is a non conditional warning called by
> > check_copy_size() on an error path.
> >
> > check_copy_size() have to remain inlined in order to benefit
> > from constant folding, but copy_overflow() is not worth inlining.
> >
> > Uninline the warning when CONFIG_BUG is selected.
> >
> > When CONFIG_BUG is not selected, WARN() does nothing so skip it.
> >
> > This reduces the size of vmlinux by almost 4kbytes.
> 

> > +void __copy_overflow(int size, unsigned long count);
> > +
> >  static inline void copy_overflow(int size, unsigned long count)
> >  {
> > -	WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count);
> > +	if (IS_ENABLED(CONFIG_BUG))
> > +		__copy_overflow(size, count);
> >  }

> Just wondering, is this the only such scenario which results in
> an avoidable bloated vmlinux image ?

The more interesting question is whether the call to __copy_overflow()
is actually significantly smaller than the one to WARN()?
And if so why.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ