Skip to content
  1. Sep 10, 2016
  2. Sep 08, 2016
  3. Sep 07, 2016
  4. Sep 06, 2016
  5. Sep 05, 2016
    • Jeffrey Hugo's avatar
      efi/libstub: Introduce ExitBootServices helper · fc07716b
      Jeffrey Hugo authored
      
      
      The spec allows ExitBootServices to fail with EFI_INVALID_PARAMETER if a
      race condition has occurred where the EFI has updated the memory map after
      the stub grabbed a reference to the map.  The spec defines a retry
      proceedure with specific requirements to handle this scenario.
      
      This scenario was previously observed on x86 - commit d3768d88 ("x86,
      efi: retry ExitBootServices() on failure") but the current fix is not spec
      compliant and the scenario is now observed on the Qualcomm Technologies
      QDF2432 via the FDT stub which does not handle the error and thus causes
      boot failures.  The user will notice the boot failure as the kernel is not
      executed and the system may drop back to a UEFI shell, but will be
      unresponsive to input and the system will require a power cycle to recover.
      
      Add a helper to the stub library that correctly adheres to the spec in the
      case of EFI_INVALID_PARAMETER from ExitBootServices and can be universally
      used across all stub implementations.
      
      Signed-off-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
      fc07716b
    • Jeffrey Hugo's avatar
      efi/libstub: Allocate headspace in efi_get_memory_map() · dadb57ab
      Jeffrey Hugo authored
      
      
      efi_get_memory_map() allocates a buffer to store the memory map that it
      retrieves.  This buffer may need to be reused by the client after
      ExitBootServices() is called, at which point allocations are not longer
      permitted.  To support this usecase, provide the allocated buffer size back
      to the client, and allocate some additional headroom to account for any
      reasonable growth in the map that is likely to happen between the call to
      efi_get_memory_map() and the client reusing the buffer.
      
      Signed-off-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
      dadb57ab
    • Jan Beulich's avatar
      efi: Make for_each_efi_memory_desc_in_map() cope with running on Xen · d4c4fed0
      Jan Beulich authored
      
      
      While commit 55f1ea15 ("efi: Fix for_each_efi_memory_desc_in_map()
      for empty memmaps") made an attempt to deal with empty memory maps, it
      didn't address the case where the map field never gets set, as is
      apparently the case when running under Xen.
      
      Reported-by: default avatar <lists@ssl-mail.com>
      Tested-by: default avatar <lists@ssl-mail.com>
      Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: <stable@vger.kernel.org> # v4.7+
      Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
      [ Guard the loop with a NULL check instead of pointer underflow ]
      Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
      d4c4fed0
    • Johannes Berg's avatar
      locking/barriers: Don't use sizeof(void) in lockless_dereference() · d7127b5e
      Johannes Berg authored
      
      
      My previous commit:
      
        112dc0c8 ("locking/barriers: Suppress sparse warnings in lockless_dereference()")
      
      caused sparse to complain that (in radix-tree.h) we use sizeof(void)
      since that rcu_dereference()s a void *.
      
      Really, all we need is to have the expression *p in here somewhere
      to make sure p is a pointer type, and sizeof(*p) was the thing that
      came to my mind first to make sure that's done without really doing
      anything at runtime.
      
      Another thing I had considered was using typeof(*p), but obviously
      we can't just declare a typeof(*p) variable either, since that may
      end up being void. Declaring a variable as typeof(*p)* gets around
      that, and still checks that typeof(*p) is valid, so do that. This
      type construction can't be done for _________p1 because that will
      actually be used and causes sparse address space warnings, so keep
      a separate unused variable for it.
      
      Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E . McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: kbuild-all@01.org
      Fixes: 112dc0c8 ("locking/barriers: Suppress sparse warnings in lockless_dereference()")
      Link: http://lkml.kernel.org/r/1472192160-4049-1-git-send-email-johannes@sipsolutions.net
      
      
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      d7127b5e
  6. Sep 04, 2016
    • Linus Torvalds's avatar
      af_unix: split 'u->readlock' into two: 'iolock' and 'bindlock' · 6e1ce3c3
      Linus Torvalds authored
      
      
      Right now we use the 'readlock' both for protecting some of the af_unix
      IO path and for making the bind be single-threaded.
      
      The two are independent, but using the same lock makes for a nasty
      deadlock due to ordering with regards to filesystem locking.  The bind
      locking would want to nest outside the VSF pathname locking, but the IO
      locking wants to nest inside some of those same locks.
      
      We tried to fix this earlier with commit c845acb3 ("af_unix: Fix
      splice-bind deadlock") which moved the readlock inside the vfs locks,
      but that caused problems with overlayfs that will then call back into
      filesystem routines that take the lock in the wrong order anyway.
      
      Splitting the locks means that we can go back to having the bind lock be
      the outermost lock, and we don't have any deadlocks with lock ordering.
      
      Acked-by: default avatarRainer Weikusat <rweikusat@cyberadapt.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6e1ce3c3
    • Mahesh Bandewar's avatar
      bonding: Fix bonding crash · 24b27fc4
      Mahesh Bandewar authored
      
      
      Following few steps will crash kernel -
      
        (a) Create bonding master
            > modprobe bonding miimon=50
        (b) Create macvlan bridge on eth2
            > ip link add link eth2 dev mvl0 address aa:0:0:0:0:01 \
      	   type macvlan
        (c) Now try adding eth2 into the bond
            > echo +eth2 > /sys/class/net/bond0/bonding/slaves
            <crash>
      
      Bonding does lots of things before checking if the device enslaved is
      busy or not.
      
      In this case when the notifier call-chain sends notifications, the
      bond_netdev_event() assumes that the rx_handler /rx_handler_data is
      registered while the bond_enslave() hasn't progressed far enough to
      register rx_handler for the new slave.
      
      This patch adds a rx_handler check that can be performed right at the
      beginning of the enslave code to avoid getting into this situation.
      
      Signed-off-by: default avatarMahesh Bandewar <maheshb@google.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      24b27fc4
  7. Sep 02, 2016
  8. Sep 01, 2016
    • Miklos Szeredi's avatar
      ovl: don't cache acl on overlay layer · 2a3a2a3f
      Miklos Szeredi authored
      
      
      Some operations (setxattr/chmod) can make the cached acl stale.  We either
      need to clear overlay's acl cache for the affected inode or prevent acl
      caching on the overlay altogether.  Preventing caching has the following
      advantages:
      
       - no double caching, less memory used
      
       - overlay cache doesn't go stale when fs clears it's own cache
      
      Possible disadvantage is performance loss.  If that becomes a problem
      get_acl() can be optimized for overlayfs.
      
      This patch disables caching by pre setting i_*acl to a value that
      
        - has bit 0 set, so is_uncached_acl() will return true
      
        - is not equal to ACL_NOT_CACHED, so get_acl() will not overwrite it
      
      The constant -3 was chosen for this purpose.
      
      Fixes: 39a25b2b ("ovl: define ->get_acl() for overlay inodes")
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      2a3a2a3f
  9. Aug 31, 2016
  10. Aug 30, 2016
    • Josh Poimboeuf's avatar
      mm/usercopy: get rid of CONFIG_DEBUG_STRICT_USER_COPY_CHECKS · 0d025d27
      Josh Poimboeuf authored
      
      
      There are three usercopy warnings which are currently being silenced for
      gcc 4.6 and newer:
      
      1) "copy_from_user() buffer size is too small" compile warning/error
      
         This is a static warning which happens when object size and copy size
         are both const, and copy size > object size.  I didn't see any false
         positives for this one.  So the function warning attribute seems to
         be working fine here.
      
         Note this scenario is always a bug and so I think it should be
         changed to *always* be an error, regardless of
         CONFIG_DEBUG_STRICT_USER_COPY_CHECKS.
      
      2) "copy_from_user() buffer size is not provably correct" compile warning
      
         This is another static warning which happens when I enable
         __compiletime_object_size() for new compilers (and
         CONFIG_DEBUG_STRICT_USER_COPY_CHECKS).  It happens when object size
         is const, but copy size is *not*.  In this case there's no way to
         compare the two at build time, so it gives the warning.  (Note the
         warning is a byproduct of the fact that gcc has no way of knowing
         whether the overflow function will be called, so the call isn't dead
         code and the warning attribute is activated.)
      
         So this warning seems to only indicate "this is an unusual pattern,
         maybe you should check it out" rather than "this is a bug".
      
         I get 102(!) of these warnings with allyesconfig and the
         __compiletime_object_size() gcc check removed.  I don't know if there
         are any real bugs hiding in there, but from looking at a small
         sample, I didn't see any.  According to Kees, it does sometimes find
         real bugs.  But the false positive rate seems high.
      
      3) "Buffer overflow detected" runtime warning
      
         This is a runtime warning where object size is const, and copy size >
         object size.
      
      All three warnings (both static and runtime) were completely disabled
      for gcc 4.6 with the following commit:
      
        2fb0815c ("gcc4: disable __compiletime_object_size for GCC 4.6+")
      
      That commit mistakenly assumed that the false positives were caused by a
      gcc bug in __compiletime_object_size().  But in fact,
      __compiletime_object_size() seems to be working fine.  The false
      positives were instead triggered by #2 above.  (Though I don't have an
      explanation for why the warnings supposedly only started showing up in
      gcc 4.6.)
      
      So remove warning #2 to get rid of all the false positives, and re-enable
      warnings #1 and #3 by reverting the above commit.
      
      Furthermore, since #1 is a real bug which is detected at compile time,
      upgrade it to always be an error.
      
      Having done all that, CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is no longer
      needed.
      
      Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: "H . Peter Anvin" <hpa@zytor.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Byungchul Park <byungchul.park@lge.com>
      Cc: Nilay Vaish <nilayvaish@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0d025d27
    • Linus Lüssing's avatar
      cfg80211: Add stub for cfg80211_get_station() · 61aaa0e8
      Linus Lüssing authored
      
      
      This allows modules using this function (currently: batman-adv) to
      compile even if cfg80211 is not built at all, thus relaxing
      dependencies.
      
      Signed-off-by: default avatarLinus Lüssing <linus.luessing@c0d3.blue>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      61aaa0e8
  11. Aug 29, 2016
    • Russell King's avatar
      net: smc91x: fix SMC accesses · 2fb04fdf
      Russell King authored
      
      
      Commit b70661c7 ("net: smc91x: use run-time configuration on all ARM
      machines") broke some ARM platforms through several mistakes.  Firstly,
      the access size must correspond to the following rule:
      
      (a) at least one of 16-bit or 8-bit access size must be supported
      (b) 32-bit accesses are optional, and may be enabled in addition to
          the above.
      
      Secondly, it provides no emulation of 16-bit accesses, instead blindly
      making 16-bit accesses even when the platform specifies that only 8-bit
      is supported.
      
      Reorganise smc91x.h so we can make use of the existing 16-bit access
      emulation already provided - if 16-bit accesses are supported, use
      16-bit accesses directly, otherwise if 8-bit accesses are supported,
      use the provided 16-bit access emulation.  If neither, BUG().  This
      exactly reflects the driver behaviour prior to the commit being fixed.
      
      Since the conversion incorrectly cut down the available access sizes on
      several platforms, we also need to go through every platform and fix up
      the overly-restrictive access size: Arnd assumed that if a platform can
      perform 32-bit, 16-bit and 8-bit accesses, then only a 32-bit access
      size needed to be specified - not so, all available access sizes must
      be specified.
      
      This likely fixes some performance regressions in doing this: if a
      platform does not support 8-bit accesses, 8-bit accesses have been
      emulated by performing a 16-bit read-modify-write access.
      
      Tested on the Intel Assabet/Neponset platform, which supports only 8-bit
      accesses, which was broken by the original commit.
      
      Fixes: b70661c7 ("net: smc91x: use run-time configuration on all ARM machines")
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Tested-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2fb04fdf
    • Christoph Hellwig's avatar
      iomap: don't set FIEMAP_EXTENT_MERGED for extent based filesystems · 17de0a9f
      Christoph Hellwig authored
      
      
      Filesystems like XFS that use extents should not set the
      FIEMAP_EXTENT_MERGED flag in the fiemap extent structures.  To allow
      for both behaviors for the upcoming gfs2 usage split the iomap
      type field into type and flags, and only set FIEMAP_EXTENT_MERGED if
      the IOMAP_F_MERGED flag is set.  The flags field will also come in
      handy for future features such as shared extents on reflink-enabled
      file systems.
      
      Reported-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Acked-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      17de0a9f
  12. Aug 27, 2016
  13. Aug 25, 2016
    • Liping Zhang's avatar
      netfilter: nft_meta: improve the validity check of pkttype set expr · 960fa72f
      Liping Zhang authored
      
      
      "meta pkttype set" is only supported on prerouting chain with bridge
      family and ingress chain with netdev family.
      
      But the validate check is incomplete, and the user can add the nft
      rules on input chain with bridge family, for example:
        # nft add table bridge filter
        # nft add chain bridge filter input {type filter hook input \
          priority 0 \;}
        # nft add chain bridge filter test
        # nft add rule bridge filter test meta pkttype set unicast
        # nft add rule bridge filter input jump test
      
      This patch fixes the problem.
      
      Signed-off-by: default avatarLiping Zhang <liping.zhang@spreadtrum.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      960fa72f
    • Liping Zhang's avatar
      netfilter: nft_reject: restrict to INPUT/FORWARD/OUTPUT · 89e1f6d2
      Liping Zhang authored
      
      
      After I add the nft rule "nft add rule filter prerouting reject
      with tcp reset", kernel panic happened on my system:
        NULL pointer dereference at ...
        IP: [<ffffffff81b9db2f>] nf_send_reset+0xaf/0x400
        Call Trace:
        [<ffffffff81b9da80>] ? nf_reject_ip_tcphdr_get+0x160/0x160
        [<ffffffffa0928061>] nft_reject_ipv4_eval+0x61/0xb0 [nft_reject_ipv4]
        [<ffffffffa08e836a>] nft_do_chain+0x1fa/0x890 [nf_tables]
        [<ffffffffa08e8170>] ? __nft_trace_packet+0x170/0x170 [nf_tables]
        [<ffffffffa06e0900>] ? nf_ct_invert_tuple+0xb0/0xc0 [nf_conntrack]
        [<ffffffffa07224d4>] ? nf_nat_setup_info+0x5d4/0x650 [nf_nat]
        [...]
      
      Because in the PREROUTING chain, routing information is not exist,
      then we will dereference the NULL pointer and oops happen.
      
      So we restrict reject expression to INPUT, FORWARD and OUTPUT chain.
      This is consistent with iptables REJECT target.
      
      Signed-off-by: default avatarLiping Zhang <liping.zhang@spreadtrum.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      89e1f6d2
  14. Aug 24, 2016
    • Vitaly Kuznetsov's avatar
      xen: change the type of xen_vcpu_id to uint32_t · 55467dea
      Vitaly Kuznetsov authored
      
      
      We pass xen_vcpu_id mapping information to hypercalls which require
      uint32_t type so it would be cleaner to have it as uint32_t. The
      initializer to -1 can be dropped as we always do the mapping before using
      it and we never check the 'not set' value anyway.
      
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      55467dea
    • Thierry Reding's avatar
      drm/tegra: dsi: Enhance runtime power management · 87904c3e
      Thierry Reding authored
      
      
      The MIPI DSI output on Tegra SoCs requires some external logic to
      calibrate the MIPI pads before a video signal can be transmitted. This
      MIPI calibration logic requires to be powered on while the MIPI pads are
      being used, which is currently done as part of the DSI driver's probe
      implementation.
      
      This is suboptimal because it will leave the MIPI calibration logic
      powered up even if the DSI output is never used.
      
      On Tegra114 and earlier this behaviour also causes the driver to hang
      while trying to power up the MIPI calibration logic because the power
      partition that contains the MIPI calibration logic will be powered on
      by the display controller at output pipeline configuration time. Thus
      the power up sequence for the MIPI calibration logic happens before
      it's power partition is guaranteed to be enabled.
      
      Fix this by splitting up the API into a request/free pair of functions
      that manage the runtime dependency between the DSI and the calibration
      modules (no registers are accessed) and a set of enable, calibrate and
      disable functions that program the MIPI calibration logic at points in
      time where the power partition is really enabled.
      
      While at it, make sure that the runtime power management also works in
      ganged mode, which is currently also broken.
      
      Reported-by: default avatarJonathan Hunter <jonathanh@nvidia.com>
      Tested-by: default avatarJonathan Hunter <jonathanh@nvidia.com>
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      87904c3e
  15. Aug 23, 2016
  16. Aug 22, 2016
  17. Aug 21, 2016
  18. Aug 19, 2016
Loading