23 Nov, 2015

1 commit

  • There were still a number of references to my old Red Hat email
    address in the kernel source. Remove these while keeping the
    Red Hat copyright notices intact.

    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Vince Weaver
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

11 Nov, 2015

3 commits

  • Merge final patch-bomb from Andrew Morton:
    "Various leftovers, mainly Christoph's pci_dma_supported() removals"

    * emailed patches from Andrew Morton :
    pci: remove pci_dma_supported
    usbnet: remove ifdefed out call to dma_supported
    kaweth: remove ifdefed out call to dma_supported
    sfc: don't call dma_supported
    nouveau: don't call pci_dma_supported
    netup_unidvb: use pci_set_dma_mask insted of pci_dma_supported
    cx23885: use pci_set_dma_mask insted of pci_dma_supported
    cx25821: use pci_set_dma_mask insted of pci_dma_supported
    cx88: use pci_set_dma_mask insted of pci_dma_supported
    saa7134: use pci_set_dma_mask insted of pci_dma_supported
    saa7164: use pci_set_dma_mask insted of pci_dma_supported
    tw68-core: use pci_set_dma_mask insted of pci_dma_supported
    pcnet32: use pci_set_dma_mask insted of pci_dma_supported
    lib/string.c: add ULL suffix to the constant definition
    hugetlb: trivial comment fix
    selftests/mlock2: add ULL suffix to 64-bit constants
    selftests/mlock2: add missing #define _GNU_SOURCE

    Linus Torvalds
     
  • Pull networking fixes from David Miller:

    1) Fix null deref in xt_TEE netfilter module, from Eric Dumazet.

    2) Several spots need to get to the original listner for SYN-ACK
    packets, most spots got this ok but some were not. Whilst covering
    the remaining cases, create a helper to do this. From Eric Dumazet.

    3) Missiing check of return value from alloc_netdev() in CAIF SPI code,
    from Rasmus Villemoes.

    4) Don't sleep while != TASK_RUNNING in macvtap, from Vlad Yasevich.

    5) Use after free in mvneta driver, from Justin Maggard.

    6) Fix race on dst->flags access in dst_release(), from Eric Dumazet.

    7) Add missing ZLIB_INFLATE dependency for new qed driver. From Arnd
    Bergmann.

    8) Fix multicast getsockopt deadlock, from WANG Cong.

    9) Fix deadlock in btusb, from Kuba Pawlak.

    10) Some ipv6_add_dev() failure paths were not cleaning up the SNMP6
    counter state. From Sabrina Dubroca.

    11) Fix packet_bind() race, which can cause lost notifications, from
    Francesco Ruggeri.

    12) Fix MAC restoration in qlcnic driver during bonding mode changes,
    from Jarod Wilson.

    13) Revert bridging forward delay change which broke libvirt and other
    userspace things, from Vlad Yasevich.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (65 commits)
    Revert "bridge: Allow forward delay to be cfgd when STP enabled"
    bpf_trace: Make dependent on PERF_EVENTS
    qed: select ZLIB_INFLATE
    net: fix a race in dst_release()
    net: mvneta: Fix memory use after free.
    net: Documentation: Fix default value tcp_limit_output_bytes
    macvtap: Resolve possible __might_sleep warning in macvtap_do_read()
    mvneta: add FIXED_PHY dependency
    net: caif: check return value of alloc_netdev
    net: hisilicon: NET_VENDOR_HISILICON should depend on HAS_DMA
    drivers: net: xgene: fix RGMII 10/100Mb mode
    netfilter: nft_meta: use skb_to_full_sk() helper
    net_sched: em_meta: use skb_to_full_sk() helper
    sched: cls_flow: use skb_to_full_sk() helper
    netfilter: xt_owner: use skb_to_full_sk() helper
    smack: use skb_to_full_sk() helper
    net: add skb_to_full_sk() helper and use it in selinux_netlbl_skbuff_setsid()
    bpf: doc: correct arch list for supported eBPF JIT
    dwc_eth_qos: Delete an unnecessary check before the function call "of_node_put"
    bonding: fix panic on non-ARPHRD_ETHER enslave failure
    ...

    Linus Torvalds
     
  • 8-byte constant is too big for long and compiler complains about this.

    lib/string.c:907:20: warning: constant 0x0101010101010101 is so big it is long

    Append ULL suffix to explicitly show its type.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     

10 Nov, 2015

3 commits

  • Merge third patch-bomb from Andrew Morton:
    "We're pretty much done over here - I'm still waiting for a nouveau
    merge so I can cleanly finish up Christoph's dma-mapping rework.

    - bunch of small misc stuff

    - fold abs64() into abs(), remove abs64()

    - new_valid_dev() cleanups

    - binfmt_elf_fdpic feature work"

    * emailed patches from Andrew Morton : (24 commits)
    fs/binfmt_elf_fdpic.c: provide NOMMU loader for regular ELF binaries
    fs/stat.c: remove unnecessary new_valid_dev() check
    fs/reiserfs/namei.c: remove unnecessary new_valid_dev() check
    fs/nilfs2/namei.c: remove unnecessary new_valid_dev() check
    fs/ncpfs/dir.c: remove unnecessary new_valid_dev() check
    fs/jfs: remove unnecessary new_valid_dev() checks
    fs/hpfs/namei.c: remove unnecessary new_valid_dev() check
    fs/f2fs/namei.c: remove unnecessary new_valid_dev() check
    fs/ext2/namei.c: remove unnecessary new_valid_dev() check
    fs/exofs/namei.c: remove unnecessary new_valid_dev() check
    fs/btrfs/inode.c: remove unnecessary new_valid_dev() check
    fs/9p: remove unnecessary new_valid_dev() checks
    include/linux/kdev_t.h: old/new_valid_dev() can return bool
    include/linux/kdev_t.h: remove unused huge_valid_dev()
    kmap_atomic_to_page() has no users, remove it
    drivers/scsi/cxgbi: fix build with EXTRA_CFLAGS
    dma: remove external references to dma_supported
    Documentation/sysctl/vm.txt: fix misleading code reference of overcommit_memory
    remove abs64()
    kernel.h: make abs() work with 64-bit types
    ...

    Linus Torvalds
     
  • Pull module updates from Rusty Russell:
    "Nothing exciting, minor tweaks and cleanups"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    scripts: [modpost] add new sections to white list
    modpost: Add flag -E for making section mismatches fatal
    params: don't ignore the rest of cmdline if parse_one() fails
    modpost: abort if a module symbol is too long

    Linus Torvalds
     
  • Switch everything to the new and more capable implementation of abs().
    Mainly to give the new abs() a bit of a workout.

    Cc: Michal Nazarewicz
    Cc: John Stultz
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Peter Zijlstra
    Cc: Masami Hiramatsu
    Cc: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

08 Nov, 2015

1 commit

  • Merge second patch-bomb from Andrew Morton:

    - most of the rest of MM

    - procfs

    - lib/ updates

    - printk updates

    - bitops infrastructure tweaks

    - checkpatch updates

    - nilfs2 update

    - signals

    - various other misc bits: coredump, seqfile, kexec, pidns, zlib, ipc,
    dma-debug, dma-mapping, ...

    * emailed patches from Andrew Morton : (102 commits)
    ipc,msg: drop dst nil validation in copy_msg
    include/linux/zutil.h: fix usage example of zlib_adler32()
    panic: release stale console lock to always get the logbuf printed out
    dma-debug: check nents in dma_sync_sg*
    dma-mapping: tidy up dma_parms default handling
    pidns: fix set/getpriority and ioprio_set/get in PRIO_USER mode
    kexec: use file name as the output message prefix
    fs, seqfile: always allow oom killer
    seq_file: reuse string_escape_str()
    fs/seq_file: use seq_* helpers in seq_hex_dump()
    coredump: change zap_threads() and zap_process() to use for_each_thread()
    coredump: ensure all coredumping tasks have SIGNAL_GROUP_COREDUMP
    signal: remove jffs2_garbage_collect_thread()->allow_signal(SIGCONT)
    signal: introduce kernel_signal_stop() to fix jffs2_garbage_collect_thread()
    signal: turn dequeue_signal_lock() into kernel_dequeue_signal()
    signals: kill block_all_signals() and unblock_all_signals()
    nilfs2: fix gcc uninitialized-variable warnings in powerpc build
    nilfs2: fix gcc unused-but-set-variable warnings
    MAINTAINERS: nilfs2: add header file for tracing
    nilfs2: add tracepoints for analyzing reading and writing metadata files
    ...

    Linus Torvalds
     

07 Nov, 2015

18 commits

  • Like dma_unmap_sg, dma_sync_sg* should be called with the original number
    of entries passed to dma_map_sg, so do the same check in the sync path as
    we do in the unmap path.

    Signed-off-by: Robin Murphy
    Cc: Arnd Bergmann
    Cc: Marek Szyprowski
    Cc: Sumit Semwal
    Cc: Sakari Ailus
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robin Murphy
     
  • There is a classical off-by-one error in case when we try to place, for
    example, 1+1 bytes as hex in the buffer of size 6. The expected result is
    to get an output truncated, but in the reality we get 6 bytes filed
    followed by terminating NUL.

    Change the logic how we fill the output in case of byte dumping into
    limited space. This will follow the snprintf() behaviour by truncating
    output even on half bytes.

    Fixes: 114fc1afb2de (hexdump: make it return number of bytes placed in buffer)
    Signed-off-by: Andy Shevchenko
    Reported-by: Aaro Koskinen
    Tested-by: Aaro Koskinen
    Cc: Al Viro
    Cc: Catalin Marinas
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Change current_is_single_threaded() to use for_each_thread() rather than
    deprecated while_each_thread().

    Signed-off-by: Oleg Nesterov
    Cc: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Sometimes kobject_set_name_vargs is called with a format string conaining
    no %, or a format string of precisely "%s", where the single vararg
    happens to point to .rodata. kvasprintf_const detects these cases for us
    and returns a copy of that pointer instead of duplicating the string, thus
    saving some run-time memory. Otherwise, it falls back to kvasprintf. We
    just need to always deallocate ->name using kfree_const.

    Unfortunately, the dance we need to do to perform the '/' -> '!'
    sanitization makes the resulting code rather ugly.

    I instrumented kstrdup_const to provide some statistics on the memory
    saved, and for me this gave an additional ~14KB after boot (306KB was
    already saved; this patch bumped that to 320KB). I have
    KMALLOC_SHIFT_LOW==3, and since 80% of the kvasprintf_const hits were
    satisfied by an 8-byte allocation, the 14K would roughly be quadrupled
    when KMALLOC_SHIFT_LOW==5. Whether these numbers are sufficient to
    justify the ugliness I'll leave to others to decide.

    Signed-off-by: Rasmus Villemoes
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • This adds kvasprintf_const which tries to use kstrdup_const if possible:
    If the format string contains no % characters, or if the format string is
    exactly "%s", we delegate to kstrdup_const. Otherwise, we fall back to
    kvasprintf.

    Just as for kstrdup_const, the main motivation is to save memory by
    reusing .rodata when possible.

    The return value should be freed by kfree_const, just like for
    kstrdup_const.

    There is deliberately no kasprintf_const: In the vast majority of cases,
    the format string argument is a literal, so one can determine statically
    whether one could instead use kstrdup_const directly (which would also
    require one to change all corresponding kfree calls to kfree_const).

    Signed-off-by: Rasmus Villemoes
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • llist_del_first reads entry->next, but it did not acquire visibility over
    the entry node. As the result it can get a stale value of entry->next
    (e.g. NULL or whatever garbage was there before the appending thread
    wrote correct value). And then commit that value as llist head with
    cmpxchg. That will corrupt llist.

    Note there is a control-dependency between read of head->first and read of
    entry->next, but it does not make the code correct. Kernel memory model
    unambiguously says: "A load-load control dependency requires a full read
    memory barrier".

    Use smp_load_acquire to acquire visibility over the entry node.

    The data race was found with KernelThreadSanitizer (KTSAN).

    Here is an example of KTSAN report:

    ThreadSanitizer: data-race in llist_del_first

    Read of size 1 by thread T389 (K2630, CPU0):
    [] llist_del_first+0x39/0x70 lib/llist.c:74
    [< inlined >] tty_buffer_alloc drivers/tty/tty_buffer.c:181
    [] __tty_buffer_request_room+0xb4/0x250 drivers/tty/tty_buffer.c:292
    [] tty_insert_flip_string_fixed_flag+0x6c/0x150 drivers/tty/tty_buffer.c:337
    [< inlined >] tty_insert_flip_string include/linux/tty_flip.h:35
    [] pty_write+0x72/0xc0 drivers/tty/pty.c:110
    [< inlined >] process_output_block drivers/tty/n_tty.c:611
    [] n_tty_write+0x346/0x7f0 drivers/tty/n_tty.c:2401
    [< inlined >] do_tty_write drivers/tty/tty_io.c:1159
    [] tty_write+0x21f/0x3f0 drivers/tty/tty_io.c:1245
    [] __vfs_write+0x5f/0x1f0 fs/read_write.c:489
    [] vfs_write+0xef/0x280 fs/read_write.c:538
    [< inlined >] SYSC_write fs/read_write.c:585
    [] SyS_write+0x70/0xe0 fs/read_write.c:577
    [] entry_SYSCALL_64_fastpath+0x12/0x71 arch/x86/entry/entry_64.S:186

    Previous write of size 8 by thread T226 (K761, CPU0):
    [] llist_add_batch+0x32/0x70 lib/llist.c:44 (discriminator 16)
    [< inlined >] llist_add include/linux/llist.h:180
    [] tty_buffer_free+0x6c/0xb0 drivers/tty/tty_buffer.c:221
    [] flush_to_ldisc+0x107/0x300 drivers/tty/tty_buffer.c:514
    [] process_one_work+0x47e/0x930 kernel/workqueue.c:2036
    [] worker_thread+0xb0/0x900 kernel/workqueue.c:2170
    [] kthread+0x150/0x170 kernel/kthread.c:209
    [] ret_from_fork+0x3f/0x70 arch/x86/entry/entry_64.S:526

    Signed-off-by: Dmitry Vyukov
    Reviewed-by: Paul E. McKenney
    Cc: Rasmus Villemoes
    Cc: Huang Ying
    Cc: Konstantin Serebryany
    Cc: Andrey Konovalov
    Cc: Alexander Potapenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitry Vyukov
     
  • Add a couple of simple tests for string_get_size(). The last one will
    hang the kernel without the 'lib/string_helpers.c: fix infinite loop in
    string_get_size()' fix.

    Signed-off-by: Vitaly Kuznetsov
    Cc: James Bottomley
    Cc: Andy Shevchenko
    Cc: Rasmus Villemoes
    Cc: "K. Y. Srinivasan"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vitaly Kuznetsov
     
  • provides rol32() inline function, let's use already
    predefined function instead of direct expression.

    Signed-off-by: Alexander Kuleshov
    Cc: Herbert Xu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Kuleshov
     
  • %n is no longer just ignored; it results in early return from vsnprintf.
    Also add a request to add test cases for future %p extensions.

    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Martin Kletzander
    Reviewed-by: Andy Shevchenko
    Cc: Jonathan Corbet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • This adds a simple module for testing the kernel's printf facilities.
    Previously, some %p extensions have caused a wrong return value in case
    the entire output didn't fit and/or been unusable in kasprintf(). This
    should help catch such issues. Also, it should help ensure that changes
    to the formatting algorithms don't break anything.

    I'm not sure if we have a struct dentry or struct file lying around at
    boot time or if we can fake one, but most %p extensions should be
    testable, as should the ordinary number and string formatting.

    The nature of vararg functions means we can't use a more conventional
    table-driven approach.

    For now, this is mostly a skeleton; contributions are very
    welcome. Some tests are/will be slightly annoying to write, since the
    expected output depends on stuff like CONFIG_*, sizeof(long), runtime
    values etc.

    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Kees Cook
    Cc: Andy Shevchenko
    Cc: Martin Kletzander
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • As a quick

    git grep -E '%[ +0#-]*#[ +0#-]*(\*|[0-9]+)?(\.(\*|[0-9]+)?)?p'

    shows, nobody uses the # flag with %p. Should one try to do so, one
    will be met with

    warning: `#' flag used with `%p' gnu_printf format [-Wformat]

    (POSIX and C99 both say "... For other conversion specifiers, the
    behavior is undefined.". Obviously, the kernel can choose to define
    the behaviour however it wants, but as long as gcc issues that
    warning, users are unlikely to show up.)

    Since default_width is effectively always 2*sizeof(void*), we can
    simplify the prologue of pointer() and save a few instructions.

    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Andy Shevchenko
    Acked-by: Kees Cook
    Cc: Martin Kletzander
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • Quoting from 2aa2f9e21e4e ("lib/vsprintf.c: improve sanity check in
    vsnprintf()"):

    On 64 bit, size may very well be huge even if bit 31 happens to be 0.
    Somehow it doesn't feel right that one can pass a 5 GiB buffer but not a
    3 GiB one. So cap at INT_MAX as was probably the intention all along.
    This is also the made-up value passed by sprintf and vsprintf.

    I should have seen this copy-pasted instance back then, but let's just
    do it now.

    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Andy Shevchenko
    Acked-by: Kees Cook
    Cc: Martin Kletzander
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • If we meet any invalid or unsupported format specifier, 'handling' it by
    just printing it as a literal string is not safe: Presumably the format
    string and the arguments passed gcc's type checking, but that means
    something like sprintf(buf, "%n %pd", &intvar, dentry) would end up
    interpreting &intvar as a struct dentry*.

    When the offending specifier was %n it used to be at the end of the format
    string, but we can't rely on that always being the case. Also, gcc
    doesn't complain about some more or less exotic qualifiers (or 'length
    modifiers' in posix-speak) such as 'j' or 'q', but being unrecognized by
    the kernel's printf implementation, they'd be interpreted as unknown
    specifiers, and the rest of arguments would be interpreted wrongly.

    So let's complain about anything we don't understand, not just %n, and
    stop pretending that we'd be able to make sense of the rest of the
    format/arguments. If the offending specifier is in a printk() call we
    unfortunately only get a "BUG: recent printk recursion!", but at least
    direct users of the sprintf family will be caught.

    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Andy Shevchenko
    Acked-by: Kees Cook
    Cc: Martin Kletzander
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • Move all pointer-formatting documentation to one place in the code and one
    place in the documentation instead of keeping it in three places with
    different level of completeness. Documentation/printk-formats.txt has
    detailed information about each modifier, docstring above pointer() has
    short descriptions of them (as that is the function dealing with %p) and
    docstring above vsprintf() is removed as redundant. Both docstrings in
    the code that were modified are updated with a reminder of updating the
    documentation upon any further change.

    [akpm@linux-foundation.org: fix comment]
    Signed-off-by: Martin Kletzander
    Reviewed-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Cc: Jonathan Corbet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Martin Kletzander
     
  • Using kstrdup_const, thus reusing .rodata when possible, saves around 2 kB
    of runtime memory on my laptop/.config combination.

    Signed-off-by: Rasmus Villemoes
    Cc: Jason Baron
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • __GFP_WAIT was used to signal that the caller was in atomic context and
    could not sleep. Now it is possible to distinguish between true atomic
    context and callers that are not willing to sleep. The latter should
    clear __GFP_DIRECT_RECLAIM so kswapd will still wake. As clearing
    __GFP_WAIT behaves differently, there is a risk that people will clear the
    wrong flags. This patch renames __GFP_WAIT to __GFP_RECLAIM to clearly
    indicate what it does -- setting it allows all reclaim activity, clearing
    them prevents it.

    [akpm@linux-foundation.org: fix build]
    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Mel Gorman
    Acked-by: Michal Hocko
    Acked-by: Vlastimil Babka
    Acked-by: Johannes Weiner
    Cc: Christoph Lameter
    Acked-by: David Rientjes
    Cc: Vitaly Wool
    Cc: Rik van Riel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mel Gorman
     
  • …d avoiding waking kswapd

    __GFP_WAIT has been used to identify atomic context in callers that hold
    spinlocks or are in interrupts. They are expected to be high priority and
    have access one of two watermarks lower than "min" which can be referred
    to as the "atomic reserve". __GFP_HIGH users get access to the first
    lower watermark and can be called the "high priority reserve".

    Over time, callers had a requirement to not block when fallback options
    were available. Some have abused __GFP_WAIT leading to a situation where
    an optimisitic allocation with a fallback option can access atomic
    reserves.

    This patch uses __GFP_ATOMIC to identify callers that are truely atomic,
    cannot sleep and have no alternative. High priority users continue to use
    __GFP_HIGH. __GFP_DIRECT_RECLAIM identifies callers that can sleep and
    are willing to enter direct reclaim. __GFP_KSWAPD_RECLAIM to identify
    callers that want to wake kswapd for background reclaim. __GFP_WAIT is
    redefined as a caller that is willing to enter direct reclaim and wake
    kswapd for background reclaim.

    This patch then converts a number of sites

    o __GFP_ATOMIC is used by callers that are high priority and have memory
    pools for those requests. GFP_ATOMIC uses this flag.

    o Callers that have a limited mempool to guarantee forward progress clear
    __GFP_DIRECT_RECLAIM but keep __GFP_KSWAPD_RECLAIM. bio allocations fall
    into this category where kswapd will still be woken but atomic reserves
    are not used as there is a one-entry mempool to guarantee progress.

    o Callers that are checking if they are non-blocking should use the
    helper gfpflags_allow_blocking() where possible. This is because
    checking for __GFP_WAIT as was done historically now can trigger false
    positives. Some exceptions like dm-crypt.c exist where the code intent
    is clearer if __GFP_DIRECT_RECLAIM is used instead of the helper due to
    flag manipulations.

    o Callers that built their own GFP flags instead of starting with GFP_KERNEL
    and friends now also need to specify __GFP_KSWAPD_RECLAIM.

    The first key hazard to watch out for is callers that removed __GFP_WAIT
    and was depending on access to atomic reserves for inconspicuous reasons.
    In some cases it may be appropriate for them to use __GFP_HIGH.

    The second key hazard is callers that assembled their own combination of
    GFP flags instead of starting with something like GFP_KERNEL. They may
    now wish to specify __GFP_KSWAPD_RECLAIM. It's almost certainly harmless
    if it's missed in most cases as other activity will wake kswapd.

    Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
    Acked-by: Vlastimil Babka <vbabka@suse.cz>
    Acked-by: Michal Hocko <mhocko@suse.com>
    Acked-by: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Christoph Lameter <cl@linux.com>
    Cc: David Rientjes <rientjes@google.com>
    Cc: Vitaly Wool <vitalywool@gmail.com>
    Cc: Rik van Riel <riel@redhat.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

    Mel Gorman
     
  • Pull asm-generic cleanups from Arnd Bergmann:
    "The asm-generic changes for 4.4 are mostly a series from Christoph
    Hellwig to clean up various abuses of headers in there. The patch to
    rename the io-64-nonatomic-*.h headers caused some conflicts with new
    users, so I added a workaround that we can remove in the next merge
    window.

    The only other patch is a warning fix from Marek Vasut"

    * tag 'asm-generic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
    asm-generic: temporarily add back asm-generic/io-64-nonatomic*.h
    asm-generic: cmpxchg: avoid warnings from macro-ized cmpxchg() implementations
    gpio-mxc: stop including
    n_tracesink: stop including
    n_tracerouter: stop including
    mlx5: stop including
    hifn_795x: stop including
    drbd: stop including
    move count_zeroes.h out of asm-generic
    move io-64-nonatomic*.h out of asm-generic

    Linus Torvalds
     

06 Nov, 2015

5 commits

  • Merge patch-bomb from Andrew Morton:

    - inotify tweaks

    - some ocfs2 updates (many more are awaiting review)

    - various misc bits

    - kernel/watchdog.c updates

    - Some of mm. I have a huge number of MM patches this time and quite a
    lot of it is quite difficult and much will be held over to next time.

    * emailed patches from Andrew Morton : (162 commits)
    selftests: vm: add tests for lock on fault
    mm: mlock: add mlock flags to enable VM_LOCKONFAULT usage
    mm: introduce VM_LOCKONFAULT
    mm: mlock: add new mlock system call
    mm: mlock: refactor mlock, munlock, and munlockall code
    kasan: always taint kernel on report
    mm, slub, kasan: enable user tracking by default with KASAN=y
    kasan: use IS_ALIGNED in memory_is_poisoned_8()
    kasan: Fix a type conversion error
    lib: test_kasan: add some testcases
    kasan: update reference to kasan prototype repo
    kasan: move KASAN_SANITIZE in arch/x86/boot/Makefile
    kasan: various fixes in documentation
    kasan: update log messages
    kasan: accurately determine the type of the bad access
    kasan: update reported bug types for kernel memory accesses
    kasan: update reported bug types for not user nor kernel memory accesses
    mm/kasan: prevent deadlock in kasan reporting
    mm/kasan: don't use kasan shadow pointer in generic functions
    mm/kasan: MODULE_VADDR is not available on all archs
    ...

    Linus Torvalds
     
  • It's recommended to have slub's user tracking enabled with CONFIG_KASAN,
    because:

    a) User tracking disables slab merging which improves
    detecting out-of-bounds accesses.
    b) User tracking metadata acts as redzone which also improves
    detecting out-of-bounds accesses.
    c) User tracking provides additional information about object.
    This information helps to understand bugs.

    Currently it is not enabled by default. Besides recompiling the kernel
    with KASAN and reinstalling it, user also have to change the boot cmdline,
    which is not very handy.

    Enable slub user tracking by default with KASAN=y, since there is no good
    reason to not do this.

    [akpm@linux-foundation.org: little fixes, per David]
    Signed-off-by: Andrey Ryabinin
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: David Rientjes
    Cc: Joonsoo Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Ryabinin
     
  • Add some out of bounds testcases to test_kasan module.

    Signed-off-by: Wang Long
    Acked-by: Andrey Ryabinin
    Cc: Vladimir Murzin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wang Long
     
  • Pull sparc updates from David Miller:
    "Just a couple of fixes/cleanups:

    - Correct NUMA latency calculations on sparc64, from Nitin Gupta.

    - ASI_ST_BLKINIT_MRU_S value was wrong, from Rob Gardner.

    - Fix non-faulting load handling of non-quad values, also from Rob
    Gardner.

    - Cleanup VISsave assembler, from Sam Ravnborg.

    - Fix iommu-common code so it doesn't emit rediculous warnings on
    some architectures, particularly ARM"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
    sparc64: Fix numa distance values
    sparc64: Don't restrict fp regs for no-fault loads
    iommu-common: Fix error code used in iommu_tbl_range_{alloc,free}().
    sparc64: use ENTRY/ENDPROC in VISsave
    sparc64: Fix incorrect ASI_ST_BLKINIT_MRU_S value

    Linus Torvalds
     
  • Pull security subsystem update from James Morris:
    "This is mostly maintenance updates across the subsystem, with a
    notable update for TPM 2.0, and addition of Jarkko Sakkinen as a
    maintainer of that"

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (40 commits)
    apparmor: clarify CRYPTO dependency
    selinux: Use a kmem_cache for allocation struct file_security_struct
    selinux: ioctl_has_perm should be static
    selinux: use sprintf return value
    selinux: use kstrdup() in security_get_bools()
    selinux: use kmemdup in security_sid_to_context_core()
    selinux: remove pointless cast in selinux_inode_setsecurity()
    selinux: introduce security_context_str_to_sid
    selinux: do not check open perm on ftruncate call
    selinux: change CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE default
    KEYS: Merge the type-specific data with the payload data
    KEYS: Provide a script to extract a module signature
    KEYS: Provide a script to extract the sys cert list from a vmlinux file
    keys: Be more consistent in selection of union members used
    certs: add .gitignore to stop git nagging about x509_certificate_list
    KEYS: use kvfree() in add_key
    Smack: limited capability for changing process label
    TPM: remove unnecessary little endian conversion
    vTPM: support little endian guests
    char: Drop owner assignment from i2c_driver
    ...

    Linus Torvalds
     

05 Nov, 2015

5 commits

  • Pull driver core updates from Greg KH:
    "Here's the "big" driver core updates for 4.4-rc1. Primarily a bunch
    of debugfs updates, with a smattering of minor driver core fixes and
    updates as well.

    All have been in linux-next for a long time"

    * tag 'driver-core-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    debugfs: Add debugfs_create_ulong()
    of: to support binding numa node to specified device in devicetree
    debugfs: Add read-only/write-only bool file ops
    debugfs: Add read-only/write-only size_t file ops
    debugfs: Add read-only/write-only x64 file ops
    debugfs: Consolidate file mode checks in debugfs_create_*()
    Revert "mm: Check if section present during memory block (un)registering"
    driver-core: platform: Provide helpers for multi-driver modules
    mm: Check if section present during memory block (un)registering
    devres: fix a for loop bounds check
    CMA: fix CONFIG_CMA_SIZE_MBYTES overflow in 64bit
    base/platform: assert that dev_pm_domain callbacks are called unconditionally
    sysfs: correctly handle short reads on PREALLOC attrs.
    base: soc: siplify ida usage
    kobject: move EXPORT_SYMBOL() macros next to corresponding definitions
    kobject: explain what kobject's sd field is
    debugfs: document that debugfs_remove*() accepts NULL and error values
    debugfs: Pass bool pointer to debugfs_create_bool()
    ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

    Linus Torvalds
     
  • When running "mod X" operation, if X is 0 the filter has to be halt.
    Add new test cases to cover A = A mod X if X is 0, and A = A mod 1.

    CC: Xi Wang
    CC: Zi Shen Lim
    Signed-off-by: Yang Shi
    Acked-by: Daniel Borkmann
    Acked-by: Alexei Starovoitov
    Acked-by: Zi Shen Lim
    Acked-by: Xi Wang
    Signed-off-by: David S. Miller

    Yang Shi
     
  • The value returned from iommu_tbl_range_alloc() (and the one passed
    in as a fourth argument to iommu_tbl_range_free) is not a DMA address,
    it is rather an index into the IOMMU page table.

    Therefore using DMA_ERROR_CODE is not appropriate.

    Use a more type matching error code define, IOMMU_ERROR_CODE, and
    update all users of this interface.

    Reported-by: Andre Przywara
    Signed-off-by: David S. Miller

    David S. Miller
     
  • Pull networking updates from David Miller:

    Changes of note:

    1) Allow to schedule ICMP packets in IPVS, from Alex Gartrell.

    2) Provide FIB table ID in ipv4 route dumps just as ipv6 does, from
    David Ahern.

    3) Allow the user to ask for the statistics to be filtered out of
    ipv4/ipv6 address netlink dumps. From Sowmini Varadhan.

    4) More work to pass the network namespace context around deep into
    various packet path APIs, starting with the netfilter hooks. From
    Eric W Biederman.

    5) Add layer 2 TX/RX checksum offloading to qeth driver, from Thomas
    Richter.

    6) Use usec resolution for SYN/ACK RTTs in TCP, from Yuchung Cheng.

    7) Support Very High Throughput in wireless MESH code, from Bob
    Copeland.

    8) Allow setting the ageing_time in switchdev/rocker. From Scott
    Feldman.

    9) Properly autoload L2TP type modules, from Stephen Hemminger.

    10) Fix and enable offload features by default in 8139cp driver, from
    David Woodhouse.

    11) Support both ipv4 and ipv6 sockets in a single vxlan device, from
    Jiri Benc.

    12) Fix CWND limiting of thin streams in TCP, from Bendik Rønning
    Opstad.

    13) Fix IPSEC flowcache overflows on large systems, from Steffen
    Klassert.

    14) Convert bridging to track VLANs using rhashtable entries rather than
    a bitmap. From Nikolay Aleksandrov.

    15) Make TCP listener handling completely lockless, this is a major
    accomplishment. Incoming request sockets now live in the
    established hash table just like any other socket too.

    From Eric Dumazet.

    15) Provide more bridging attributes to netlink, from Nikolay
    Aleksandrov.

    16) Use hash based algorithm for ipv4 multipath routing, this was very
    long overdue. From Peter Nørlund.

    17) Several y2038 cures, mostly avoiding timespec. From Arnd Bergmann.

    18) Allow non-root execution of EBPF programs, from Alexei Starovoitov.

    19) Support SO_INCOMING_CPU as setsockopt, from Eric Dumazet. This
    influences the port binding selection logic used by SO_REUSEPORT.

    20) Add ipv6 support to VRF, from David Ahern.

    21) Add support for Mellanox Spectrum switch ASIC, from Jiri Pirko.

    22) Add rtl8xxxu Realtek wireless driver, from Jes Sorensen.

    23) Implement RACK loss recovery in TCP, from Yuchung Cheng.

    24) Support multipath routes in MPLS, from Roopa Prabhu.

    25) Fix POLLOUT notification for listening sockets in AF_UNIX, from Eric
    Dumazet.

    26) Add new QED Qlogic river, from Yuval Mintz, Manish Chopra, and
    Sudarsana Kalluru.

    27) Don't fetch timestamps on AF_UNIX sockets, from Hannes Frederic
    Sowa.

    28) Support ipv6 geneve tunnels, from John W Linville.

    29) Add flood control support to switchdev layer, from Ido Schimmel.

    30) Fix CHECKSUM_PARTIAL handling of potentially fragmented frames, from
    Hannes Frederic Sowa.

    31) Support persistent maps and progs in bpf, from Daniel Borkmann.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1790 commits)
    sh_eth: use DMA barriers
    switchdev: respect SKIP_EOPNOTSUPP flag in case there is no recursion
    net: sched: kill dead code in sch_choke.c
    irda: Delete an unnecessary check before the function call "irlmp_unregister_service"
    net: dsa: mv88e6xxx: include DSA ports in VLANs
    net: dsa: mv88e6xxx: disable SA learning for DSA and CPU ports
    net/core: fix for_each_netdev_feature
    vlan: Invoke driver vlan hooks only if device is present
    arcnet/com20020: add LEDS_CLASS dependency
    bpf, verifier: annotate verbose printer with __printf
    dp83640: Only wait for timestamps for packets with timestamping enabled.
    ptp: Change ptp_class to a proper bitmask
    dp83640: Prune rx timestamp list before reading from it
    dp83640: Delay scheduled work.
    dp83640: Include hash in timestamp/packet matching
    ipv6: fix tunnel error handling
    net/mlx5e: Fix LSO vlan insertion
    net/mlx5e: Re-eanble client vlan TX acceleration
    net/mlx5e: Return error in case mlx5e_set_features() fails
    net/mlx5e: Don't allow more than max supported channels
    ...

    Linus Torvalds
     
  • Pull crypto update from Herbert Xu:
    "API:

    - Add support for cipher output IVs in testmgr
    - Add missing crypto_ahash_blocksize helper
    - Mark authenc and des ciphers as not allowed under FIPS.

    Algorithms:

    - Add CRC support to 842 compression
    - Add keywrap algorithm
    - A number of changes to the akcipher interface:
    + Separate functions for setting public/private keys.
    + Use SG lists.

    Drivers:

    - Add Intel SHA Extension optimised SHA1 and SHA256
    - Use dma_map_sg instead of custom functions in crypto drivers
    - Add support for STM32 RNG
    - Add support for ST RNG
    - Add Device Tree support to exynos RNG driver
    - Add support for mxs-dcp crypto device on MX6SL
    - Add xts(aes) support to caam
    - Add ctr(aes) and xts(aes) support to qat
    - A large set of fixes from Russell King for the marvell/cesa driver"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (115 commits)
    crypto: asymmetric_keys - Fix unaligned access in x509_get_sig_params()
    crypto: akcipher - Don't #include crypto/public_key.h as the contents aren't used
    hwrng: exynos - Add Device Tree support
    hwrng: exynos - Fix missing configuration after suspend to RAM
    hwrng: exynos - Add timeout for waiting on init done
    dt-bindings: rng: Describe Exynos4 PRNG bindings
    crypto: marvell/cesa - use __le32 for hardware descriptors
    crypto: marvell/cesa - fix missing cpu_to_le32() in mv_cesa_dma_add_op()
    crypto: marvell/cesa - use memcpy_fromio()/memcpy_toio()
    crypto: marvell/cesa - use gfp_t for gfp flags
    crypto: marvell/cesa - use dma_addr_t for cur_dma
    crypto: marvell/cesa - use readl_relaxed()/writel_relaxed()
    crypto: caam - fix indentation of close braces
    crypto: caam - only export the state we really need to export
    crypto: caam - fix non-block aligned hash calculation
    crypto: caam - avoid needlessly saving and restoring caam_hash_ctx
    crypto: caam - print errno code when hash registration fails
    crypto: marvell/cesa - fix memory leak
    crypto: marvell/cesa - fix first-fragment handling in mv_cesa_ahash_dma_last_req()
    crypto: marvell/cesa - rearrange handling for sw padded hashes
    ...

    Linus Torvalds
     

04 Nov, 2015

1 commit

  • Pull ARM updates from Russell King:
    "In this ARM merge, we remove more lines than we add. Changes include:

    - Enable imprecise aborts early, so that bus errors aren't masked
    until later in the boot. This has the side effect that boot
    loaders which provoke these aborts can cause the kernel to crash
    early in boot, so we install a handler to report this event around
    the site where these are enabled.

    - Remove the buggy but impossible to enable cmpxchg syscall code.

    - Add unwinding annotations to some assembly code.

    - Add support for atomic half-word exchange for ARMv6k+.

    - Reduce ioremap() alignment for SMP/LPAE cases where we don't need
    the large alignment.

    - Addition of an "optimal" 3G configuration for systems with 1G of
    RAM.

    - Increase vmalloc space by 128M.

    - Constify some SMP operations structures, which have never been
    writable.

    - Improve ARMs dma_mmap() support for mapping DMA coherent mappings
    into userspace.

    - Fix to the NMI backtrace code in the IPI case on ARM where the
    failing CPU gets stuck for 10s waiting for its own IPI to be
    delivered.

    - Removal of legacy PM support from the AMBA bus driver.

    - Another fix for the previous fix of vdsomunge"

    * 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: (23 commits)
    ARM: 8449/1: fix bug in vdsomunge swab32 macro
    arm: add missing of_node_put
    ARM: 8447/1: catch pending imprecise abort on unmask
    ARM: 8446/1: amba: Remove unused callbacks for legacy system PM
    ARM: 8443/1: Adding support for atomic half word exchange
    ARM: clean up TWD after previous patch
    ARM: 8441/2: twd: Don't set CLOCK_EVT_FEAT_C3STOP unconditionally
    ARM: 8440/1: remove obsolete documentation
    ARM: make highpte an expert option
    ARM: 8433/1: add a VMSPLIT_3G_OPT config option
    ARM: 8439/1: Fix backtrace generation when IPI is masked
    ARM: 8428/1: kgdb: Fix registers on sleeping tasks
    ARM: 8427/1: dma-mapping: add support for offset parameter in dma_mmap()
    ARM: 8426/1: dma-mapping: add missing range check in dma_mmap()
    ARM: remove user cmpxchg syscall
    ARM: 8438/1: Add unwinding to __clear_user_std()
    ARM: 8436/1: hw_breakpoint: remove unnecessary header
    ARM: 8434/2: Revert "7655/1: smp_twd: make twd_local_timer_of_register() no-op for nosmp"
    ARM: 8432/1: move VMALLOC_END from 0xff000000 to 0xff800000
    ARM: 8430/1: use default ioremap alignment for SMP or LPAE
    ...

    Linus Torvalds
     

01 Nov, 2015

1 commit


29 Oct, 2015

1 commit


23 Oct, 2015

1 commit