Skip to content
Snippets Groups Projects
  1. Dec 08, 2016
  2. Dec 07, 2016
  3. Dec 06, 2016
  4. Dec 05, 2016
    • Florian Fainelli's avatar
      net: ep93xx_eth: Do not crash unloading module · c823abac
      Florian Fainelli authored
      
      When we unload the ep93xx_eth, whether we have opened the network
      interface or not, we will either hit a kernel paging request error, or a
      simple NULL pointer de-reference because:
      
      - if ep93xx_open has been called, we have created a valid DMA mapping
        for ep->descs, when we call ep93xx_stop, we also call
        ep93xx_free_buffers, ep->descs now has a stale value
      
      - if ep93xx_open has not been called, we have a NULL pointer for
        ep->descs, so performing any operation against that address just won't
        work
      
      Fix this by adding a NULL pointer check for ep->descs which means that
      ep93xx_free_buffers() was able to successfully tear down the descriptors
      and free the DMA cookie as well.
      
      Fixes: 1d22e05d ("[PATCH] Cirrus Logic ep93xx ethernet driver")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c823abac
    • David S. Miller's avatar
      Merge branch 'bnx2x-fixes' · 34e0f2c2
      David S. Miller authored
      
      Yuval Mintz says:
      
      ====================
      bnx2x: fixes series
      
      Two unrelated fixes for bnx2x - the first one is nice-to-have,
      while the other fixes fatal behaviour in older adapters.
      
      Please consider applying them to `net'.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      34e0f2c2
    • Mintz, Yuval's avatar
      bnx2x: Prevent tunnel config for 577xx · 360d9df2
      Mintz, Yuval authored
      
      Only the 578xx adapters are capable of configuring UDP ports for
      the purpose of tunnelling - doing the same on 577xx might lead to
      a firmware assertion.
      We're already not claiming support for any related feature for such
      devices, but we also need to prevent the configuration of the UDP
      ports to the device in this case.
      
      Fixes: f34fa14c ("bnx2x: Add vxlan RSS support")
      Reported-by: default avatarAnikina Anna <anikina@gmail.com>
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      360d9df2
    • Mintz, Yuval's avatar
      bnx2x: Correct ringparam estimate when DOWN · 65870fa7
      Mintz, Yuval authored
      
      Until interface is up [and assuming ringparams weren't explicitly
      configured] when queried for the size of its rings bnx2x would
      claim they're the maximal size by default.
      That is incorrect as by default the maximal number of buffers would
      be equally divided between the various rx rings.
      
      This prevents the user from actually setting the number of elements
      on each rx ring to be of maximal size prior to transitioning the
      interface into up state.
      
      To fix this, make a rough estimation about the number of buffers.
      It wouldn't always be accurate, but it would be much better than
      current estimation and would allow users to increase number of
      buffers during early initialization of the interface.
      
      Reported-by: default avatarSeymour, Shane <shane.seymour@hpe.com>
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      65870fa7
    • Pan Bian's avatar
      isdn: hisax: set error code on failure · 9a53682b
      Pan Bian authored
      In function hfc4s8s_probe(), the value of return variable err should be
      negative on failures. However, when the call to request_region() returns
      NULL, the value of err is 0. This patch fixes the bug, assigning
      "-EBUSY" to err on the path that request_region() fails.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188931
      
      
      
      Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9a53682b
    • Pan Bian's avatar
      net: bnx2x: fix improper return value · 005f7e68
      Pan Bian authored
      Macro BNX2X_ALLOC_AND_SET(arr, lbl, func) calls kmalloc() to allocate
      memory, and jumps to label "lbl" if the allocation fails. Label "lbl"
      first cleans memory and then returns variable rc. Before calling the
      macro, the value of variable rc is 0. Because 0 means no error, the
      callers of bnx2x_init_firmware() may be misled. This patch fixes the bug,
      assigning "-ENOMEM" to rc before calling macro NX2X_ALLOC_AND_SET().
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189141
      
      
      
      Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      005f7e68
    • Pan Bian's avatar
      net: ethernet: qlogic: set error code on failure · 0ff18d2d
      Pan Bian authored
      When calling dma_mapping_error(), the value of return variable rc is 0.
      And when the call returns an unexpected value, rc is not set to a
      negative errno. Thus, it will return 0 on the error path, and its
      callers cannot detect the bug. This patch fixes the bug, assigning
      "-ENOMEM" to err.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189041
      
      
      
      Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
      Acked-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0ff18d2d
    • Pan Bian's avatar
      atm: fix improper return value · 7cf61566
      Pan Bian authored
      It returns variable "error" when ioremap_nocache() returns a NULL
      pointer. The value of "error" is 0 then, which will mislead the callers
      to believe that there is no error. This patch fixes the bug, returning
      "-ENOMEM".
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189021
      
      
      
      Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7cf61566
    • Pan Bian's avatar
      net: irda: set error code on failures · 8ad3ba93
      Pan Bian authored
      When the calls to kzalloc() fail, the value of return variable ret may
      be 0. 0 means success in this context. This patch fixes the bug,
      assigning "-ENOMEM" to ret before calling kzalloc().
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188971
      
      
      
      Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8ad3ba93
    • Pan Bian's avatar
      net: caif: remove ineffective check · c79e167c
      Pan Bian authored
      The check of the return value of sock_register() is ineffective.
      "if(!err)" seems to be a typo. It is better to propagate the error code
      to the callers of caif_sktinit_module(). This patch removes the check
      statment and directly returns the result of sock_register().
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188751
      
      
      Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c79e167c
    • Kees Cook's avatar
      net: ping: check minimum size on ICMP header length · 0eab121e
      Kees Cook authored
      
      Prior to commit c0371da6 ("put iov_iter into msghdr") in v3.19, there
      was no check that the iovec contained enough bytes for an ICMP header,
      and the read loop would walk across neighboring stack contents. Since the
      iov_iter conversion, bad arguments are noticed, but the returned error is
      EFAULT. Returning EINVAL is a clearer error and also solves the problem
      prior to v3.19.
      
      This was found using trinity with KASAN on v3.18:
      
      BUG: KASAN: stack-out-of-bounds in memcpy_fromiovec+0x60/0x114 at addr ffffffc071077da0
      Read of size 8 by task trinity-c2/9623
      page:ffffffbe034b9a08 count:0 mapcount:0 mapping:          (null) index:0x0
      flags: 0x0()
      page dumped because: kasan: bad access detected
      CPU: 0 PID: 9623 Comm: trinity-c2 Tainted: G    BU         3.18.0-dirty #15
      Hardware name: Google Tegra210 Smaug Rev 1,3+ (DT)
      Call trace:
      [<ffffffc000209c98>] dump_backtrace+0x0/0x1ac arch/arm64/kernel/traps.c:90
      [<ffffffc000209e54>] show_stack+0x10/0x1c arch/arm64/kernel/traps.c:171
      [<     inline     >] __dump_stack lib/dump_stack.c:15
      [<ffffffc000f18dc4>] dump_stack+0x7c/0xd0 lib/dump_stack.c:50
      [<     inline     >] print_address_description mm/kasan/report.c:147
      [<     inline     >] kasan_report_error mm/kasan/report.c:236
      [<ffffffc000373dcc>] kasan_report+0x380/0x4b8 mm/kasan/report.c:259
      [<     inline     >] check_memory_region mm/kasan/kasan.c:264
      [<ffffffc00037352c>] __asan_load8+0x20/0x70 mm/kasan/kasan.c:507
      [<ffffffc0005b9624>] memcpy_fromiovec+0x5c/0x114 lib/iovec.c:15
      [<     inline     >] memcpy_from_msg include/linux/skbuff.h:2667
      [<ffffffc000ddeba0>] ping_common_sendmsg+0x50/0x108 net/ipv4/ping.c:674
      [<ffffffc000dded30>] ping_v4_sendmsg+0xd8/0x698 net/ipv4/ping.c:714
      [<ffffffc000dc91dc>] inet_sendmsg+0xe0/0x12c net/ipv4/af_inet.c:749
      [<     inline     >] __sock_sendmsg_nosec net/socket.c:624
      [<     inline     >] __sock_sendmsg net/socket.c:632
      [<ffffffc000cab61c>] sock_sendmsg+0x124/0x164 net/socket.c:643
      [<     inline     >] SYSC_sendto net/socket.c:1797
      [<ffffffc000cad270>] SyS_sendto+0x178/0x1d8 net/socket.c:1761
      
      CVE-2016-8399
      
      Reported-by: default avatarQidan He <i@flanker017.me>
      Fixes: c319b4d7 ("net: ipv4: add IPPROTO_ICMP socket kind")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0eab121e
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.9-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · d9d04527
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Four fixes, the first for code we merged this cycle and three that are
        also going to stable:
      
         - On 64-bit Book3E we were not placing the .text section where we
           said we would in the asm.
      
         - We broke building the boot wrapper on some 32-bit toolchains.
      
         - Lazy icache flushing was broken on pre-POWER5 machines.
      
         - One of the error paths in our EEH code would lead to a deadlock.
      
        Thanks to: Andrew Donnellan, Ben Hutchings, Benjamin Herrenschmidt,
        Nicholas Piggin"
      
      * tag 'powerpc-4.9-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/64: Fix placement of .text to be immediately following .head.text
        powerpc/eeh: Fix deadlock when PE frozen state can't be cleared
        powerpc/mm: Fix lazy icache flush on pre-POWER5
        powerpc/boot: Fix build failure in 32-bit boot wrapper
      d9d04527
Loading