1. 14 Jan, 2018 9 commits
  2. 13 Jan, 2018 6 commits
    • Alexei Starovoitov's avatar
      Merge branch 'error-injection' · fdde5f3b
      Alexei Starovoitov authored
      Masami Hiramatsu says:
      
      ====================
      Here are the 5th version of patches to moving error injection
      table from kprobes. This version fixes a bug and update
      fail-function to support multiple function error injection.
      
      Here is the previous version:
      
      https://patchwork.ozlabs.org/cover/858663/
      
      Changes in v5:
       - [3/5] Fix a bug that within_error_injection returns false always.
       - [5/5] Update to support multiple function error injection.
      
      Thank you,
      ====================
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      fdde5f3b
    • Masami Hiramatsu's avatar
      error-injection: Support fault injection framework · 4b1a29a7
      Masami Hiramatsu authored
      Support in-kernel fault-injection framework via debugfs.
      This allows you to inject a conditional error to specified
      function using debugfs interfaces.
      
      Here is the result of test script described in
      Documentation/fault-injection/fault-injection.txt
      
        ===========
        # ./test_fail_function.sh
        1+0 records in
        1+0 records out
        1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.0227404 s, 46.1 MB/s
        btrfs-progs v4.4
        See http://btrfs.wiki.kernel.org for more information.
      
        Label:              (null)
        UUID:               bfa96010-12e9-4360-aed0-42eec7af5798
        Node size:          16384
        Sector size:        4096
        Filesystem size:    1001.00MiB
        Block group profiles:
          Data:             single            8.00MiB
          Metadata:         DUP              58.00MiB
          System:           DUP              12.00MiB
        SSD detected:       no
        Incompat features:  extref, skinny-metadata
        Number of devices:  1
        Devices:
           ID        SIZE  PATH
            1  1001.00MiB  /dev/loop2
      
        mount: mount /dev/loop2 on /opt/tmpmnt failed: Cannot allocate memory
        SUCCESS!
        ===========
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Reviewed-by: default avatarJosef Bacik <jbacik@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      4b1a29a7
    • Masami Hiramatsu's avatar
      error-injection: Add injectable error types · 663faf9f
      Masami Hiramatsu authored
      Add injectable error types for each error-injectable function.
      
      One motivation of error injection test is to find software flaws,
      mistakes or mis-handlings of expectable errors. If we find such
      flaws by the test, that is a program bug, so we need to fix it.
      
      But if the tester miss input the error (e.g. just return success
      code without processing anything), it causes unexpected behavior
      even if the caller is correctly programmed to handle any errors.
      That is not what we want to test by error injection.
      
      To clarify what type of errors the caller must expect for each
      injectable function, this introduces injectable error types:
      
       - EI_ETYPE_NULL : means the function will return NULL if it
      		    fails. No ERR_PTR, just a NULL.
       - EI_ETYPE_ERRNO : means the function will return -ERRNO
      		    if it fails.
       - EI_ETYPE_ERRNO_NULL : means the function will return -ERRNO
      		       (ERR_PTR) or NULL.
      
      ALLOW_ERROR_INJECTION() macro is expanded to get one of
      NULL, ERRNO, ERRNO_NULL to record the error type for
      each function. e.g.
      
       ALLOW_ERROR_INJECTION(open_ctree, ERRNO)
      
      This error types are shown in debugfs as below.
      
        ====
        / # cat /sys/kernel/debug/error_injection/list
        open_ctree [btrfs]	ERRNO
        io_ctl_init [btrfs]	ERRNO
        ====
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Reviewed-by: default avatarJosef Bacik <jbacik@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      663faf9f
    • Masami Hiramatsu's avatar
      error-injection: Separate error-injection from kprobe · 540adea3
      Masami Hiramatsu authored
      Since error-injection framework is not limited to be used
      by kprobes, nor bpf. Other kernel subsystems can use it
      freely for checking safeness of error-injection, e.g.
      livepatch, ftrace etc.
      So this separate error-injection framework from kprobes.
      
      Some differences has been made:
      
      - "kprobe" word is removed from any APIs/structures.
      - BPF_ALLOW_ERROR_INJECTION() is renamed to
        ALLOW_ERROR_INJECTION() since it is not limited for BPF too.
      - CONFIG_FUNCTION_ERROR_INJECTION is the config item of this
        feature. It is automatically enabled if the arch supports
        error injection feature for kprobe or ftrace etc.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Reviewed-by: default avatarJosef Bacik <jbacik@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      540adea3
    • Masami Hiramatsu's avatar
      tracing/kprobe: bpf: Compare instruction pointer with original one · 66665ad2
      Masami Hiramatsu authored
      Compare instruction pointer with original one on the
      stack instead using per-cpu bpf_kprobe_override flag.
      
      This patch also consolidates reset_current_kprobe() and
      preempt_enable_no_resched() blocks. Those can be done
      in one place.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Reviewed-by: default avatarJosef Bacik <jbacik@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      66665ad2
    • Masami Hiramatsu's avatar
      tracing/kprobe: bpf: Check error injectable event is on function entry · b4da3340
      Masami Hiramatsu authored
      Check whether error injectable event is on function entry or not.
      Currently it checks the event is ftrace-based kprobes or not,
      but that is wrong. It should check if the event is on the entry
      of target function. Since error injection will override a function
      to just return with modified return value, that operation must
      be done before the target function starts making stackframe.
      
      As a side effect, bpf error injection is no need to depend on
      function-tracer. It can work with sw-breakpoint based kprobe
      events too.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Reviewed-by: default avatarJosef Bacik <jbacik@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      b4da3340
  3. 12 Jan, 2018 16 commits
  4. 11 Jan, 2018 9 commits
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next · 8c2e6c90
      David S. Miller authored
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf-next 2018-01-11
      
      The following pull-request contains BPF updates for your *net-next* tree.
      
      The main changes are:
      
      1) Various BPF related improvements and fixes to nfp driver: i) do
         not register XDP RXQ structure to control queues, ii) round up
         program stack size to word size for nfp, iii) restrict MTU changes
         when BPF offload is active, iv) add more fully featured relocation
         support to JIT, v) add support for signed compare instructions to
         the nfp JIT, vi) export and reuse verfier log routine for nfp, and
         many more, from Jakub, Quentin and Nic.
      
      2) Fix a syzkaller reported GPF in BPF's copy_verifier_state() when
         we hit kmalloc failure path, from Alexei.
      
      3) Add two follow-up fixes for the recent XDP RXQ series: i) kvzalloc()
         allocated memory was only kfree()'ed, and ii) fix a memory leak where
         RX queue was not freed in netif_free_rx_queues(), from Jakub.
      
      4) Add a sample for transferring XDP meta data into the skb, here it
         is used for setting skb->mark with the buffer from XDP, from Jesper.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8c2e6c90
    • David S. Miller's avatar
      Merge branch 'for-upstream' of... · 3d93e337
      David S. Miller authored
      Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
      
      Johan Hedberg says:
      
      ====================
      pull request: bluetooth-next 2018-01-11
      
      Here's likely the last bluetooth-next pull request for the 4.16 kernel.
      
       - Added support for Bluetooth on 2015+ MacBook (Pro)
       - Fix to QCA Rome suspend/resume handling
       - Two new QCA_ROME USB IDs in btusb
       - A few other minor fixes
      
      Please let me know if there are any issues pulling. Thanks.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d93e337
    • Wei Yongjun's avatar
      net: phy: mdio-bcm-unimac: fix potential NULL dereference in unimac_mdio_probe() · 297a6961
      Wei Yongjun authored
      platform_get_resource() may fail and return NULL, so we should
      better check it's return value to avoid a NULL pointer dereference
      a bit later in the code.
      
      This is detected by Coccinelle semantic patch.
      
      @@
      expression pdev, res, n, t, e, e1, e2;
      @@
      
      res = platform_get_resource(pdev, t, n);
      + if (!res)
      +   return -EINVAL;
      ... when != res == NULL
      e = devm_ioremap(e1, res->start, e2);
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      297a6961
    • Wei Yongjun's avatar
      net: socionext: Fix error return code in netsec_netdev_open() · ecb10288
      Wei Yongjun authored
      Fix to return error code -ENODEV from the of_phy_connect() error
      handling case instead of 0, as done elsewhere in this function.
      
      Fixes: 533dd11a ("net: socionext: Add Synquacer NetSec driver")
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ecb10288
    • Arnd Bergmann's avatar
      net: socionext: include linux/io.h to fix build · d9f52372
      Arnd Bergmann authored
      I ran into a randconfig build failure:
      
      drivers/net/ethernet/socionext/netsec.c: In function 'netsec_probe':
      drivers/net/ethernet/socionext/netsec.c:1583:17: error: implicit declaration of function 'devm_ioremap'; did you mean 'ioremap'? [-Werror=implicit-function-declaration]
      
      Including linux/io.h directly fixes this.
      
      Fixes: 533dd11a ("net: socionext: Add Synquacer NetSec driver")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d9f52372
    • David S. Miller's avatar
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 532b5aa0
      David S. Miller authored
      Jeff Kirsher says:
      
      ====================
      40GbE Intel Wired LAN Driver Updates 2018-01-10
      
      This series contains updates to i40e and i40evf only.
      
      Alice adds the displaying of priority xon/xoff packet stats, since we
      were already keeping track of them.  Based on the recent changes, bump
      the driver versions.
      
      Jake changes how the driver determines whether or not the device is
      currently up to resolve the possible issue of freeing data structures
      and other memory before they have been fully allocated.  Refactored
      the driver to simplify the locking behavior and to consistently use
      spinlocks instead of an overloaded bit lock to protect MAC and filter
      lists.  Created a helper function which can convert the AdminQ link
      speed definition into a virtchnl definition.
      
      Colin Ian King cleans up a redundant variable initialization.
      
      Alex cleans up the driver to stop clearing the pending bit array for
      each vector manually, since it is prone to dropping an interrupt and
      based on the hardware specs, the pending bit array will be cleared
      automatically in MSI-X mode.  Cleaned up flags for promiscuous mode to
      resolve an issue where enabling & disabling promiscuous mode on a VF
      would leave us in a high polling rate for the adminq task.  Cleaned up
      code that was prone to race issues.
      
      Jingjing renames pipeline personalization profile (ppp) to dynamic
      device personalization (ddp) because it was being confused with the
      well known point to point protocol.  Also removed checks for "track_id"
      being zero, since it is valid for it to be zero for profiles that do
      not have any 'write' commands.
      
      v2: cleaned up commit message for patch 12 based on feedback from Sergei
          Shtylyov and Alex Duyck
      v3: dropped patch 15 from the original series while Mariusz Stachura
          works on the changes that Jakub Kicinski has suggested
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      532b5aa0
    • Nathan Fontenot's avatar
      ibmvnic: Don't handle RX interrupts when not up. · 09fb35ea
      Nathan Fontenot authored
      Initiating a kdump via the command line can cause a pending interrupt
      to be handled by the ibmvnic driver when initializing the sub-CRQ
      irqs during driver initialization.
      
      NIP [d000000000ca34f0] ibmvnic_interrupt_rx+0x40/0xd0 [ibmvnic]
      LR [c000000008132ef0] __handle_irq_event_percpu+0xa0/0x2f0
      Call Trace:
      [c000000047fcfde0] [c000000008132ef0] __handle_irq_event_percpu+0xa0/0x2f0
      [c000000047fcfea0] [c00000000813317c] handle_irq_event_percpu+0x3c/0x90
      [c000000047fcfee0] [c00000000813323c] handle_irq_event+0x6c/0xd0
      [c000000047fcff10] [c0000000081385e0] handle_fasteoi_irq+0xf0/0x250
      [c000000047fcff40] [c0000000081320a0] generic_handle_irq+0x50/0x80
      [c000000047fcff60] [c000000008014984] __do_irq+0x84/0x1d0
      [c000000047fcff90] [c000000008027564] call_do_irq+0x14/0x24
      [c00000003c92af00] [c000000008014b70] do_IRQ+0xa0/0x120
      [c00000003c92af50] [c000000008002594] hardware_interrupt_common+0x114/0x180
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      09fb35ea
    • Ganesh Goudar's avatar
      4621ffd6
    • Ganesh Goudar's avatar
      cxgb4: add support for vxlan segmentation offload · d0a1299c
      Ganesh Goudar authored
      add changes to t4_eth_xmit to enable vxlan segmentation
      offload support.
      
      Original work by: Santosh Rastapur <santosh@chelsio.com>
      Signed-off-by: default avatarGanesh Goudar <ganeshgr@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d0a1299c