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]
Message-Id: <20220111143046.14680-1-pmladek@suse.com>
Date:   Tue, 11 Jan 2022 15:30:44 +0100
From:   Petr Mladek <pmladek@...e.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     John Ogness <john.ogness@...utronix.de>,
        Sergey Senozhatsky <senozhatsky@...omium.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        Chris Down <chris@...isdown.name>,
        Marc Zyngier <maz@...nel.org>,
        Andrew Scull <ascull@...gle.com>,
        Will Deacon <will@...nel.org>, Jason Baron <jbaron@...mai.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        linux-kernel@...r.kernel.org, Petr Mladek <pmladek@...e.com>
Subject: [RFC 0/2] printk: Remove cyclic include dependencies with printk.h

"make headerdep" reports two cycles where printk.h is involved. Both are
a bit complicated. All involved headers provide inlined functions that
have to be inlined because they add caller-specific metadata.

There are several possible solutions:

1. Ignore the problem because the cycles do not cause any real problem
   at the moment. I would say that it works by chance. See the patches
   for more details.


2. Move the printk-calls from the headers into .c sources so that printk.h
   is included in .c instead of .h. It is relatively easy except that it
   makes the code a bit more complicated.


3. Use a simple declaration somewhere. It is problematic because
   the inlined functions are more complex.

   But printk() is complex because it adds metadata for the list
   of strings in /sys/kernel/debug/printk/index. The index already misses
   a lot of strings that are printed via some subsystem specific wrappers.
   It should be acceptable to miss the few strings used in the affected
   headers.


This patchset implements the 3rd solution. It does not complicate
the existing code. It is quite the opposite. It splits the long
printk.h. It puts some low-level definitions into separate printk_core.h.
The lightweight header file might be useful also in other situations.

What do you think, please?

Petr Mladek (2):
  printk/dynamic_debug: Remove cyclic dependency between printk.h and
    dynamic_debug.h
  printk/bug: Remove cyclic dependency between bug.h and printk.h

 MAINTAINERS                   |  1 +
 include/asm-generic/bug.h     |  4 +-
 include/linux/dynamic_debug.h | 10 ++--
 include/linux/printk.h        | 68 +--------------------------
 include/linux/printk_core.h   | 87 +++++++++++++++++++++++++++++++++++
 5 files changed, 96 insertions(+), 74 deletions(-)
 create mode 100644 include/linux/printk_core.h

-- 
2.26.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ