25 Mar, 2020

2 commits


29 Apr, 2019

1 commit

  • Introduce in-kernel headers which are made available as an archive
    through proc (/proc/kheaders.tar.xz file). This archive makes it
    possible to run eBPF and other tracing programs that need to extend the
    kernel for tracing purposes without any dependency on the file system
    having headers.

    A github PR is sent for the corresponding BCC patch at:
    https://github.com/iovisor/bcc/pull/2312

    On Android and embedded systems, it is common to switch kernels but not
    have kernel headers available on the file system. Further once a
    different kernel is booted, any headers stored on the file system will
    no longer be useful. This is an issue even well known to distros.
    By storing the headers as a compressed archive within the kernel, we can
    avoid these issues that have been a hindrance for a long time.

    The best way to use this feature is by building it in. Several users
    have a need for this, when they switch debug kernels, they do not want to
    update the filesystem or worry about it where to store the headers on
    it. However, the feature is also buildable as a module in case the user
    desires it not being part of the kernel image. This makes it possible to
    load and unload the headers from memory on demand. A tracing program can
    load the module, do its operations, and then unload the module to save
    kernel memory. The total memory needed is 3.3MB.

    By having the archive available at a fixed location independent of
    filesystem dependencies and conventions, all debugging tools can
    directly refer to the fixed location for the archive, without concerning
    with where the headers on a typical filesystem which significantly
    simplifies tooling that needs kernel headers.

    The code to read the headers is based on /proc/config.gz code and uses
    the same technique to embed the headers.

    Other approaches were discussed such as having an in-memory mountable
    filesystem, but that has drawbacks such as requiring an in-kernel xz
    decompressor which we don't have today, and requiring usage of 42 MB of
    kernel memory to host the decompressed headers at anytime. Also this
    approach is simpler than such approaches.

    Reviewed-by: Masahiro Yamada
    Signed-off-by: Joel Fernandes (Google)
    Signed-off-by: Greg Kroah-Hartman

    Joel Fernandes (Google)
     

08 Mar, 2019

1 commit

  • This slightly optimizes the kernel/configs.c build.

    bin2c is not very efficient because it converts a data file into a huge
    array to embed it into a *.c file.

    Instead, we can use the .incbin directive.

    Also, this simplifies the code; Makefile is cleaner, and the way to get
    the offset/size of the config_data.gz is more straightforward.

    I used the "asm" statement in *.c instead of splitting it into *.S
    because MODULE_* tags are not supported in *.S files.

    I also cleaned up kernel/.gitignore; "config_data.gz" is unneeded
    because the top-level .gitignore takes care of the "*.gz" pattern.

    [yamada.masahiro@socionext.com: v2]
    Link: http://lkml.kernel.org/r/1550108893-21226-1-git-send-email-yamada.masahiro@socionext.com
    Link: http://lkml.kernel.org/r/1549941160-8084-1-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Cc: Randy Dunlap
    Cc: Arnd Bergmann
    Cc: Alexander Popov
    Cc: Kees Cook
    Cc: Jonathan Corbet
    Cc: Thomas Gleixner
    Cc: Dan Williams
    Cc: Mathieu Desnoyers
    Cc: Richard Guy Briggs
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     

21 Oct, 2015

1 commit

  • Currently we see this in "git status" if we build in the source dir:

    Untracked files:
    (use "git add ..." to include in what will be committed)

    certs/x509_certificate_list

    It looks like it used to live in kernel/ so we squash that .gitignore
    entry at the same time. I didn't bother to dig through git history to
    see when it moved, since it is just a minor annoyance at most.

    Cc: David Woodhouse
    Cc: keyrings@linux-nfs.org
    Signed-off-by: Paul Gortmaker
    Signed-off-by: David Howells

    Paul Gortmaker
     

11 Dec, 2013

1 commit

  • $ git status
    # On branch pending-rebases
    # Untracked files:
    # (use "git add ..." to include in what will be committed)
    #
    # kernel/x509_certificate_list
    nothing added to commit but untracked files present (use "git add" to track)
    $

    Signed-off-by: Rusty Russell
    Signed-off-by: David Howells

    Rusty Russell
     

22 Apr, 2013

1 commit


10 Feb, 2008

1 commit


03 Jan, 2006

1 commit