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-next>] [day] [month] [year] [list]
Date:   Thu,  7 Dec 2017 16:15:37 -0800
From:   "Luis R. Rodriguez" <mcgrof@...nel.org>
To:     jeyu@...nel.org, rusty@...tcorp.com.au
Cc:     keescook@...omium.org, tixxdz@...il.com, mbenes@...e.cz,
        atomlin@...hat.com, pmladek@...e.com, hare@...e.com,
        james.l.morris@...cle.com, ebiederm@...ssion.com,
        davem@...emloft.net, akpm@...ux-foundation.org,
        torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org,
        "Luis R. Rodriguez" <mcgrof@...nel.org>
Subject: [PATCH 0/3] module: minor allocation optimization

Long ago I was debugging kernel/module.c and kernel/kmod.c and had
implemented a sanity check to avoid allocating much of the needed struct
module from what user passes on finit_module() too early, ie, before
checking if the module was actually loaded.

I had disregarded this work as I had bundled it up with some aliasing
work I had done, so incorrectly thought this depended on the alias work.
Upon a second look it does not. The module name set on userspace on
info->name is not the alias but the proper module name, as such using
finished_loading() should suffice once to avoid allocating the module
if its already present.

I've tested this with kmod.sh and found no regressions, the few minor
enhancements are documented in patch 3 in detail. I'll let 0-day hammer
on it as we review the patches [0] [1] but no build issues so far.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/log/?h=20171207-avoid-bogus-layout_and_allocate
[1] https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/log/?h=20171207-avoid-bogus-layout_and_allocate

Luis R. Rodriguez (3):
  module: add an early early_mod_check()
  module: move finished_loading()
  module: avoid allocation if module is already present and ready

 kernel/module.c | 81 ++++++++++++++++++++++++++++++++++-----------------------
 1 file changed, 49 insertions(+), 32 deletions(-)

-- 
2.15.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ