05 Mar, 2020

2 commits

  • commit 7ecaf069da52e472d393f03e79d721aabd724166 upstream.

    Currently, some sanity checks for uapi headers are done by
    scripts/headers_check.pl, which is wired up to the 'headers_check'
    target in the top Makefile.

    It is true compiling headers has better test coverage, but there
    are still several headers excluded from the compile test. I like
    to keep headers_check.pl for a while, but we can delete a lot of
    code by moving the build rule to usr/include/Makefile.

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Greg Kroah-Hartman

    Masahiro Yamada
     
  • commit fcbb8461fd2376ba3782b5b8bd440c929b8e4980 upstream.

    There are both positive and negative options about this feature.
    At first, I thought it was a good idea, but actually Linus stated a
    negative opinion (https://lkml.org/lkml/2019/9/29/227). I admit it
    is ugly and annoying.

    The baseline I'd like to keep is the compile-test of uapi headers.
    (Otherwise, kernel developers have no way to ensure the correctness
    of the exported headers.)

    I will maintain a small build rule in usr/include/Makefile.
    Remove the other header test functionality.

    Signed-off-by: Masahiro Yamada
    [ added to 5.4.y due to start of build warnings from backported patches
    because of this feature - gregkh]
    Signed-off-by: Greg Kroah-Hartman

    Masahiro Yamada
     

09 Jan, 2020

1 commit

  • commit cc976614f59bd8e45de8ce988a6bcb5de711d994 upstream.

    Prior to commit 858805b336be ("kbuild: add $(BASH) to run scripts with
    bash-extension"), this shell script was almost always run by bash since
    bash is usually installed on the system by default.

    Now, this script is run by sh, which might be a symlink to dash. On such
    distributions, the following code emits an error:

    local dev=`LC_ALL=C ls -l "${location}"`

    You can reproduce the build error, for example by setting
    CONFIG_INITRAMFS_SOURCE="/dev".

    GEN usr/initramfs_data.cpio.gz
    ./usr/gen_initramfs_list.sh: 131: local: 1: bad variable name
    make[1]: *** [usr/Makefile:61: usr/initramfs_data.cpio.gz] Error 2

    This is because `LC_ALL=C ls -l "${location}"` contains spaces.
    Surrounding it with double-quotes fixes the error.

    Fixes: 858805b336be ("kbuild: add $(BASH) to run scripts with bash-extension")
    Reported-by: Jory A. Pratt
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Greg Kroah-Hartman

    Masahiro Yamada
     

05 Oct, 2019

1 commit


29 Sep, 2019

1 commit

  • Pull networking fixes from David Miller:

    1) Sanity check URB networking device parameters to avoid divide by
    zero, from Oliver Neukum.

    2) Disable global multicast filter in NCSI, otherwise LLDP and IPV6
    don't work properly. Longer term this needs a better fix tho. From
    Vijay Khemka.

    3) Small fixes to selftests (use ping when ping6 is not present, etc.)
    from David Ahern.

    4) Bring back rt_uses_gateway member of struct rtable, it's semantics
    were not well understood and trying to remove it broke things. From
    David Ahern.

    5) Move usbnet snaity checking, ignore endpoints with invalid
    wMaxPacketSize. From Bjørn Mork.

    6) Missing Kconfig deps for sja1105 driver, from Mao Wenan.

    7) Various small fixes to the mlx5 DR steering code, from Alaa Hleihel,
    Alex Vesker, and Yevgeny Kliteynik

    8) Missing CAP_NET_RAW checks in various places, from Ori Nimron.

    9) Fix crash when removing sch_cbs entry while offloading is enabled,
    from Vinicius Costa Gomes.

    10) Signedness bug fixes, generally in looking at the result given by
    of_get_phy_mode() and friends. From Dan Crapenter.

    11) Disable preemption around BPF_PROG_RUN() calls, from Eric Dumazet.

    12) Don't create VRF ipv6 rules if ipv6 is disabled, from David Ahern.

    13) Fix quantization code in tcp_bbr, from Kevin Yang.

    * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (127 commits)
    net: tap: clean up an indentation issue
    nfp: abm: fix memory leak in nfp_abm_u32_knode_replace
    tcp: better handle TCP_USER_TIMEOUT in SYN_SENT state
    sk_buff: drop all skb extensions on free and skb scrubbing
    tcp_bbr: fix quantization code to not raise cwnd if not probing bandwidth
    mlxsw: spectrum_flower: Fail in case user specifies multiple mirror actions
    Documentation: Clarify trap's description
    mlxsw: spectrum: Clear VLAN filters during port initialization
    net: ena: clean up indentation issue
    NFC: st95hf: clean up indentation issue
    net: phy: micrel: add Asym Pause workaround for KSZ9021
    net: socionext: ave: Avoid using netdev_err() before calling register_netdev()
    ptp: correctly disable flags on old ioctls
    lib: dimlib: fix help text typos
    net: dsa: microchip: Always set regmap stride to 1
    nfp: flower: fix memory leak in nfp_flower_spawn_vnic_reprs
    nfp: flower: prevent memory leak in nfp_flower_spawn_phy_reprs
    net/sched: Set default of CONFIG_NET_TC_SKB_EXT to N
    vrf: Do not attempt to create IPv6 mcast rule if IPv6 is disabled
    net: sched: sch_sfb: don't call qdisc_put() while holding tree lock
    ...

    Linus Torvalds
     

25 Sep, 2019

2 commits

  • When CONFIG_UAPI_HEADER_TEST=y, exported headers are compile-tested to
    make sure they can be included from user-space.

    Currently, linux/netfilter_bridge/ebtables.h is excluded from the test
    coverage. To make it join the compile-test, we need to fix the build
    errors attached below.

    For a case like this, we decided to use __u{8,16,32,64} variable types
    in this discussion:

    https://lkml.org/lkml/2019/6/5/18

    Build log:

    CC usr/include/linux/netfilter_bridge/ebtables.h.s
    In file included from :32:0:
    ./usr/include/linux/netfilter_bridge/ebtables.h:126:4: error: unknown type name ‘uint8_t’
    uint8_t revision;
    ^~~~~~~
    ./usr/include/linux/netfilter_bridge/ebtables.h:139:4: error: unknown type name ‘uint8_t’
    uint8_t revision;
    ^~~~~~~
    ./usr/include/linux/netfilter_bridge/ebtables.h:152:4: error: unknown type name ‘uint8_t’
    uint8_t revision;
    ^~~~~~~

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Pablo Neira Ayuso

    Masahiro Yamada
     
  • Since 9e3596b0c653 ("kbuild: initramfs cleanup, set target from Kconfig")
    "make clean" leaves behind compressed initramfs images. Example:

    $ make defconfig
    $ sed -i 's|CONFIG_INITRAMFS_SOURCE=""|CONFIG_INITRAMFS_SOURCE="/tmp/ir.cpio"|' .config
    $ make olddefconfig
    $ make -s
    $ make -s clean
    $ git clean -ndxf | grep initramfs
    Would remove usr/initramfs_data.cpio.gz

    clean rules do not have CONFIG_* context so they do not know which
    compression format was used. Thus they don't know which files to delete.

    Tell clean to delete all possible compression formats.

    Once patched usr/initramfs_data.cpio.gz and friends are deleted by
    "make clean".

    Link: http://lkml.kernel.org/r/20190722063251.55541-1-gthelen@google.com
    Fixes: 9e3596b0c653 ("kbuild: initramfs cleanup, set target from Kconfig")
    Signed-off-by: Greg Thelen
    Cc: Nicholas Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Greg Thelen
     

29 Aug, 2019

1 commit


23 Jul, 2019

1 commit


21 Jul, 2019

1 commit

  • Pull more Kbuild updates from Masahiro Yamada:

    - match the directory structure of the linux-libc-dev package to that
    of Debian-based distributions

    - fix incorrect include/config/auto.conf generation when Kconfig
    creates it along with the .config file

    - remove misleading $(AS) from documents

    - clean up precious tag files by distclean instead of mrproper

    - add a new coccinelle patch for devm_platform_ioremap_resource
    migration

    - refactor module-related scripts to read modules.order instead of
    $(MODVERDIR)/*.mod files to get the list of created modules

    - remove MODVERDIR

    - update list of header compile-test

    - add -fcf-protection=none flag to avoid conflict with the retpoline
    flags when CONFIG_RETPOLINE=y

    - misc cleanups

    * tag 'kbuild-v5.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (25 commits)
    kbuild: add -fcf-protection=none when using retpoline flags
    kbuild: update compile-test header list for v5.3-rc1
    kbuild: split out *.mod out of {single,multi}-used-m rules
    kbuild: remove 'prepare1' target
    kbuild: remove the first line of *.mod files
    kbuild: create *.mod with full directory path and remove MODVERDIR
    kbuild: export_report: read modules.order instead of .tmp_versions/*.mod
    kbuild: modpost: read modules.order instead of $(MODVERDIR)/*.mod
    kbuild: modsign: read modules.order instead of $(MODVERDIR)/*.mod
    kbuild: modinst: read modules.order instead of $(MODVERDIR)/*.mod
    scsi: remove pointless $(MODVERDIR)/$(obj)/53c700.ver
    kbuild: remove duplication from modules.order in sub-directories
    kbuild: get rid of kernel/ prefix from in-tree modules.{order,builtin}
    kbuild: do not create empty modules.order in the prepare stage
    coccinelle: api: add devm_platform_ioremap_resource script
    kbuild: compile-test headers listed in header-test-m as well
    kbuild: remove unused hostcc-option
    kbuild: remove tag files by distclean instead of mrproper
    kbuild: add --hash-style= and --build-id unconditionally
    kbuild: get rid of misleading $(AS) from documents
    ...

    Linus Torvalds
     

20 Jul, 2019

1 commit

  • - Some headers graduated from the blacklist

    - hyperv_timer.h joined the header-test when CONFIG_X86=y

    - nf_tables*.h joined the header-test when CONFIG_NF_TABLES is
    enabled.

    - The entry for nf_tables_offload.h was added to fix build error for
    the combination of CONFIG_NF_TABLES=n and CONFIG_KERNEL_HEADER_TEST=y.

    - The entry for iomap.h was added because this header is supposed to
    be included only when CONFIG_BLOCK=y

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

15 Jul, 2019

2 commits


08 Jul, 2019

1 commit

  • Multiple people have suggested compile-testing UAPI headers to ensure
    they can be really included from user-space. "make headers_check" is
    obviously not enough to catch bugs, and we often leak unresolved
    references to user-space.

    Use the new header-test-y syntax to implement it. Please note exported
    headers are compile-tested with a completely different set of compiler
    flags. The header search path is set to $(objtree)/usr/include since
    exported headers should not include unexported ones.

    We use -std=gnu89 for the kernel space since the kernel code highly
    depends on GNU extensions. On the other hand, UAPI headers should be
    written in more standardized C, so they are compiled with -std=c90.
    This will emit errors if C++ style comments, the keyword 'inline', etc.
    are used. Please use C style comments (/* ... */), '__inline__', etc.
    in UAPI headers.

    There is additional compiler requirement to enable this test because
    many of UAPI headers include , , ,
    etc. directly or indirectly. You cannot use kernel.org pre-built
    toolchains [1] since they lack .

    I reused CONFIG_CC_CAN_LINK to check the system header availability.
    The intention is slightly different, but a compiler that can link
    userspace programs provide system headers.

    For now, a lot of headers need to be excluded because they cannot
    be compiled standalone, but this is a good start point.

    [1] https://mirrors.edge.kernel.org/pub/tools/crosstool/index.html

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Sam Ravnborg

    Masahiro Yamada
     

10 Dec, 2018

1 commit


22 Aug, 2018

2 commits


26 Mar, 2018

1 commit

  • Incremental linking is gone, so rename built-in.o to built-in.a, which
    is the usual extension for archive files.

    This patch does two things, first is a simple search/replace:

    git grep -l 'built-in\.o' | xargs sed -i 's/built-in\.o/built-in\.a/g'

    The second is to invert nesting of nested text manipulations to avoid
    filtering built-in.a out from libs-y2:

    -libs-y2 := $(filter-out %.a, $(patsubst %/, %/built-in.a, $(libs-y)))
    +libs-y2 := $(patsubst %/, %/built-in.a, $(filter-out %.a, $(libs-y)))

    Signed-off-by: Nicholas Piggin
    Signed-off-by: Masahiro Yamada

    Nicholas Piggin
     

03 Nov, 2017

1 commit

  • This is a follow-up to commit 57ddfdaa9a72 ("initramfs: fix disabling of
    initramfs (and its compression)"). This particular commit fixed the use
    case where we build the kernel with an initramfs with no compression,
    and then we build the kernel with no initramfs.

    Now this still left us with the same case as described here:

    http://lkml.kernel.org/r/20170521033337.6197-1-f.fainelli@gmail.com

    not working with initramfs compression. This can be seen by the
    following steps/timestamps:

    https://www.spinics.net/lists/kernel/msg2598153.html

    .initramfs_data.cpio.gz.cmd is correct:

    cmd_usr/initramfs_data.cpio.gz := /bin/bash
    ./scripts/gen_initramfs_list.sh -o usr/initramfs_data.cpio.gz -u 1000 -g 1000 /home/fainelli/work/uclinux-rootfs/romfs /home/fainelli/work/uclinux-rootfs/misc/initramfs.dev

    and was generated the first time we did generate the gzip initramfs, so
    the command has not changed, nor its arguments, so we just don't call
    it, no initramfs cpio is re-generated as a consequence.

    The fix for this problem is just to properly keep track of the
    .initramfs_cpio_data.d file by suffixing it with the compression
    extension. This takes care of properly tracking dependencies such that
    the initramfs get (re)generated any time files are added/deleted etc.

    Link: http://lkml.kernel.org/r/20170930033936.6722-1-f.fainelli@gmail.com
    Fixes: db2aa7fd15e8 ("initramfs: allow again choice of the embedded initramfs compression algorithm")
    Fixes: 9e3596b0c653 ("kbuild: initramfs cleanup, set target from Kconfig")
    Signed-off-by: Florian Fainelli
    Cc: "Francisco Blas Izquierdo Riera (klondike)"
    Cc: Nicholas Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Florian Fainelli
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

07 Jul, 2017

2 commits


03 Jun, 2017

1 commit

  • Commit db2aa7fd15e8 ("initramfs: allow again choice of the embedded
    initram compression algorithm") introduced the possibility to select the
    initramfs compression algorithm from Kconfig and while this is a nice
    feature it broke the use case described below.

    Here is what my build system does:

    - kernel is initially configured not to have an initramfs included

    - build the user space root file system

    - re-configure the kernel to have an initramfs included
    (CONFIG_INITRAMFS_SOURCE="/path/to/romfs") and set relevant
    CONFIG_INITRAMFS options, in my case, no compression option
    (CONFIG_INITRAMFS_COMPRESSION_NONE)

    - kernel is re-built with these options -> kernel+initramfs image is
    copied

    - kernel is re-built again without these options -> kernel image is
    copied

    Building a kernel without an initramfs means setting this option:

    CONFIG_INITRAMFS_SOURCE="" (and this one only)

    whereas building a kernel with an initramfs means setting these options:

    CONFIG_INITRAMFS_SOURCE="/home/fainelli/work/uclinux-rootfs/romfs /home/fainelli/work/uclinux-rootfs/misc/initramfs.dev"
    CONFIG_INITRAMFS_ROOT_UID=1000
    CONFIG_INITRAMFS_ROOT_GID=1000
    CONFIG_INITRAMFS_COMPRESSION_NONE=y
    CONFIG_INITRAMFS_COMPRESSION=""

    Commit db2aa7fd15e85 ("initramfs: allow again choice of the embedded
    initram compression algorithm") is problematic because
    CONFIG_INITRAMFS_COMPRESSION which is used to determine the
    initramfs_data.cpio extension/compression is a string, and due to how
    Kconfig works it will evaluate in order, how to assign it.

    Setting CONFIG_INITRAMFS_COMPRESSION_NONE with CONFIG_INITRAMFS_SOURCE=""
    cannot possibly work (because of the depends on INITRAMFS_SOURCE!=""
    imposed on CONFIG_INITRAMFS_COMPRESSION ) yet we still get
    CONFIG_INITRAMFS_COMPRESSION assigned to ".gz" because CONFIG_RD_GZIP=y
    is set in my kernel, even when there is no initramfs being built.

    So we basically end-up generating two initramfs_data.cpio* files, one
    without extension, and one with .gz. This causes usr/Makefile to track
    usr/initramfs_data.cpio.gz, and not usr/initramfs_data.cpio anymore,
    that is also largely problematic after 9e3596b0c6539e ("kbuild:
    initramfs cleanup, set target from Kconfig") because we used to track
    all possible initramfs_data files in the $(targets) variable before that
    commit.

    The end result is that the kernel with an initramfs clearly does not
    contain what we expect it to, it has a stale initramfs_data.cpio file
    built into it, and we keep re-generating an initramfs_data.cpio.gz file
    which is not the one that we want to include in the kernel image proper.

    The fix consists in hiding CONFIG_INITRAMFS_COMPRESSION when
    CONFIG_INITRAMFS_SOURCE="". This puts us back in a state to the
    pre-4.10 behavior where we can properly disable and re-enable initramfs
    within the same kernel .config file, and be in control of what
    CONFIG_INITRAMFS_COMPRESSION is set to.

    Fixes: db2aa7fd15e8 ("initramfs: allow again choice of the embedded initram compression algorithm")
    Fixes: 9e3596b0c653 ("kbuild: initramfs cleanup, set target from Kconfig")
    Link: http://lkml.kernel.org/r/20170521033337.6197-1-f.fainelli@gmail.com
    Signed-off-by: Florian Fainelli
    Acked-by: Nicholas Piggin
    Cc: P J P
    Cc: Paul Bolle
    Cc: Michal Marek
    Cc: Daniel Thompson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Florian Fainelli
     

09 May, 2017

1 commit

  • Many "embedded" architectures provide CMDLINE_FORCE to allow the kernel
    to override the command line provided by an inflexible bootloader.
    However there is currrently no way for the kernel to override the
    initramfs image provided by the bootloader meaning there are still ways
    for bootloaders to make things difficult for us.

    Fix this by introducing INITRAMFS_FORCE which can prevent the kernel
    from loading the bootloader supplied image.

    We use CMDLINE_FORCE (and its friend CMDLINE_EXTEND) to imply that the
    system has an inflexible bootloader. This allow us to avoid presenting
    this config option to users of systems where inflexible bootloaders
    aren't usually a problem.

    Link: http://lkml.kernel.org/r/20170217121940.30126-1-daniel.thompson@linaro.org
    Signed-off-by: Daniel Thompson
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Thompson
     

06 Jan, 2017

2 commits

  • Rather than keep a list of all possible compression types in the
    Makefile, set the target explicitly from Kconfig.

    Reviewed-by: Francisco Blas Izquierdo Riera (klondike)
    Signed-off-by: Nicholas Piggin
    Signed-off-by: Linus Torvalds

    Nicholas Piggin
     
  • When using initramfs compression, the data file compression suffix
    gets quotes pulled in from Kconfig, e.g., initramfs_data.cpio".gz"
    which make does not match a target and causes rebuild.

    Fix this by filtering out quotes from the Kconfig string.

    Fixes: 35e669e1a254 ("initramfs: select builtin initram compression algorithm on KConfig instead of Makefile")
    Reviewed-by: Francisco Blas Izquierdo Riera (klondike)
    Signed-off-by: Nicholas Piggin
    Signed-off-by: Linus Torvalds

    Nicholas Piggin
     

15 Dec, 2016

2 commits

  • Choosing the appropriate compression option when using an embedded
    initramfs can result in significant size differences in the resulting
    data.

    This is caused by avoiding double compression of the initramfs contents.
    For example on my tests, choosing CONFIG_INITRAMFS_COMPRESSION_NONE when
    compressing the kernel using XZ) results in up to 500KiB differences
    (9MiB to 8.5MiB) in the kernel size as the dictionary will not get
    polluted with uncomprensible data and may reuse kernel data too.

    Despite embedding an uncompressed initramfs, a user may want to allow
    for a compressed extra initramfs to be passed using the rd system, for
    example to boot a recovery system. 9ba4bcb645898d ("initramfs: read
    CONFIG_RD_ variables for initramfs compression") broke that behavior by
    making the choice based on CONFIG_RD_* instead of adding
    CONFIG_INITRAMFS_COMPRESSION_LZ4. Saddly, CONFIG_RD_* is also used to
    choose the supported RD compression algorithms by the kernel and a user
    may want to support more than one.

    This patch also reverts commit 3e4e0f0a875 ("initramfs: remove
    "compression mode" choice") restoring back the "compression mode" choice
    and includes the CONFIG_INITRAMFS_COMPRESSION_LZ4 option which was never
    added.

    As a result the following options are added or readed affecting the embedded
    initramfs compression:
    INITRAMFS_COMPRESSION_NONE Do no compression
    INITRAMFS_COMPRESSION_GZIP Compress using gzip
    INITRAMFS_COMPRESSION_BZIP2 Compress using bzip2
    INITRAMFS_COMPRESSION_LZMA Compress using lzma
    INITRAMFS_COMPRESSION_XZ Compress using xz
    INITRAMFS_COMPRESSION_LZO Compress using lzo
    INITRAMFS_COMPRESSION_LZ4 Compress using lz4

    These depend on the corresponding CONFIG_RD_* option being set (except
    NONE which has no dependencies).

    This patch depends on the previous one (the previous version didn't) to
    simplify the way in which the algorithm is chosen and keep backwards
    compatibility with the behaviour introduced by 9ba4bcb645898
    ("initramfs: read CONFIG_RD_ variables for initramfs compression").

    Link: http://lkml.kernel.org/r/57EAD77B.7090607@klondike.es
    Signed-off-by: Francisco Blas Izquierdo Riera (klondike)
    Cc: P J P
    Cc: Paul Bolle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Francisco Blas Izquierdo Riera (klondike)
     
  • Move the current builtin initram compression algorithm selection from
    the Makefile into the INITRAMFS_COMPRESSION variable. This makes
    deciding algorithm precedence easier and would allow for overrides if
    new algorithms want to be tested.

    Link: http://lkml.kernel.org/r/57EAD769.1090401@klondike.es
    Signed-off-by: Francisco Blas Izquierdo Riera (klondike)
    Cc: P J P
    Cc: Paul Bolle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Francisco Blas Izquierdo Riera (klondike)
     

14 Dec, 2014

1 commit

  • The kernel has support for (nearly) every compression algorithm known to
    man, each to handle some particular microscopic niche.

    Unfortunately all of these always get compiled in if you want to support
    INITRDs, and can be only disabled when CONFIG_EXPERT is set.

    I don't see why I need to set EXPERT just to properly configure the initrd
    compression algorithms, and not always include every possible algorithm

    Usually the initrd is just compressed with gzip anyways, at least that's
    true on all distributions I use.

    Remove the dependencies for initrd compression on CONFIG_EXPERT.

    Make the various options just default y, which should be good enough to
    not break any previous configuration.

    Signed-off-by: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andi Kleen
     

07 Jun, 2014

1 commit

  • Commit 9ba4bcb64589 ("initramfs: read CONFIG_RD_ variables for initramfs
    compression") removed the users of the various INITRAMFS_COMPRESSION_*
    Kconfig symbols. So since v3.13 the entire "Built-in initramfs
    compression mode" choice is a set of knobs connected to nothing. The
    entire choice can safely be removed.

    Signed-off-by: Paul Bolle
    Cc: P J P
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Bolle
     

13 Nov, 2013

2 commits

  • When expert configuration option(CONFIG_EXPERT) is enabled, menuconfig
    offers a choice of compression algorithm to compress initial ramfs image;
    This choice is stored into CONFIG_RD_* variables. But usr/Makefile uses
    earlier INITRAMFS_COMPRESSION_* macros to build initial ramfs file. Since
    none of them is defined, resulting 'initramfs_data.cpio' file remains
    un-compressed.

    This patch updates the Makefile to use CONFIG_RD_* variables and adds
    support for LZ4 compression algorithm. Also updates the
    'gen_initramfs_list.sh' script to check whether a selected compression
    command is accessible or not. And fall-back to default gzip(1)
    compression when it is not.

    Signed-off-by: P J P
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    P J P
     
  • getenv() may return NULL if given environment variable does not exist
    which leads to NULL dereference when calling strncat.

    Besides that, the environment variable name was copied to a temporary
    env_var buffer, but this copying can be avoided by simply using the input
    string.

    Lastly, the whole loop can be greatly simplified by using the snprintf
    function instead of the playing with strncat.

    By the way, the current implementation allows a recursive variable
    expansion, as in:

    $ echo 'out ${A} out ' | A='a ${B} a' B=b /tmp/a
    out a b a out

    I'm assuming this is just a side effect and not a conscious decision
    (especially as this may lead to infinite loop), but I didn't want to
    change this behaviour without consulting.

    If the current behaviour is deamed incorrect, I'll be happy to send
    a patch without recursive processing.

    Signed-off-by: Michal Nazarewicz
    Cc: Kees Cook
    Cc: Jiri Kosina
    Cc: Jesper Juhl
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Nazarewicz
     

10 Jul, 2013

1 commit

  • Add support for extracting LZ4-compressed kernel images, as well as
    LZ4-compressed ramdisk images in the kernel boot process.

    Signed-off-by: Kyungsik Lee
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Russell King
    Cc: Borislav Petkov
    Cc: Florian Fainelli
    Cc: Yann Collet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kyungsik Lee
     

19 Nov, 2012

1 commit


26 Oct, 2012

1 commit

  • Fix possible overflow of the buffer used for expanding environment
    variables when building file list.

    In the extremely unlikely case of an attacker having control over the
    environment variables visible to gen_init_cpio, control over the
    contents of the file gen_init_cpio parses, and gen_init_cpio was built
    without compiler hardening, the attacker can gain arbitrary execution
    control via a stack buffer overflow.

    $ cat usr/crash.list
    file foo ${BIG}${BIG}${BIG}${BIG}${BIG}${BIG} 0755 0 0
    $ BIG=$(perl -e 'print "A" x 4096;') ./usr/gen_init_cpio usr/crash.list
    *** buffer overflow detected ***: ./usr/gen_init_cpio terminated

    This also replaces the space-indenting with tabs.

    Patch based on existing fix extracted from grsecurity.

    Signed-off-by: Kees Cook
    Cc: Michal Marek
    Cc: Brad Spengler
    Cc: PaX Team
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     

01 Jun, 2012

1 commit

  • There have been new compression algorithms added without updating nearby
    relevant descriptive text that refers to (a) the number of compression
    algorithms and (b) the most recent one. Fix these inconsistencies.

    Signed-off-by: Randy Dunlap
    Reported-by:
    Cc: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Markus Trippelsdorf
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

18 Apr, 2011

1 commit


21 Jan, 2011

1 commit

  • The meaning of CONFIG_EMBEDDED has long since been obsoleted; the option
    is used to configure any non-standard kernel with a much larger scope than
    only small devices.

    This patch renames the option to CONFIG_EXPERT in init/Kconfig and fixes
    references to the option throughout the kernel. A new CONFIG_EMBEDDED
    option is added that automatically selects CONFIG_EXPERT when enabled and
    can be used in the future to isolate options that should only be
    considered for embedded systems (RISC architectures, SLOB, etc).

    Calling the option "EXPERT" more accurately represents its intention: only
    expert users who understand the impact of the configuration changes they
    are making should enable it.

    Reviewed-by: Ingo Molnar
    Acked-by: David Woodhouse
    Signed-off-by: David Rientjes
    Cc: Greg KH
    Cc: "David S. Miller"
    Cc: Jens Axboe
    Cc: Arnd Bergmann
    Cc: Robin Holt
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     

14 Jan, 2011

1 commit

  • This implements the API defined in which is
    used for kernel, initramfs, and initrd decompression. This patch together
    with the first patch is enough for XZ-compressed initramfs and initrd;
    XZ-compressed kernel will need arch-specific changes.

    The buffering requirements described in decompress_unxz.c are stricter
    than with gzip, so the relevant changes should be done to the
    arch-specific code when adding support for XZ-compressed kernel.
    Similarly, the heap size in arch-specific pre-boot code may need to be
    increased (30 KiB is enough).

    The XZ decompressor needs memmove(), memeq() (memcmp() == 0), and
    memzero() (memset(ptr, 0, size)), which aren't available in all
    arch-specific pre-boot environments. I'm including simple versions in
    decompress_unxz.c, but a cleaner solution would naturally be nicer.

    Signed-off-by: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     

11 Jan, 2011

1 commit

  • * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
    mkuboot.sh: Fail if mkimage is missing
    gen_init_cpio: checkpatch fixes
    gen_init_cpio: Avoid race between call to stat() and call to open()
    modpost: Fix address calculation in reloc_location()
    Make fixdep error handling more explicit
    checksyscalls: Fix stand-alone usage
    modpost: Put .zdebug* section on white list
    kbuild: fix interaction of CONFIG_IKCONFIG and KCONFIG_CONFIG
    kbuild: export linux/{a.out,kvm,kvm_para}.h on headers_install_all
    kbuild: introduce HDR_ARCH_LIST for headers_install_all
    headers_install: check exit status of unifdef
    gen_init_cpio: remove leading `/' from file names
    scripts/genksyms: fix header usage
    fixdep: use hash table instead of a single array

    Linus Torvalds