18 Mar, 2018

1 commit

  • commit 55fe6da9efba102866e2fb5b40b04b6a4b26c19e upstream.

    cmd_dt_S_dtb constructs the assembly source to incorporate a devicetree
    FDT (that is, the .dtb file) as binary data in the kernel image. This
    assembly source contains labels before and after the binary data. The
    label names incorporate the file name of the corresponding .dtb file.
    Hyphens are not legal characters in labels, so .dtb files built into the
    kernel with hyphens in the file name result in errors like the
    following:

    bcm3368-netgear-cvg834g.dtb.S: Assembler messages:
    bcm3368-netgear-cvg834g.dtb.S:5: Error: : no such section
    bcm3368-netgear-cvg834g.dtb.S:5: Error: junk at end of line, first unrecognized character is `-'
    bcm3368-netgear-cvg834g.dtb.S:6: Error: unrecognized opcode `__dtb_bcm3368-netgear-cvg834g_begin:'
    bcm3368-netgear-cvg834g.dtb.S:8: Error: unrecognized opcode `__dtb_bcm3368-netgear-cvg834g_end:'
    bcm3368-netgear-cvg834g.dtb.S:9: Error: : no such section
    bcm3368-netgear-cvg834g.dtb.S:9: Error: junk at end of line, first unrecognized character is `-'

    Fix this by updating cmd_dt_S_dtb to transform all hyphens from the file
    name to underscores when constructing the labels.

    As of v4.16-rc2, 1139 .dts files across ARM64, ARM, MIPS and PowerPC
    contain hyphens in their names, but the issue only currently manifests
    on Broadcom MIPS platforms, as that is the only place where such files
    are built into the kernel. For example when CONFIG_DT_NETGEAR_CVG834G=y,
    or on BMIPS kernels when the dtbs target is used (in the latter case it
    admittedly shouldn't really build all the dtb.o files, but thats a
    separate issue).

    Fixes: 695835511f96 ("MIPS: BMIPS: rename bcm96358nb4ser to bcm6358-neufbox4-sercom")
    Signed-off-by: James Hogan
    Reviewed-by: Frank Rowand
    Cc: Rob Herring
    Cc: Michal Marek
    Cc: Ralf Baechle
    Cc: Florian Fainelli
    Cc: Kevin Cernekee
    Cc: # 4.9+
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Greg Kroah-Hartman

    James Hogan
     

25 Feb, 2018

1 commit

  • [ Upstream commit e814bccbafece52a24e152d2395b5d49eef55841 ]

    My bisect scripts starting running into build failures when trying to
    compile 4.15-rc1 with the builds failing with things like:

    drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2078: error: Cannot parse struct or union!

    The line in question is actually just a #define, but after some digging
    it turns out that my scripts pass W=1 and since commit 3a025e1d1c2ea
    ("Add optional check for bad kernel-doc comments") that results in
    kernel-doc running on each source file. The file in question has a
    badly formatted comment immediately before the #define:

    /**
    * struct brcmf_skbuff_cb reserves first two bytes in sk_buff::cb for
    * bus layer usage.
    */

    which causes the regex in dump_struct to fail (lack of braces following
    struct declaration) and kernel-doc returns 1, which causes the build
    to fail.

    Fix the issue by always returning 0 from kernel-doc when invoked with
    -none. It successfully generates no documentation, and prints out any
    issues.

    Cc: Matthew Wilcox
    Cc: Jonathan Corbet
    Signed-off-by: Will Deacon
    Signed-off-by: Jonathan Corbet
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Will Deacon
     

13 Feb, 2018

1 commit

  • (cherry picked from commit caf7501a1b4ec964190f31f9c3f163de252273b8)

    There's a risk that a kernel which has full retpoline mitigations becomes
    vulnerable when a module gets loaded that hasn't been compiled with the
    right compiler or the right option.

    To enable detection of that mismatch at module load time, add a module info
    string "retpoline" at build time when the module was compiled with
    retpoline support. This only covers compiled C source, but assembler source
    or prebuilt object files are not checked.

    If a retpoline enabled kernel detects a non retpoline protected module at
    load time, print a warning and report it in the sysfs vulnerability file.

    [ tglx: Massaged changelog ]

    Signed-off-by: Andi Kleen
    Signed-off-by: Thomas Gleixner
    Cc: David Woodhouse
    Cc: gregkh@linuxfoundation.org
    Cc: torvalds@linux-foundation.org
    Cc: jeyu@kernel.org
    Cc: arjan@linux.intel.com
    Link: https://lkml.kernel.org/r/20180125235028.31211-1-andi@firstfloor.org
    Signed-off-by: David Woodhouse
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     

24 Jan, 2018

1 commit

  • commit 883d50f56d263f70fd73c0d96b09eb36c34e9305 upstream.

    Since kernel 4.9, the thread_info has been moved into task_struct, no
    longer locates at the bottom of kernel stack.

    See commits c65eacbe290b ("sched/core: Allow putting thread_info into
    task_struct") and 15f4eae70d36 ("x86: Move thread_info into
    task_struct").

    Before fix:
    (gdb) set $current = $lx_current()
    (gdb) p $lx_thread_info($current)
    $1 = {flags = 1470918301}
    (gdb) p $current.thread_info
    $2 = {flags = 2147483648}

    After fix:
    (gdb) p $lx_thread_info($current)
    $1 = {flags = 2147483648}
    (gdb) p $current.thread_info
    $2 = {flags = 2147483648}

    Link: http://lkml.kernel.org/r/20180118210159.17223-1-imxikangjie@gmail.com
    Fixes: 15f4eae70d36 ("x86: Move thread_info into task_struct")
    Signed-off-by: Xi Kangjie
    Acked-by: Jan Kiszka
    Acked-by: Kieran Bingham
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Xi Kangjie
     

17 Jan, 2018

1 commit

  • commit e390f9a9689a42f477a6073e2e7df530a4c1b740 upstream.

    The '__unreachable' and '__func_stack_frame_non_standard' sections are
    only used at compile time. They're discarded for vmlinux but they
    should also be discarded for modules.

    Since this is a recurring pattern, prefix the section names with
    ".discard.". It's a nice convention and vmlinux.lds.h already discards
    such sections.

    Also remove the 'a' (allocatable) flag from the __unreachable section
    since it doesn't make sense for a discarded section.

    Suggested-by: Linus Torvalds
    Signed-off-by: Josh Poimboeuf
    Cc: Jessica Yu
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Fixes: d1091c7fa3d5 ("objtool: Improve detection of BUG() and other dead ends")
    Link: http://lkml.kernel.org/r/20170301180444.lhd53c5tibc4ns77@treble
    Signed-off-by: Ingo Molnar
    [dwmw2: Remove the unreachable part in backporting since it's not here yet]
    Signed-off-by: David Woodhouse
    Signed-off-by: Greg Kroah-Hartman

    Josh Poimboeuf
     

14 Dec, 2017

3 commits

  • [ Upstream commit d7059ca0147adcd495f3c5b41f260e1ac55bb679 ]

    The command "make -j8 C=1 CHECK=scripts/coccicheck" produces
    lots of "coccicheck failed" error messages.

    Julia Lawall explained the Coccinelle behavior as follows:
    "The problem on the Coccinelle side is that it uses a subdirectory
    with the name of the semantic patch to store standard output and
    standard error for the different threads. I didn't want to use a
    name with the pid, so that one could easily find this information
    while Coccinelle is running. Normally the subdirectory is cleaned
    up when Coccinelle completes, so there is only one of them at a time.
    Maybe it is best to just add the pid. There is the risk that these
    subdirectories will accumulate if Coccinelle crashes in a way such
    that they don't get cleaned up, but Coccinelle could print a warning
    if it detects this case, rather than failing."

    When scripts/coccicheck is used as CHECK tool and -j option is given
    to Make, the whole of build process runs in parallel. So, multiple
    processes try to get access to the same subdirectory.

    I notice spatch creates the subdirectory only when it runs in parallel
    (i.e. --jobs is given and is greater than 1).

    Setting NPROC=1 is a reasonable solution; spatch does not create the
    subdirectory. Besides, ONLINE=1 mode takes a single file input for
    each spatch invocation, so there is no reason to parallelize it in
    the first place.

    Signed-off-by: Masahiro Yamada
    Acked-by: Julia Lawall
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Masahiro Yamada
     
  • [ Upstream commit 2dbc644ac62bbcb9ee78e84719953f611be0413d ]

    For rpm-pkg and deb-pkg, a source tar file is created. All paths in
    the archive must be prefixed with the base name of the tar so that
    everything is contained in the directory when you extract it.

    Currently, scripts/package/Makefile uses a symlink for that, and
    removes it after the tar is created.

    If you terminate the build during the tar creation, the symlink is
    left over. Then, at the next package build, you will see a warning
    like follows:

    ln: '.' and 'kernel-4.14.0+/.' are the same file

    It is possible to fix it by adding -n (--no-dereference) option to
    the "ln" command, but a cleaner way is to use --transform option
    of "tar" command. This option is GNU extension, but it should not
    hurt to use it in the Linux build system.

    The 'S' flag is needed to exclude symlinks from the path fixup.
    Without it, symlinks in the kernel are broken.

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

    Masahiro Yamada
     
  • [ Upstream commit ab42632156becd35d3884ee5c14da2bedbf3149a ]

    For powerpc the __jump_table section in modules is not aligned, this
    causes a WARN_ON() splat when loading a module containing a __jump_table.

    Strict alignment became necessary with commit 3821fd35b58d
    ("jump_label: Reduce the size of struct static_key"), currently in
    linux-next, which uses the two least significant bits of pointers to
    __jump_table elements.

    Fix by forcing __jump_table to 8, which is the same alignment used for
    this section in the kernel proper.

    Link: http://lkml.kernel.org/r/20170301220453.4756-1-david.daney@cavium.com

    Reviewed-by: Jason Baron
    Acked-by: Jessica Yu
    Acked-by: Michael Ellerman (powerpc)
    Tested-by: Sachin Sant
    Signed-off-by: David Daney
    Signed-off-by: Steven Rostedt (VMware)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    David Daney
     

21 Jul, 2017

1 commit

  • commit 8d81ae05d0176da1c54aeaed697fa34be5c5575e upstream.

    As of perl 5, version 26, subversion 0 (v5.26.0) some new warnings have
    occurred when running checkpatch.

    Unescaped left brace in regex is deprecated here (and will be fatal in
    Perl 5.30), passed through in regex; marked by
    Acked-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Cyril Bur
     

12 Jan, 2017

1 commit

  • commit 81d873a87114b05dbb74d1fbf0c4322ba4bfdee4 upstream.

    This updates gcc-common.h from Emese Revfy for gcc 7. This fixes issues seen
    by Kugan and Arnd. Build tested with gcc 5.4 and 7 snapshot.

    Signed-off-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Kees Cook
     

09 Jan, 2017

2 commits

  • commit 79e51b5c2deea542b3bb8c66e0d502230b017dde upstream.

    Currently it is impossible to edit the value of a config symbol with a
    prompt longer than (terminal width - 2) characters. dialog_inputbox()
    calculates a negative x-offset for the input window and newwin() fails
    as this is invalid. It also doesn't check for this failure, so it
    busy-loops calling wgetch(NULL) which immediately returns -1.

    The additions in the offset calculations also don't match the intended
    size of the window.

    Limit the window size and calculate the offset similarly to
    show_scroll_win().

    Fixes: 692d97c380c6 ("kconfig: new configuration interface (nconfig)")
    Signed-off-by: Ben Hutchings
    Signed-off-by: Greg Kroah-Hartman

    Ben Hutchings
     
  • commit 9988f4d577f42f43b7612d755477585f35424af7 upstream.

    This fixes build errors seen on gcc-4.9.3 or gcc-5.3.1 for an ARM:

    arm-soc/init/initramfs.c: In function 'error':
    arm-soc/init/initramfs.c:50:1: error: unrecognizable insn:
    }
    ^
    (insn 26 25 27 5 (set (reg:SI 111 [ local_entropy.243 ])
    (rotatert:SI (reg:SI 116 [ local_entropy.243 ])
    (const_int -30 [0xffffffffffffffe2]))) -1
    (nil))

    Patch from PaX Team

    Reported-by: Arnd Bergmann
    Reported-by: Brad Spengler
    Signed-off-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Kees Cook
     

06 Jan, 2017

1 commit

  • commit 152b695d74376bfe55cd2a6265ccc75b0d39dd19 upstream.

    Both Debian and kernel archs are "arm64" but UTS_MACHINE and gcc say
    "aarch64". Recognizing just the latter should be enough but let's
    accept both in case something regresses again or an user sets
    UTS_MACHINE=arm64.

    Regressed in cfa88c7: arm64: Set UTS_MACHINE in the Makefile.

    Signed-off-by: Adam Borowski
    Acked-by: Riku Voipio
    Signed-off-by: Michal Marek
    Signed-off-by: Greg Kroah-Hartman

    Adam Borowski
     

02 Dec, 2016

1 commit

  • Some people are able to trigger a race where autoksyms.h is used before
    its empty version is even created. Let's create it at the same time as
    the directory holding it is created.

    Signed-off-by: Nicolas Pitre
    Tested-by: Prarit Bhargava
    Tested-by: Jarod Wilson
    Signed-off-by: Linus Torvalds

    Nicolas Pitre
     

19 Nov, 2016

1 commit

  • Pull kbuild fixes from Michal Marek:
    "Here are some regression fixes for kbuild:

    - modversion support for exported asm symbols (Nick Piggin). The
    affected architectures need separate patches adding
    asm-prototypes.h.

    - fix rebuilds of lib-ksyms.o (Nick Piggin)

    - -fno-PIE builds (Sebastian Siewior and Borislav Petkov). This is
    not a kernel regression, but one of the Debian gcc package.
    Nevertheless, it's quite annoying, so I think it should go into
    mainline and stable now"

    * 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    kbuild: Steal gcc's pie from the very beginning
    kbuild: be more careful about matching preprocessed asm ___EXPORT_SYMBOL
    x86/kexec: add -fno-PIE
    scripts/has-stack-protector: add -fno-PIE
    kbuild: add -fno-PIE
    kbuild: modversions for EXPORT_SYMBOL() for asm
    kbuild: prevent lib-ksyms.o rebuilds

    Linus Torvalds
     

12 Nov, 2016

4 commits

  • Merge fixes for -Wmaybe-uninitialized from Arnd Bergmann:
    "It took a while for some patches to make it into mainline through
    maintainer trees, but the 28-patch series is now reduced to 10, with
    one tiny patch added at the end.

    Aside from patches that are no longer required, I did these changes
    compared to version 1:

    - Dropped "iio: maxim_thermocouple: detect invalid storage size in
    read()", which is currently in linux-next as commit 32cb7d27e65d.
    This is the only remaining warning I see for a couple of corner
    cases (kbuild bot reports it on blackfin, kernelci bot and arm-soc
    bot both report it on arm64)

    - Dropped "brcmfmac: avoid maybe-uninitialized warning in
    brcmf_cfg80211_start_ap", which is currently in net/master merge
    pending.

    - Dropped two x86 patches, "x86: math-emu: possible uninitialized
    variable use" and "x86: mark target address as output in 'insb'
    asm" as they do not seem to trigger for a default build, and I got
    no feedback on them. Both of these are ancient issues and seem
    harmless, I will send them again to the x86 maintainers once the
    rest is merged.

    - Dropped "rbd: false-postive gcc-4.9 -Wmaybe-uninitialized" based on
    feedback from Ilya Dryomov, who already has a different fix queued
    up for v4.10. The kbuild bot reports this as a warning for xtensa.

    - Replaced "crypto: aesni: avoid -Wmaybe-uninitialized warning" with
    a simpler patch, this one always triggers but my first solution
    would not be safe for linux-4.9 any more at this point. I'll follow
    up with the larger patch as a cleanup for 4.10.

    - Replaced "dib0700: fix nec repeat handling" with a better one,
    contributed by Sean Young"

    * -Wmaybe-uninitialized fixes:
    Kbuild: enable -Wmaybe-uninitialized warnings by default
    pcmcia: fix return value of soc_pcmcia_regulator_set
    infiniband: shut up a maybe-uninitialized warning
    crypto: aesni: shut up -Wmaybe-uninitialized warning
    rc: print correct variable for z8f0811
    dib0700: fix nec repeat handling
    s390: pci: don't print uninitialized data for debugging
    nios2: fix timer initcall return value
    x86: apm: avoid uninitialized data
    NFSv4.1: work around -Wmaybe-uninitialized warning
    Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"

    Linus Torvalds
     
  • Previously the warnings were added back at the W=1 level and above, this
    now turns them on again by default, assuming that we have addressed all
    warnings and again have a clean build for v4.10.

    I found a number of new warnings in linux-next already and submitted
    bugfixes for those. Hopefully they are caught by the 0day builder in
    the future as soon as this patch is merged.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     
  • Traditionally, we have always had warnings about uninitialized variables
    enabled, as this is part of -Wall, and generally a good idea [1], but it
    also always produced false positives, mainly because this is a variation
    of the halting problem and provably impossible to get right in all cases
    [2].

    Various people have identified cases that are particularly bad for false
    positives, and in commit e74fc973b6e5 ("Turn off -Wmaybe-uninitialized
    when building with -Os"), I turned off the warning for any build that
    was done with CC_OPTIMIZE_FOR_SIZE. This drastically reduced the number
    of false positive warnings in the default build but unfortunately had
    the side effect of turning the warning off completely in 'allmodconfig'
    builds, which in turn led to a lot of warnings (both actual bugs, and
    remaining false positives) to go in unnoticed.

    With commit 877417e6ffb9 ("Kbuild: change CC_OPTIMIZE_FOR_SIZE
    definition") enabled the warning again for allmodconfig builds in v4.7
    and in v4.8-rc1, I had finally managed to address all warnings I get in
    an ARM allmodconfig build and most other maybe-uninitialized warnings
    for ARM randconfig builds.

    However, commit 6e8d666e9253 ("Disable "maybe-uninitialized" warning
    globally") was merged at the same time and disabled it completely for
    all configurations, because of false-positive warnings on x86 that I had
    not addressed until then. This caused a lot of actual bugs to get
    merged into mainline, and I sent several dozen patches for these during
    the v4.9 development cycle. Most of these are actual bugs, some are for
    correct code that is safe because it is only called under external
    constraints that make it impossible to run into the case that gcc sees,
    and in a few cases gcc is just stupid and finds something that can
    obviously never happen.

    I have now done a few thousand randconfig builds on x86 and collected
    all patches that I needed to address every single warning I got (I can
    provide the combined patch for the other warnings if anyone is
    interested), so I hope we can get the warning back and let people catch
    the actual bugs earlier.

    This reverts the change to disable the warning completely and for now
    brings it back at the "make W=1" level, so we can get it merged into
    mainline without introducing false positives. A follow-up patch enables
    it on all levels unless some configuration option turns it off because
    of false-positives.

    Link: https://rusty.ozlabs.org/?p=232 [1]
    Link: https://gcc.gnu.org/wiki/Better_Uninitialized_Warnings [2]
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     
  • Fix piping output to a program which quickly exits (read: head -n1)

    $ ./scripts/bloat-o-meter ../vmlinux-000 ../obj/vmlinux | head -n1
    add/remove: 0/0 grow/shrink: 9/60 up/down: 124/-305 (-181)
    close failed in file object destructor:
    sys.excepthook is missing
    lost sys.stderr

    Link: http://lkml.kernel.org/r/20161028204618.GA29923@avx2
    Signed-off-by: Alexey Dobriyan
    Cc: Matt Mackall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

10 Nov, 2016

2 commits

  • The CRC code for asm exports grabs the preprocessed asm, finds the
    ___EXPORT_SYMBOL and turns those into EXPORT_SYMBOL in a C program
    that can be preprocessed and parsed to create the CRC signatures from
    the type.

    The existing regex matching and replacement is too strict, and doesn't
    deal well with whitespace among other things. The line
    " EXPORT_SYMBOL(sym)" in a .S file would not match due to initial
    whitespace, for example, which resulted in x86's ___preempt_schedule
    failing to get CRCs.

    Reported-by: Philip Müller
    Signed-off-by: Nicholas Piggin
    Signed-off-by: Michal Marek

    Nicholas Piggin
     
  • Adding -no-PIE to the fstack protector check. -no-PIE was introduced
    before -fstack-protector so there is no need for a runtime check.

    Without it the build stops:
    |Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong available but compiler is broken

    due to -mcmodel=kernel + -fPIE if -fPIE is enabled by default.

    Tagging it stable so it is possible to compile recent stable kernels as
    well.

    Cc: stable@vger.kernel.org
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Michal Marek

    Sebastian Andrzej Siewior
     

01 Nov, 2016

3 commits


23 Oct, 2016

1 commit


16 Oct, 2016

1 commit

  • Pull gcc plugins update from Kees Cook:
    "This adds a new gcc plugin named "latent_entropy". It is designed to
    extract as much possible uncertainty from a running system at boot
    time as possible, hoping to capitalize on any possible variation in
    CPU operation (due to runtime data differences, hardware differences,
    SMP ordering, thermal timing variation, cache behavior, etc).

    At the very least, this plugin is a much more comprehensive example
    for how to manipulate kernel code using the gcc plugin internals"

    * tag 'gcc-plugins-v4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    latent_entropy: Mark functions with __latent_entropy
    gcc-plugins: Add latent_entropy plugin

    Linus Torvalds
     

15 Oct, 2016

2 commits

  • Pull misc kbuild changes from Michal Marek:
    "Just a few patches on the kbuild.git#misc branch this time:

    - New Coccinelle patch by Nicholas Mc Guire
    - Existing patch fixes by Julia Lawall
    - Minor comment fix by Markus Elfring"

    * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    Coccinelle: flag conditions with no effect
    scripts/coccicheck: Update reference for the corresponding documentation
    Coccinelle: pm_runtime: ensure relevance of pm_runtime reports
    Coccinelle: limit memdup_user transformation to GFP_KERNEL case

    Linus Torvalds
     
  • Pull kbuild updates from Michal Marek:

    - EXPORT_SYMBOL for asm source by Al Viro.

    This does bring a regression, because genksyms no longer generates
    checksums for these symbols (CONFIG_MODVERSIONS). Nick Piggin is
    working on a patch to fix this.

    Plus, we are talking about functions like strcpy(), which rarely
    change prototypes.

    - Fixes for PPC fallout of the above by Stephen Rothwell and Nick
    Piggin

    - fixdep speedup by Alexey Dobriyan.

    - preparatory work by Nick Piggin to allow architectures to build with
    -ffunction-sections, -fdata-sections and --gc-sections

    - CONFIG_THIN_ARCHIVES support by Stephen Rothwell

    - fix for filenames with colons in the initramfs source by me.

    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: (22 commits)
    initramfs: Escape colons in depfile
    ppc: there is no clear_pages to export
    powerpc/64: whitelist unresolved modversions CRCs
    kbuild: -ffunction-sections fix for archs with conflicting sections
    kbuild: add arch specific post-link Makefile
    kbuild: allow archs to select link dead code/data elimination
    kbuild: allow architectures to use thin archives instead of ld -r
    kbuild: Regenerate genksyms lexer
    kbuild: genksyms fix for typeof handling
    fixdep: faster CONFIG_ search
    ia64: move exports to definitions
    sparc32: debride memcpy.S a bit
    [sparc] unify 32bit and 64bit string.h
    sparc: move exports to definitions
    ppc: move exports to definitions
    arm: move exports to definitions
    s390: move exports to definitions
    m68k: move exports to definitions
    alpha: move exports to actual definitions
    x86: move exports to actual definitions
    ...

    Linus Torvalds
     

12 Oct, 2016

12 commits

  • Vim, with the omnicppcomplete(#1) plugin, can do code completion using
    information build by ctags. Add flags needed by omnicppcomplete(#2) to
    have completion on member of structure.

    1: https://github.com/vim-scripts/omnicppcomplete
    2: https://github.com/vim-scripts/OmniCppComplete/blob/master/doc/omnicppcomplete.txt#L93

    Link: http://lkml.kernel.org/r/20160830191546.4469-1-mathieu.maret@gmail.com
    Signed-off-by: Mathieu Maret
    Cc: Michal Marek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Maret
     
  • The function calls with octal permissions commonly span multiple lines.
    The current test is line oriented and fails to find some matches.

    Make the test use the $stat variable instead of the $line variable to span
    multiple lines.

    Also add a few functions to the known functions with permissions list.

    Move the SYMBOLIC_PERMS test to a separate section to find all the S_
    permissions in any form not just those that have specific function names.

    This can now find and fix permissions uses like:
    .mode = S_ | S_;

    Link: http://lkml.kernel.org/r/b51bab60530912aae4ac420119d465c5b206f19f.1475030406.git.joe@perches.com
    Signed-off-by: Joe Perches
    Tested-by: Ramiro Oliveira
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Function definitions without identifiers like
    int foo(int)
    are not preferred. Emit a warning when they occur.

    Link: http://lkml.kernel.org/r/94fe6378504745991b650f48fc92bb4648f25706.1474925354.git.joe@perches.com
    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • It is possible for a multiple line macro definition to have a false positive
    report when an argument is used on a line after a continuation \.

    This line might have a leading '+' as the initial character that could be
    confused by checkpatch as an operator.

    Avoid the leading character on multiple line macro definitions.

    Link: http://lkml.kernel.org/r/60229d13399f9b6509db5a32e30d4c16951a60cd.1473836073.git.joe@perches.com
    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Add a test for macro arguents that have a non-comma leading or trailing
    operator where the argument isn't parenthesized to avoid possible precedence
    issues.

    Link: http://lkml.kernel.org/r/47715508972f8d786f435e583ff881dbeee3a114.1473745855.git.joe@perches.com
    Signed-off-by: Joe Perches
    Cc: Andy Whitcroft
    Cc: Julia Lawall
    Cc: Dan Carpenter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • If a macro argument is used multiple times in the macro definition, the
    macro argument may have an unexpected side-effect.

    Add a test (MACRO_ARG_REUSE) for that condition which is only
    emitted with command-line option --strict.

    Link: http://lkml.kernel.org/r/b6d67a87cafcafd15499e91780dc63b15dec0aa0.1473744906.git.joe@perches.com
    Signed-off-by: Joe Perches
    Cc: Andy Whitcroft
    Cc: Julia Lawall
    Cc: Dan Carpenter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • An "uninitialized value" is emitted when a block comment starts on
    the same line as a statement.

    Fix this and make the test use a little fewer cpu cycles too.

    Link: http://lkml.kernel.org/r/3c9993320c2182d37f53ac540878cfef59c3f62d.1473365956.git.joe@perches.com
    Signed-off-by: Joe Perches
    Reported-by: Charlemagne Lasse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Adding -f to the get_maintainer.pl invocation means git isn't invoked
    by get_maintainer.pl for known filenames.

    This reduces the overall time to run checkpatch.

    Link: http://lkml.kernel.org/r/22991e3a295aeb399b43af0478b6e5809106ccee.1472684066.git.joe@perches.com
    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Using const is generally a good idea.

    Julia Lawall has created a list of always const and almost always const
    structs in the kernel sources.

    Link: https://lkml.org/lkml/2016/8/28/95

    Add the most frequently used (> 50 cases) that are almost always or
    always const.

    Link: http://lkml.kernel.org/r/1e16020f8027654db0095bbfbcc11da51025365c.1472664220.git.joe@perches.com
    Signed-off-by: Joe Perches
    Acked-by: Kees Cook
    Cc: Julia Lawall
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Make it easier to add new structs that should be const.

    Link: http://lkml.kernel.org/r/e5a8da43e7c11525bafbda1ca69a8323614dd942.1472664220.git.joe@perches.com
    Signed-off-by: Joe Perches
    Cc: Julia Lawall
    Cc: Kees Cook
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • < sigh > Comment these tests out.

    These are just too enticing to people that don't verify that
    both source and dest addresses really must be __aligned(2).

    It helps make Dan Carpenter happy too.

    Link: http://lkml.kernel.org/r/dc32ec66d24647f4cdf824c8dfbbc59aa7ce7b7d.1472665676.git.joe@perches.com
    Signed-off-by: Joe Perches
    Cc: Dan Carpenter
    Cc: Greg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Warn when block comments are not aligned on the *

    /*
    * block comment, no warning
    */

    /*
    * block comment, emit warning
    */

    Link: http://lkml.kernel.org/r/edb57bd330adfe024b95ec2a807d4aa7f0c8b112.1472261299.git.joe@perches.com
    Signed-off-by: Joe Perches
    Reported-by: Sudip Mukherjee
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches