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:   Mon, 16 Jul 2018 14:21:19 +0200
From:   Martijn Coenen <maco@...roid.com>
To:     linux-kernel@...r.kernel.org
Cc:     Martijn Coenen <maco@...roid.com>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Michal Marek <michal.lkml@...kovi.net>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
        Alan Stern <stern@...land.harvard.edu>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Oliver Neukum <oneukum@...e.com>,
        Arnd Bergmann <arnd@...db.de>, Jessica Yu <jeyu@...nel.org>,
        Stephen Boyd <sboyd@...eaurora.org>,
        Philippe Ombredanne <pombredanne@...b.com>,
        Kate Stewart <kstewart@...uxfoundation.org>,
        Sam Ravnborg <sam@...nborg.org>, linux-kbuild@...r.kernel.org,
        linux-m68k@...ts.linux-m68k.org, linux-usb@...r.kernel.org,
        usb-storage@...ts.one-eyed-alien.net, linux-scsi@...r.kernel.org,
        linux-arch@...r.kernel.org, maco@...gle.com, sspatil@...gle.com,
        malchev@...gle.com, joelaf@...gle.com
Subject: [PATCH 0/6] Symbol namespaces

As of Linux 4.17, there are more than 30000 exported symbols
in the kernel. There seems to be some consensus amongst
kernel devs that the export surface is too large, and hard
to reason about.

Generally, these symbols fall in one of these categories:
1) Symbols actually meant for drivers
2) Symbols that are only exported because functionality is
   split over multiple modules, yet they really shouldn't
   be used by modules outside of their own subsystem
3) Symbols really only meant for in-tree use

When module developers try to upstream their code, it
regularly turns out that they are using exported symbols
that they really shouldn't be using. This problem is even
bigger for drivers that are currently out-of-tree, which
may be using many symbols that they shouldn't be using,
and that break when those symbols are removed or modified.

This patch allows subsystem maintainers to partition their
exported symbols into separate namespaces, and module
authors to import such namespaces only when needed.

This allows subsystem maintainers to more easily limit
availability of these namespaced symbols to other parts of
the kernel. It can also be used to partition the set of
exported symbols for documentation purposes; for example,
a set of symbols that is really only used for debugging
could be in a "SUBSYSTEM_DEBUG" namespace.

Martijn Coenen (6):
  export: explicitly align struct kernel_symbol.
  module: add support for symbol namespaces.
  modpost: add support for checking symbol namespaces.
  modpost: add support for generating namespace dependencies.
  scripts: Coccinelle script for namespace dependencies.
  RFC: USB: storage: move symbols into USB_STORAGE namespace.

 Makefile                            |  11 +++
 arch/m68k/include/asm/export.h      |   1 -
 arch/x86/include/asm/Kbuild         |   1 +
 arch/x86/include/asm/export.h       |   5 --
 drivers/usb/storage/alauda.c        |   1 +
 drivers/usb/storage/cypress_atacb.c |   1 +
 drivers/usb/storage/datafab.c       |   1 +
 drivers/usb/storage/ene_ub6250.c    |   1 +
 drivers/usb/storage/freecom.c       |   1 +
 drivers/usb/storage/isd200.c        |   1 +
 drivers/usb/storage/jumpshot.c      |   1 +
 drivers/usb/storage/karma.c         |   1 +
 drivers/usb/storage/onetouch.c      |   1 +
 drivers/usb/storage/realtek_cr.c    |   1 +
 drivers/usb/storage/sddr09.c        |   1 +
 drivers/usb/storage/sddr55.c        |   1 +
 drivers/usb/storage/shuttle_usbat.c |   1 +
 drivers/usb/storage/uas.c           |   1 +
 drivers/usb/storage/usb.c           |  20 ++---
 include/asm-generic/export.h        |   2 +-
 include/linux/export.h              |  84 ++++++++++++++-----
 include/linux/module.h              |  13 +++
 kernel/module.c                     |  79 ++++++++++++++++++
 scripts/Makefile.modpost            |   4 +-
 scripts/add_namespace.cocci         |  19 +++++
 scripts/mod/modpost.c               | 120 ++++++++++++++++++++++++++--
 scripts/mod/modpost.h               |   9 +++
 scripts/nsdeps                      |  41 ++++++++++
 28 files changed, 379 insertions(+), 44 deletions(-)
 delete mode 100644 arch/x86/include/asm/export.h
 create mode 100644 scripts/add_namespace.cocci
 create mode 100644 scripts/nsdeps

-- 
2.18.0.203.gfac676dfb9-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ