14 Jun, 2020

1 commit

  • Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over
    '---help---'"), the number of '---help---' has been gradually
    decreasing, but there are still more than 2400 instances.

    This commit finishes the conversion. While I touched the lines,
    I also fixed the indentation.

    There are a variety of indentation styles found.

    a) 4 spaces + '---help---'
    b) 7 spaces + '---help---'
    c) 8 spaces + '---help---'
    d) 1 space + 1 tab + '---help---'
    e) 1 tab + '---help---' (correct indentation)
    f) 1 tab + 1 space + '---help---'
    g) 1 tab + 2 spaces + '---help---'

    In order to convert all of them to 1 tab + 'help', I ran the
    following commend:

    $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

07 Jun, 2020

1 commit

  • Pull arch/sh updates from Rich Felker:
    "Fix for arch/sh build regression with newer binutils, removal of SH5,
    fixes for module exports, and misc cleanup"

    * tag 'sh-for-5.8' of git://git.libc.org/linux-sh:
    sh: remove sh5 support
    sh: add missing EXPORT_SYMBOL() for __delay
    sh: Convert ins[bwl]/outs[bwl] macros to inline functions
    sh: Convert iounmap() macros to inline functions
    sh: Add missing DECLARE_EXPORT() for __ashiftrt_r4_xx
    sh: configs: Cleanup old Kconfig IO scheduler options
    arch/sh: vmlinux.scr
    sh: Replace CONFIG_MTD_M25P80 with CONFIG_MTD_SPI_NOR in sh7757lcr_defconfig
    sh: sh4a: Bring back tmu3_device early device

    Linus Torvalds
     

02 Jun, 2020

2 commits

  • Pull documentation updates from Jonathan Corbet:
    "A fair amount of stuff this time around, dominated by yet another
    massive set from Mauro toward the completion of the RST conversion. I
    *really* hope we are getting close to the end of this. Meanwhile,
    those patches reach pretty far afield to update document references
    around the tree; there should be no actual code changes there. There
    will be, alas, more of the usual trivial merge conflicts.

    Beyond that we have more translations, improvements to the sphinx
    scripting, a number of additions to the sysctl documentation, and lots
    of fixes"

    * tag 'docs-5.8' of git://git.lwn.net/linux: (130 commits)
    Documentation: fixes to the maintainer-entry-profile template
    zswap: docs/vm: Fix typo accept_threshold_percent in zswap.rst
    tracing: Fix events.rst section numbering
    docs: acpi: fix old http link and improve document format
    docs: filesystems: add info about efivars content
    Documentation: LSM: Correct the basic LSM description
    mailmap: change email for Ricardo Ribalda
    docs: sysctl/kernel: document unaligned controls
    Documentation: admin-guide: update bug-hunting.rst
    docs: sysctl/kernel: document ngroups_max
    nvdimm: fixes to maintainter-entry-profile
    Documentation/features: Correct RISC-V kprobes support entry
    Documentation/features: Refresh the arch support status files
    Revert "docs: sysctl/kernel: document ngroups_max"
    docs: move locking-specific documents to locking/
    docs: move digsig docs to the security book
    docs: move the kref doc into the core-api book
    docs: add IRQ documentation at the core-api book
    docs: debugging-via-ohci1394.txt: add it to the core-api book
    docs: fix references for ipmi.rst file
    ...

    Linus Torvalds
     
  • sh5 never became a product and has probably never really worked.

    Remove it by recursively deleting all associated Kconfig options
    and all corresponding files.

    Reviewed-by: Geert Uytterhoeven
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Rich Felker

    Arnd Bergmann
     

21 Apr, 2020

1 commit

  • Some filesystem references got broken by a previous patch
    series I submitted. Address those.

    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: David Sterba # fs/affs/Kconfig
    Link: https://lore.kernel.org/r/57318c53008dbda7f6f4a5a9e5787f4d37e8565a.1586881715.git.mchehab+huawei@kernel.org
    Signed-off-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

17 Mar, 2020

2 commits

  • An arch may want to tweak the mmap prot flags for an
    ELFexecutable's initial mappings. For example, arm64 is going to
    need to add PROT_BTI for executable pages in an ELF process whose
    executable is marked as using Branch Target Identification (an
    ARMv8.5-A control flow integrity feature).

    So that this can be done in a generic way, add a hook
    arch_elf_adjust_prot() to modify the prot flags as desired: arches
    can select CONFIG_HAVE_ELF_PROT and implement their own backend
    where necessary.

    By default, leave the prot flags unchanged.

    Signed-off-by: Mark Brown
    Signed-off-by: Dave Martin
    Reviewed-by: Catalin Marinas
    Reviewed-by: Kees Cook
    Signed-off-by: Catalin Marinas

    Dave Martin
     
  • Pull the basic ELF definitions relating to the
    NT_GNU_PROPERTY_TYPE_0 note from Yu-Cheng Yu's earlier x86 shstk
    series.

    Signed-off-by: Mark Brown
    Signed-off-by: Dave Martin
    Signed-off-by: Yu-cheng Yu
    Reviewed-by: Catalin Marinas
    Reviewed-by: Kees Cook
    Signed-off-by: Catalin Marinas

    Dave Martin
     

24 Jun, 2019

4 commits


21 May, 2019

1 commit


02 Aug, 2018

1 commit


16 Jun, 2018

1 commit

  • As we move stuff around, some doc references are broken. Fix some of
    them via this script:
    ./scripts/documentation-file-ref-check --fix

    Manually checked that produced results are valid.

    Acked-by: Matthias Brugger
    Acked-by: Takashi Iwai
    Acked-by: Jeff Kirsher
    Acked-by: Guenter Roeck
    Acked-by: Miguel Ojeda
    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

26 Mar, 2018

1 commit


11 Sep, 2017

2 commits

  • Provide the necessary changes to be able to execute ELF-FDPIC binaries
    on ARM systems with an MMU.

    The default for CONFIG_BINFMT_ELF_FDPIC is also set to n if the regular
    ELF loader is already configured so not to force FDPIC support on
    everyone. Given that CONFIG_BINFMT_ELF depends on CONFIG_MMU, this means
    CONFIG_BINFMT_ELF_FDPIC will still default to y when !MMU.

    Signed-off-by: Nicolas Pitre
    Acked-by: Mickael GUENE
    Tested-by: Vincent Abriou
    Tested-by: Andras Szemzo

    Nicolas Pitre
     
  • This includes the necessary code to recognise the FDPIC format on ARM
    and the ptrace command definitions used by the common ptrace code.

    Based on patches originally from Mickael Guene .

    Signed-off-by: Nicolas Pitre
    Acked-by: Mickael GUENE
    Tested-by: Vincent Abriou
    Tested-by: Andras Szemzo

    Nicolas Pitre
     

24 Oct, 2016

1 commit


12 Aug, 2016

1 commit


28 Jul, 2016

1 commit

  • Now that the generic changes are in place, this can be enabled on m68k
    with the use of proper user space accessors in the flat_get_addr_from_rp()
    and flat_put_addr_at_rp() handlers as rp actually holds a user space
    address.

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Greg Ungerer

    Nicolas Pitre
     

24 May, 2016

1 commit

  • CONFIG_MIPS32_N32=y but CONFIG_BINFMT_ELF disabled results in the
    following linker errors:

    arch/mips/built-in.o: In function `elf_core_dump':
    binfmt_elfn32.c:(.text+0x23dbc): undefined reference to `elf_core_extra_phdrs'
    binfmt_elfn32.c:(.text+0x246e4): undefined reference to `elf_core_extra_data_size'
    binfmt_elfn32.c:(.text+0x248d0): undefined reference to `elf_core_write_extra_phdrs'
    binfmt_elfn32.c:(.text+0x24ac4): undefined reference to `elf_core_write_extra_data'

    CONFIG_MIPS32_O32=y but CONFIG_BINFMT_ELF disabled results in the following
    linker errors:

    arch/mips/built-in.o: In function `elf_core_dump':
    binfmt_elfo32.c:(.text+0x28a04): undefined reference to `elf_core_extra_phdrs'
    binfmt_elfo32.c:(.text+0x29330): undefined reference to `elf_core_extra_data_size'
    binfmt_elfo32.c:(.text+0x2951c): undefined reference to `elf_core_write_extra_phdrs'
    binfmt_elfo32.c:(.text+0x29710): undefined reference to `elf_core_write_extra_data'

    This is because binfmt_elfn32 and binfmt_elfo32 are using symbols from
    elfcore but for these configurations elfcore will not be built.

    Fixed by making elfcore selectable by a separate config symbol which
    unlike the current mechanism can also be used from other directories
    than kernel/, then having each flavor of ELF that relies on elfcore.o,
    select it in Kconfig, including CONFIG_MIPS32_N32 and CONFIG_MIPS32_O32
    which fixes this issue.

    Link: http://lkml.kernel.org/r/20160520141705.GA1913@linux-mips.org
    Signed-off-by: Ralf Baechle
    Reviewed-by: James Hogan
    Cc: "Maciej W. Rozycki"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     

15 Apr, 2015

1 commit

  • This fixes the "offset2lib" weakness in ASLR for arm, arm64, mips,
    powerpc, and x86. The problem is that if there is a leak of ASLR from
    the executable (ET_DYN), it means a leak of shared library offset as
    well (mmap), and vice versa. Further details and a PoC of this attack
    is available here:

    http://cybersecurity.upv.es/attacks/offset2lib/offset2lib.html

    With this patch, a PIE linked executable (ET_DYN) has its own ASLR
    region:

    $ ./show_mmaps_pie
    54859ccd6000-54859ccd7000 r-xp ... /tmp/show_mmaps_pie
    54859ced6000-54859ced7000 r--p ... /tmp/show_mmaps_pie
    54859ced7000-54859ced8000 rw-p ... /tmp/show_mmaps_pie
    7f75be764000-7f75be91f000 r-xp ... /lib/x86_64-linux-gnu/libc.so.6
    7f75be91f000-7f75beb1f000 ---p ... /lib/x86_64-linux-gnu/libc.so.6
    7f75beb1f000-7f75beb23000 r--p ... /lib/x86_64-linux-gnu/libc.so.6
    7f75beb23000-7f75beb25000 rw-p ... /lib/x86_64-linux-gnu/libc.so.6
    7f75beb25000-7f75beb2a000 rw-p ...
    7f75beb2a000-7f75beb4d000 r-xp ... /lib64/ld-linux-x86-64.so.2
    7f75bed45000-7f75bed46000 rw-p ...
    7f75bed46000-7f75bed47000 r-xp ...
    7f75bed47000-7f75bed4c000 rw-p ...
    7f75bed4c000-7f75bed4d000 r--p ... /lib64/ld-linux-x86-64.so.2
    7f75bed4d000-7f75bed4e000 rw-p ... /lib64/ld-linux-x86-64.so.2
    7f75bed4e000-7f75bed4f000 rw-p ...
    7fffb3741000-7fffb3762000 rw-p ... [stack]
    7fffb377b000-7fffb377d000 r--p ... [vvar]
    7fffb377d000-7fffb377f000 r-xp ... [vdso]

    The change is to add a call the newly created arch_mmap_rnd() into the
    ELF loader for handling ET_DYN ASLR in a separate region from mmap ASLR,
    as was already done on s390. Removes CONFIG_BINFMT_ELF_RANDOMIZE_PIE,
    which is no longer needed.

    Signed-off-by: Kees Cook
    Reported-by: Hector Marco-Gisbert
    Cc: Russell King
    Reviewed-by: Ingo Molnar
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Alexander Viro
    Cc: Oleg Nesterov
    Cc: Andy Lutomirski
    Cc: "David A. Long"
    Cc: Andrey Ryabinin
    Cc: Arun Chandran
    Cc: Yann Droneaud
    Cc: Min-Hua Chen
    Cc: Paul Burton
    Cc: Alex Smith
    Cc: Markos Chandras
    Cc: Vineeth Vijayan
    Cc: Jeff Bailey
    Cc: Michael Holzheu
    Cc: Ben Hutchings
    Cc: Behan Webster
    Cc: Ismael Ripoll
    Cc: Jan-Simon Mller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     

17 Feb, 2015

1 commit

  • The parisc arch has been the only user of HP-UX SOM binaries.

    Support for HP-UX executables was never finished and since we now drop support
    for the HP-UX compat layer anyway, it does not makes sense to keep the
    BINFMT_SOM support.

    Cc: linux-fsdevel@vger.kernel.org
    Cc: linux-parisc@vger.kernel.org
    Signed-off-by: Helge Deller

    Helge Deller
     

24 Nov, 2014

1 commit

  • MIPS is introducing new variants of its O32 ABI which differ in their
    handling of floating point, in order to enable a gradual transition
    towards a world where mips32 binaries can take advantage of new hardware
    features only available when configured for certain FP modes. In order
    to do this ELF binaries are being augmented with a new section that
    indicates, amongst other things, the FP mode requirements of the binary.
    The presence & location of such a section is indicated by a program
    header in the PT_LOPROC ... PT_HIPROC range.

    In order to allow the MIPS architecture code to examine the program
    header & section in question, pass all program headers in this range
    to an architecture-specific arch_elf_pt_proc function. This function
    may return an error if the header is deemed invalid or unsuitable for
    the system, in which case that error will be returned from
    load_elf_binary and upwards through the execve syscall.

    A means is required for the architecture code to make a decision once
    it is known that all such headers have been seen, but before it is too
    late to return from an execve syscall. For this purpose the
    arch_check_elf function is added, and called once, after all PT_LOPROC
    to PT_HIPROC headers have been passed to arch_elf_pt_proc but before
    the code which invoked execve has been lost. This enables the
    architecture code to make a decision based upon all the headers present
    in an ELF binary and its interpreter, as is required to forbid
    conflicting FP ABI requirements between an ELF & its interpreter.

    In order to allow data to be stored throughout the calls to the above
    functions, struct arch_elf_state is introduced.

    Finally a variant of the SET_PERSONALITY macro is introduced which
    accepts a pointer to the struct arch_elf_state, allowing it to act
    based upon state observed from the architecture specific program
    headers.

    Signed-off-by: Paul Burton
    Cc: linux-mips@linux-mips.org
    Cc: Alexander Viro
    Cc: linux-fsdevel@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/7679/
    Signed-off-by: Ralf Baechle

    Paul Burton
     

01 May, 2013

1 commit

  • Add a new configuration option CONFIG_BINFMT_SCRIPT to configure support
    for interpreted scripts starting with "#!"; allow compiling out that
    support, or building it as a module. Embedded systems running exclusively
    compiled binaries could leave this support out, and systems that don't
    need scripts before mounting the root filesystem can build this as a
    module.

    Signed-off-by: Josh Triplett
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Josh Triplett
     

06 Oct, 2012

1 commit

  • Adds an expert Kconfig option, CONFIG_COREDUMP, which allows disabling of
    core dump. This saves approximately 2.6k in the compiled kernel, and
    complements CONFIG_ELF_CORE, which now depends on it.

    CONFIG_COREDUMP also disables coredump-related sysctls, except for
    suid_dumpable and related functions, which are necessary for ptrace.

    [akpm@linux-foundation.org: fix binfmt_aout.c build]
    Signed-off-by: Alex Kelly
    Reviewed-by: Josh Triplett
    Acked-by: Serge Hallyn
    Acked-by: Kees Cook
    Cc: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alex Kelly
     

15 May, 2012

1 commit

  • C6x userspace supports a shared library mechanism called DSBT for systems with
    no MMU. DSBT is similar to FDPIC in allowing shared text segments and private
    copies of data segments without an MMU. Both methods access data using a base
    register and offset. With FDPIC, the caller of an external function sets up the
    base register for the callee. With DSBT, the called function sets up its own
    base register. Other details differ but both userspaces need the same thing
    from the kernel loader: a map of where each ELF segment was loaded. The FDPIC
    loader already provides this, so DSBT just uses it.

    This patch enables BINFMT_ELF_FDPIC by default for C6X and provides the
    necessary architecture hooks for the generic loader.

    Signed-off-by: Mark Salter

    Mark Salter
     

11 Jan, 2012

1 commit

  • Randomization of PIE load address is hard coded in binfmt_elf.c for X86
    and ARM. Create a new Kconfig variable
    (CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE) for this and use it instead. Thus
    architecture specific policy is pushed out of the generic binfmt_elf.c and
    into the architecture Kconfig files.

    X86 and ARM Kconfigs are modified to select the new variable so there is
    no change in behavior. A follow on patch will select it for MIPS too.

    Signed-off-by: David Daney
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Alexander Viro
    Acked-by: H. Peter Anvin
    Cc: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Daney
     

28 Oct, 2010

1 commit

  • The userland ELF tools have been coping with partial-segments core files
    for a few years now. Multiple distro builds are now setting this option.
    It behooves everyone who ever deals with core files to have more info
    dumped in there, especially as more and more people's compilers are
    producing build IDs. Make it the default.

    Anyone using older tools confused by these core files can configure this
    option off, or just change /proc/PID/coredump_filter after boot.

    Signed-off-by: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland McGrath
     

10 Jan, 2009

1 commit

  • Kernels that don't support ELF coredumps at all surely can't be supporting
    new partial-segment flavored ELF coredumps ... don't make folk answer
    Kconfig questions about that flavor.

    Signed-off-by: David Brownell
    Acked-by: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

20 Oct, 2008

1 commit

  • This adds a kconfig option to change the /proc/PID/coredump_filter default.
    Fedora has been carrying a trivial patch to change the hard-wired value for
    this default, since Fedora 8. The default default can't change safely
    because there are old GDB versions out there (all before 6.7) that are
    confused by the core dump files created by the MMF_DUMP_ELF_HEADERS setting.

    Signed-off-by: Roland McGrath
    Cc: Michael Kerrisk
    Cc: Oleg Nesterov
    Cc: Alan Cox
    Cc: Andi Kleen
    Cc: KOSAKI Motohiro
    Cc: Kawai Hidehiro
    Cc: Ingo Molnar
    Cc: David Jones
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland McGrath
     

17 Oct, 2008

1 commit


07 Sep, 2008

2 commits


28 Jul, 2008

1 commit


07 Jun, 2008

1 commit

  • Fix the following compile error:

    CC fs/binfmt_flat.o
    In file included from
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:36:
    /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/flat.h:14:22: error: asm/flat.h: No such file or directory
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c: In function 'create_flat_tables':
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:124: error: implicit declaration of function 'flat_stack_align'
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:125: error: implicit declaration of function 'flat_argvp_envp_on_stack'
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c: In function 'calc_reloc':
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:347: error: implicit declaration of function 'flat_reloc_valid'
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c: In function 'load_flat_file':
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:479: error: implicit declaration of function 'flat_old_ram_flag'
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:755: error: implicit declaration of function 'flat_set_persistent'
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:757: error: implicit declaration of function 'flat_get_relocate_addr'
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:765: error: implicit declaration of function 'flat_get_addr_from_rp'
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:781: error: implicit declaration of function 'flat_put_addr_at_rp'

    Reported-by: Adrian Bunk
    Signed-off-by: Adrian Bunk
    Tested-by: David Howells
    Acked-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     

29 Apr, 2008

1 commit

  • I have not yet seen anyone saying he has a reasonable use case for using
    BINFMT_FLAT modular on his embedded device.

    Considering that fs/binfmt_flat.c even lacks a MODULE_LICENSE() I really doubt
    there is any, and this patch therefore makes BINFMT_FLAT a bool.

    Signed-off-by: Adrian Bunk
    Acked-by: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     

22 Apr, 2008

1 commit


09 Feb, 2008

1 commit

  • Suppress A.OUT library support if CONFIG_ARCH_SUPPORTS_AOUT is not set.

    Not all architectures support the A.OUT binfmt, so the ELF binfmt should not
    be permitted to go looking for A.OUT libraries to load in such a case. Not
    only that, but under such conditions A.OUT core dumps are not produced either.

    To make this work, this patch also does the following:

    (1) Makes the existence of the contents of linux/a.out.h contingent on
    CONFIG_ARCH_SUPPORTS_AOUT.

    (2) Renames dump_thread() to aout_dump_thread() as it's only called by A.OUT
    core dumping code.

    (3) Moves aout_dump_thread() into asm/a.out-core.h and makes it inline. This
    is then included only where needed. This means that this bit of arch
    code will be stored in the appropriate A.OUT binfmt module rather than
    the core kernel.

    (4) Drops A.OUT support for Blackfin (according to Mike Frysinger it's not
    needed) and FRV.

    This patch depends on the previous patch to move STACK_TOP[_MAX] out of
    asm/a.out.h and into asm/processor.h as they're required whether or not A.OUT
    format is available.

    [jdike@addtoit.com: uml: re-remove accidentally restored code]
    Signed-off-by: David Howells
    Cc:
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     

30 Jan, 2008

1 commit

  • This adds Kconfig and Makefile bits to build fs/compat_binfmt_elf.c,
    just added. Each arch that wants to use this file needs to add a
    "select COMPAT_BINFMT_ELF" line in its Kconfig bits that enable COMPAT.

    Signed-off-by: Roland McGrath
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Roland McGrath