10 Feb, 2016

1 commit

  • Workqueue used to guarantee local execution for work items queued
    without explicit target CPU. The guarantee is gone now which can
    break some usages in subtle ways. To flush out those cases, this
    patch implements a debug feature which forces round-robin CPU
    selection for all such work items.

    The debug feature defaults to off and can be enabled with a kernel
    parameter. The default can be flipped with a debug config option.

    If you hit this commit during bisection, please refer to 041bd12e272c
    ("Revert "workqueue: make sure delayed work run in local cpu"") for
    more information and ping me.

    Signed-off-by: Tejun Heo

    Tejun Heo
     

24 Jan, 2016

1 commit

  • Pull rdma updates from Doug Ledford:
    "Initial roundup of 4.5 merge window patches

    - Remove usage of ib_query_device and instead store attributes in
    ib_device struct

    - Move iopoll out of block and into lib, rename to irqpoll, and use
    in several places in the rdma stack as our new completion queue
    polling library mechanism. Update the other block drivers that
    already used iopoll to use the new mechanism too.

    - Replace the per-entry GID table locks with a single GID table lock

    - IPoIB multicast cleanup

    - Cleanups to the IB MR facility

    - Add support for 64bit extended IB counters

    - Fix for netlink oops while parsing RDMA nl messages

    - RoCEv2 support for the core IB code

    - mlx4 RoCEv2 support

    - mlx5 RoCEv2 support

    - Cross Channel support for mlx5

    - Timestamp support for mlx5

    - Atomic support for mlx5

    - Raw QP support for mlx5

    - MAINTAINERS update for mlx4/mlx5

    - Misc ocrdma, qib, nes, usNIC, cxgb3, cxgb4, mlx4, mlx5 updates

    - Add support for remote invalidate to the iSER driver (pushed
    through the RDMA tree due to dependencies, acknowledged by nab)

    - Update to NFSoRDMA (pushed through the RDMA tree due to
    dependencies, acknowledged by Bruce)"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (169 commits)
    IB/mlx5: Unify CQ create flags check
    IB/mlx5: Expose Raw Packet QP to user space consumers
    {IB, net}/mlx5: Move the modify QP operation table to mlx5_ib
    IB/mlx5: Support setting Ethernet priority for Raw Packet QPs
    IB/mlx5: Add Raw Packet QP query functionality
    IB/mlx5: Add create and destroy functionality for Raw Packet QP
    IB/mlx5: Refactor mlx5_ib_qp to accommodate other QP types
    IB/mlx5: Allocate a Transport Domain for each ucontext
    net/mlx5_core: Warn on unsupported events of QP/RQ/SQ
    net/mlx5_core: Add RQ and SQ event handling
    net/mlx5_core: Export transport objects
    IB/mlx5: Expose CQE version to user-space
    IB/mlx5: Add CQE version 1 support to user QPs and SRQs
    IB/mlx5: Fix data validation in mlx5_ib_alloc_ucontext
    IB/sa: Fix netlink local service GFP crash
    IB/srpt: Remove redundant wc array
    IB/qib: Improve ipoib UD performance
    IB/mlx4: Advertise RoCE v2 support
    IB/mlx4: Create and use another QP1 for RoCEv2
    IB/mlx4: Enable send of RoCE QP1 packets with IP/UDP headers
    ...

    Linus Torvalds
     

23 Jan, 2016

2 commits

  • Pull crypto fixes from Herbert Xu:
    "This fixes the following issues:

    API:
    - A large number of bug fixes for the af_alg interface, credit goes
    to Dmitry Vyukov for discovering and reporting these issues.

    Algorithms:
    - sw842 needs to select crc32.
    - The soft dependency on crc32c is now in the correct spot.

    Drivers:
    - The atmel AES driver needs HAS_DMA.
    - The atmel AES driver was a missing break statement, fortunately
    it's only a debug function.
    - A number of bug fixes for the Intel qat driver"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (24 commits)
    crypto: algif_skcipher - sendmsg SG marking is off by one
    crypto: crc32c - Fix crc32c soft dependency
    crypto: algif_skcipher - Load TX SG list after waiting
    crypto: atmel-aes - Add missing break to atmel_aes_reg_name
    crypto: algif_skcipher - Fix race condition in skcipher_check_key
    crypto: algif_hash - Fix race condition in hash_check_key
    crypto: CRYPTO_DEV_ATMEL_AES should depend on HAS_DMA
    lib: sw842: select crc32
    crypto: af_alg - Forbid bind(2) when nokey child sockets are present
    crypto: algif_skcipher - Remove custom release parent function
    crypto: algif_hash - Remove custom release parent function
    crypto: af_alg - Allow af_af_alg_release_parent to be called on nokey path
    crypto: qat - update init_esram for C3xxx dev type
    crypto: qat - fix timeout issues
    crypto: qat - remove to call get_sram_bar_id for qat_c3xxx
    crypto: algif_skcipher - Add key check exception for cipher_null
    crypto: skcipher - Add crypto_skcipher_has_setkey
    crypto: algif_hash - Require setkey before accept(2)
    crypto: hash - Add crypto_ahash_has_setkey
    crypto: algif_skcipher - Add nokey compatibility path
    ...

    Linus Torvalds
     
  • Merge misc fixes from Andrew Morton:
    "Six fixes"

    * emailed patches from Andrew Morton :
    ocfs2: NFS hangs in __ocfs2_cluster_lock due to race with ocfs2_unblock_lock
    reiserfs: fix dereference of ERR_PTR
    ratelimit: fix bug in time interval by resetting right begin time
    mm: fix kernel crash in khugepaged thread
    mm: fix mlock accouting
    thp: change pmd_trans_huge_lock() interface to return ptl

    Linus Torvalds
     

22 Jan, 2016

4 commits

  • Pull block driver updates from Jens Axboe:
    "This is the block driver pull request for 4.5, with the exception of
    NVMe, which is in a separate branch and will be posted after this one.

    This pull request contains:

    - A set of bcache stability fixes, which have been acked by Kent.
    These have been used and tested for more than a year by the
    community, so it's about time that they got in.

    - A set of drbd updates from the drbd team (Andreas, Lars, Philipp)
    and Markus Elfring, Oleg Drokin.

    - A set of fixes for xen blkback/front from the usual suspects, (Bob,
    Konrad) as well as community based fixes from Kiri, Julien, and
    Peng.

    - A 2038 time fix for sx8 from Shraddha, with a fix from me.

    - A small mtip32xx cleanup from Zhu Yanjun.

    - A null_blk division fix from Arnd"

    * 'for-4.5/drivers' of git://git.kernel.dk/linux-block: (71 commits)
    null_blk: use sector_div instead of do_div
    mtip32xx: restrict variables visible in current code module
    xen/blkfront: Fix crash if backend doesn't follow the right states.
    xen/blkback: Fix two memory leaks.
    xen/blkback: make st_ statistics per ring
    xen/blkfront: Handle non-indirect grant with 64KB pages
    xen-blkfront: Introduce blkif_ring_get_request
    xen-blkback: clear PF_NOFREEZE for xen_blkif_schedule()
    xen/blkback: Free resources if connect_ring failed.
    xen/blocks: Return -EXX instead of -1
    xen/blkback: make pool of persistent grants and free pages per-queue
    xen/blkback: get the number of hardware queues/rings from blkfront
    xen/blkback: pseudo support for multi hardware queues/rings
    xen/blkback: separate ring information out of struct xen_blkif
    xen/blkfront: correct setting for xen_blkif_max_ring_order
    xen/blkfront: make persistent grants pool per-queue
    xen/blkfront: Remove duplicate setting of ->xbdev.
    xen/blkfront: Cleanup of comments, fix unaligned variables, and syntax errors.
    xen/blkfront: negotiate number of queues/rings to be used with backend
    xen/blkfront: split per device io_lock
    ...

    Linus Torvalds
     
  • rs->begin in ratelimit is set in two cases.
    1) when rs->begin was not initialized
    2) when rs->interval was passed

    For case #2, current ratelimit sets the begin to 0. This incurrs
    improper suppression. The begin value will be set in the next ratelimit
    call by 1). Then the time interval check will be always false, and
    rs->printed will not be initialized. Although enough time passed,
    ratelimit may return 0 if rs->printed is not less than rs->burst. To
    reset interval properly, begin should be jiffies rather than 0.

    For an example code below:

    static DEFINE_RATELIMIT_STATE(mylimit, 1, 1);
    for (i = 1; i
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jaewon Kim
     
  • Expose an interface to allow users to mark several accesses together as
    being user space accesses, allowing batching of the surrounding user
    space access markers (SMAP on x86, PAN on arm64, domain register
    switching on arm).

    This is currently only used for the user string lenth and copying
    functions, where the SMAP overhead on x86 drowned the actual user
    accesses (only noticeable on newer microarchitectures that support SMAP
    in the first place, of course).

    * user access batching branch:
    Use the new batched user accesses in generic user string handling
    Add 'unsafe' user access functions for batched accesses
    x86: reorganize SMAP handling in user space accesses

    Linus Torvalds
     
  • Merge third patch-bomb from Andrew Morton:
    "I'm pretty much done for -rc1 now:

    - the rest of MM, basically

    - lib/ updates

    - checkpatch, epoll, hfs, fatfs, ptrace, coredump, exit

    - cpu_mask simplifications

    - kexec, rapidio, MAINTAINERS etc, etc.

    - more dma-mapping cleanups/simplifications from hch"

    * emailed patches from Andrew Morton : (109 commits)
    MAINTAINERS: add/fix git URLs for various subsystems
    mm: memcontrol: add "sock" to cgroup2 memory.stat
    mm: memcontrol: basic memory statistics in cgroup2 memory controller
    mm: memcontrol: do not uncharge old page in page cache replacement
    Documentation: cgroup: add memory.swap.{current,max} description
    mm: free swap cache aggressively if memcg swap is full
    mm: vmscan: do not scan anon pages if memcg swap limit is hit
    swap.h: move memcg related stuff to the end of the file
    mm: memcontrol: replace mem_cgroup_lruvec_online with mem_cgroup_online
    mm: vmscan: pass memcg to get_scan_count()
    mm: memcontrol: charge swap to cgroup2
    mm: memcontrol: clean up alloc, online, offline, free functions
    mm: memcontrol: flatten struct cg_proto
    mm: memcontrol: rein in the CONFIG space madness
    net: drop tcp_memcontrol.c
    mm: memcontrol: introduce CONFIG_MEMCG_LEGACY_KMEM
    mm: memcontrol: allow to disable kmem accounting for cgroup2
    mm: memcontrol: account "kmem" consumers in cgroup2 memory controller
    mm: memcontrol: move kmem accounting code to CONFIG_MEMCG
    mm: memcontrol: separate kmem code from legacy tcp accounting code
    ...

    Linus Torvalds
     

21 Jan, 2016

16 commits

  • Pull asm-generic updates from Arnd Bergmann:
    "The asm-generic tree this time contains one series from Nicolas Pitre
    that makes the optimized do_div() implementation from the ARM
    architecture available to all architectures.

    This also adds stricter type checking for callers of do_div, which has
    uncovered a number of bugs in existing code, and fixes up the ones we
    have found"

    * tag 'asm-generic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
    ARM: asm/div64.h: adjust to generic codde
    __div64_32(): make it overridable at compile time
    __div64_const32(): abstract out the actual 128-bit cross product code
    do_div(): generic optimization for constant divisor on 32-bit machines
    div64.h: optimize do_div() for power-of-two constant divisors
    mtd/sm_ftl.c: fix wrong do_div() usage
    drm/mgag200/mgag200_mode.c: fix wrong do_div() usage
    hid-sensor-hub.c: fix wrong do_div() usage
    ti/fapll: fix wrong do_div() usage
    ti/clkt_dpll: fix wrong do_div() usage
    tegra/clk-divider: fix wrong do_div() usage
    imx/clk-pllv2: fix wrong do_div() usage
    imx/clk-pllv1: fix wrong do_div() usage
    nouveau/nvkm/subdev/clk/gk20a.c: fix wrong do_div() usage

    Linus Torvalds
     
  • Larry Finger reports:
    "My PowerBook G4 Aluminum with a 32-bit PPC processor fails to boot for
    the 4.4-git series".

    This is likely due to X still needing /dev/mem access on this platform.

    CONFIG_IO_STRICT_DEVMEM is not yet safe to turn on when
    CONFIG_STRICT_DEVMEM=y.

    Remove the default so that old configurations do not change behavior.

    Fixes: 90a545e98126 ("restrict /dev/mem to idle io memory ranges")
    Reported-by: Larry Finger
    Tested-by: Larry Finger
    Link: http://marc.info/?l=linux-kernel&m=145332012023825&w=2
    Acked-by: Kees Cook
    Cc: Arnd Bergmann
    Cc: Ingo Molnar
    Cc: Russell King
    Cc: Andrew Morton
    Cc: Greg Kroah-Hartman
    Signed-off-by: Dan Williams
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • UBSAN uses compile-time instrumentation to catch undefined behavior
    (UB). Compiler inserts code that perform certain kinds of checks before
    operations that could cause UB. If check fails (i.e. UB detected)
    __ubsan_handle_* function called to print error message.

    So the most of the work is done by compiler. This patch just implements
    ubsan handlers printing errors.

    GCC has this capability since 4.9.x [1] (see -fsanitize=undefined
    option and its suboptions).
    However GCC 5.x has more checkers implemented [2].
    Article [3] has a bit more details about UBSAN in the GCC.

    [1] - https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Debugging-Options.html
    [2] - https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
    [3] - http://developerblog.redhat.com/2014/10/16/gcc-undefined-behavior-sanitizer-ubsan/

    Issues which UBSAN has found thus far are:

    Found bugs:

    * out-of-bounds access - 97840cb67ff5 ("netfilter: nfnetlink: fix
    insufficient validation in nfnetlink_bind")

    undefined shifts:

    * d48458d4a768 ("jbd2: use a better hash function for the revoke
    table")

    * 10632008b9e1 ("clockevents: Prevent shift out of bounds")

    * 'x << -1' shift in ext4 -
    http://lkml.kernel.org/r/

    * undefined rol32(0) -
    http://lkml.kernel.org/r/

    * undefined dirty_ratelimit calculation -
    http://lkml.kernel.org/r/

    * undefined roundown_pow_of_two(0) -
    http://lkml.kernel.org/r/

    * [WONTFIX] undefined shift in __bpf_prog_run -
    http://lkml.kernel.org/r/

    WONTFIX here because it should be fixed in bpf program, not in kernel.

    signed overflows:

    * 32a8df4e0b33f ("sched: Fix odd values in effective_load()
    calculations")

    * mul overflow in ntp -
    http://lkml.kernel.org/r/

    * incorrect conversion into rtc_time in rtc_time64_to_tm() -
    http://lkml.kernel.org/r/

    * unvalidated timespec in io_getevents() -
    http://lkml.kernel.org/r/

    * [NOTABUG] signed overflow in ktime_add_safe() -
    http://lkml.kernel.org/r/

    [akpm@linux-foundation.org: fix unused local warning]
    [akpm@linux-foundation.org: fix __int128 build woes]
    Signed-off-by: Andrey Ryabinin
    Cc: Peter Zijlstra
    Cc: Sasha Levin
    Cc: Randy Dunlap
    Cc: Rasmus Villemoes
    Cc: Jonathan Corbet
    Cc: Michal Marek
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Yury Gribov
    Cc: Dmitry Vyukov
    Cc: Konstantin Khlebnikov
    Cc: Kostya Serebryany
    Cc: Johannes Berg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Ryabinin
     
  • The clz table (__clz_tab) in lib/clz_tab.c is also provided as part of
    libgcc.a, and many architectures link against libgcc. To allow the
    linker to avoid a multiple-definition link failure, clz_tab.o has to be
    in lib/lib.a rather than lib/builtin.o. The specific issue is that
    libgcc.a comes before lib/builtin.o on vmlinux.o's link command line, so
    its _clz.o is pulled to satisfy __clz_tab, and then when the remainder
    of lib/builtin.o is pulled in to satisfy all the other dependencies, the
    __clz_tab symbols conflict. By putting clz_tab.o in lib.a, the linker
    can simply avoid pulling it into vmlinux.o when this situation arises.

    The definitions of __clz_tab are the same in libgcc.a and in the kernel;
    arguably we could also simply rename the kernel version, but it's
    unlikely the libgcc version will ever change to become incompatible, so
    just using it seems reasonably safe.

    Signed-off-by: Chris Metcalf
    Acked-by: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Metcalf
     
  • Like others test are doing print the gathered statistics after test module
    is finished. Return from the module based on the result.

    Signed-off-by: Andy Shevchenko
    Acked-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Currently the only one combination is tested for overflow, i.e. rowsize =
    16, groupsize = 1, len = 1. Do various test to go through all possible
    branches.

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • After processing by hex_dump_to_buffer() check all the parts to be expected.

    Part 1. The actual expected hex dump with or without ASCII part.

    Part 2. Check if the buffer is dirty beyond needed.

    Part 3. Return code should be as expected.

    This is done by using comparison of the return code and memcmp() against
    the test buffer. We fill the buffer by FILL_CHAR ('#') characters, so, we
    expect to have a tail of the buffer will be left untouched. The
    terminating NUL is also checked by memcmp().

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Better to use memcmp() against entire buffer to check that nothing is
    happened to the data in the tail.

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

    Andy Shevchenko
     
  • The magic numbers of the length are converted to their actual meaning,
    such as end of the buffer with and without ASCII part.

    We don't touch the rest of the magic constants that will be removed in the
    following commits.

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • When test for overflow do iterate the buffer length in a range 0 ..
    BUF_SIZE.

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Define a character to fill the test buffers. Though the character should
    be printable since it's used when errors are reported. It should neither
    be from hex digit [a-fA-F0-9] dictionary nor space. It is recommended not
    to use one which is present in ASCII part of the test data. Later on we
    might switch to unprintable character to make test case more robust.

    Signed-off-by: Andy Shevchenko
    Suggested-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • The function prepares the expected result in the provided buffer.

    Signed-off-by: Andy Shevchenko
    Acked-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • The test suite currently doesn't cover many corner cases when
    hex_dump_to_buffer() runs into overflow. Refactor and amend test suite
    to cover most of the cases.

    This patch (of 9):

    Just to follow the scheme that most of the test modules are using.

    There is no fuctional change.

    Signed-off-by: Andy Shevchenko
    Acked-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Some drivers need to read data out of iomem areas 32-bits at a time.
    Add an API to do this.

    Signed-off-by: Stephen Boyd
    Cc: Bjorn Andersson
    Cc:
    Cc: David Howells
    Cc: Hauke Mehrtens
    Cc: Paul Walmsley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     
  • It was noticed that we lose precision in the final calculation for some
    inputs. The most egregious example is size=3000 blk_size=1900 in units
    of 10 should yield 5.70 MB but in fact yields 3.00 MB (oops).

    This is because the current algorithm doesn't correctly account for
    all the remainders in the logarithms. Fix this by doing a correct
    calculation in the remainders based on napier's algorithm.

    Additionally, now we have the correct result, we have to account for
    arithmetic rounding because we're printing 3 digits of precision. This
    means that if the fourth digit is five or greater, we have to round up,
    so add a section to ensure correct rounding. Finally account for all
    possible inputs correctly, including zero for block size.

    Fixes: b9f28d863594c429e1df35a0474d2663ca28b307
    Signed-off-by: James Bottomley
    Reported-by: Vitaly Kuznetsov
    Cc: [delay until after 4.4 release]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    James Bottomley
     
  • Fix the following build warning:

    lib/libcrc32c.c:42:5: warning: no previous prototype for "crc32c" [-Wmissing-prototypes]
    u32 crc32c(u32 crc, const void *address, unsigned int length)
    ^

    Signed-off-by: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean Delvare
     

20 Jan, 2016

1 commit

  • The IRQ_POLL_F_SCHED bit is set as long as polling is ongoing.
    This means that irq_poll_sched() must proceed if this bit has
    not yet been set.

    Fixes: commit ea51190c0315 ("irq_poll: fold irq_poll_sched_prep into irq_poll_sched").
    Signed-off-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Doug Ledford

    Bart Van Assche
     

19 Jan, 2016

1 commit

  • I don't think it makes sense for a module to have a soft dependency
    on itself. This seems quite cyclic by nature and I can't see what
    purpose it could serve.

    OTOH libcrc32c calls crypto_alloc_shash("crc32c", 0, 0) so it pretty
    much assumes that some incarnation of the "crc32c" hash algorithm has
    been loaded. Therefore it makes sense to have the soft dependency
    there (as crc-t10dif does.)

    Cc: stable@vger.kernel.org
    Cc: Tim Chen
    Cc: "David S. Miller"
    Signed-off-by: Jean Delvare
    Signed-off-by: Herbert Xu

    Jean Delvare
     

18 Jan, 2016

2 commits

  • The sw842 library code was merged in linux-4.1 and causes a very rare randconfig
    failure when CONFIG_CRC32 is not set:

    lib/built-in.o: In function `sw842_compress':
    oid_registry.c:(.text+0x12ddc): undefined reference to `crc32_be'
    lib/built-in.o: In function `sw842_decompress':
    oid_registry.c:(.text+0x137e4): undefined reference to `crc32_be'

    This adds an explict 'select CRC32' statement, similar to what the other users
    of the crc32 code have. In practice, CRC32 is always enabled anyway because
    over 100 other symbols select it.

    Cc: stable@vger.kernel.org
    Signed-off-by: Arnd Bergmann
    Fixes: 2da572c959dd ("lib: add software 842 compression/decompression")
    Acked-by: Dan Streetman
    Signed-off-by: Herbert Xu

    Arnd Bergmann
     
  • …/git/shuah/linux-kselftest

    Pull kselftest updates from Shuah Khan:
    "This 14 patch update:

    - adds a new test for intel_pstate driver
    - adds empty string and async test cases to firmware class tests
    - fixes and cleans up several existing tests"

    * tag 'linux-kselftest-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
    selftests: firmware: add empty string and async tests
    firmware: actually return NULL on failed request_firmware_nowait()
    test: firmware_class: add asynchronous request trigger
    test: firmware_class: use kstrndup() where appropriate
    test: firmware_class: report errors properly on failure
    selftests/seccomp: fix 32-bit build warnings
    add breakpoints/.gitignore
    add ptrace/.gitignore
    update .gitignore in selftests/timers
    update .gitignore in selftests/vm
    tools, testing, add test for intel_pstate driver
    selftest/ipc: actually test it
    selftests/capabilities: actually test it
    selftests/capabilities: clean up for Makefile

    Linus Torvalds
     

17 Jan, 2016

12 commits

  • Move switch case to the netdev_features_string() and rename it to
    netdev_bits(). In the future we can extend it as needed.

    Here we replace the fallback of %pN from '%p' with possible flags to
    sticter '0x%p' without any flags variation.

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • special_hex_number() is a helper to print a fixed size type in a hex
    format with '0x' prefix, zero padding, and small letters. In the module
    we have already several copies of such code. Consolidate them under
    special_hex_number() helper.

    There are couple of differences though.

    It seems nobody cared about the output in case of CONFIG_KALLSYMS=n,
    when printing symbol address, because the asked field width is not
    enough to care last 2 characters in the string represantation of the
    pointer. Fixed here.

    The %pNF specifier used to be allowed with a specific field width,
    though there is neither any user of it nor mention the possibility in
    the documentation.

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Signed-off-by: Rasmus Villemoes
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • Following "lib/vsprintf.c: expand field_width to 24 bits", let's add a
    test to see that we now actually support bitmaps with 65536 bits.

    Signed-off-by: Rasmus Villemoes
    Acked-by: Kees Cook
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • These should also count as performed tests.

    Signed-off-by: Rasmus Villemoes
    Acked-by: Kees Cook
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • This adds a few tests to test_number, one of which serves to document
    another deviation from POSIX/C99 (printing 0 with an explicit precision
    of 0).

    Signed-off-by: Rasmus Villemoes
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • The kernel's printf doesn't follow the standards in a few corner cases
    (which are probably mostly irrelevant). Add tests that document the
    current behaviour.

    Signed-off-by: Rasmus Villemoes
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • Add a few padding bytes on either side of the test buffer, and check
    that these (and the part of the buffer not used) are untouched by
    vsnprintf.

    Signed-off-by: Rasmus Villemoes
    Acked-by: Kees Cook
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • BUG is a completely unnecessarily big hammer, and we're more likely to
    get the internal bug reported if we just pr_err() and ensure the test
    suite fails.

    Signed-off-by: Rasmus Villemoes
    Acked-by: Kees Cook
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • kasprintf relies on being able to replay the formatting and getting the
    same result (in particular, the same length). This will almost always
    work, but it is possible that the object pointed to by a %s or %p
    argument changed under us (so we might get truncated output). Add a
    somewhat paranoid sanity check and let's see if it ever triggers.

    Signed-off-by: Rasmus Villemoes
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • The field width is overloaded to pass some extra information for some %p
    extensions (e.g. #bits for %pb). But we might silently truncate the
    passed value when we stash it in struct printf_spec (see e.g.
    "lib/vsprintf.c: expand field_width to 24 bits"). Hopefully 23 value
    bits should now be enough for everybody, but if not, let's make some
    noise.

    Do the same for the precision. In both cases, clamping seems more
    sensible than truncating. While, according to POSIX, "A negative
    precision is taken as if the precision were omitted.", the kernel's
    printf has always treated that case as if the precision was 0, so we use
    that as lower bound. For the field width, the smallest representable
    value is actually -(1<
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • One consequence of the reorganization of struct printf_spec to make
    field_width 24 bits was that number() gained about 180 bytes. Since
    spec is never passed to other functions, we can help gcc make number()
    lose most of that extra weight by using local variables for the field
    width and precision.

    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rasmus Villemoes
    Cc: Al Viro
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes