1. 22 Feb, 2014 15 commits
    • Martin Schwidefsky's avatar
      s390: fix kernel crash due to linkage stack instructions · edb11a9b
      Martin Schwidefsky authored
      commit 8d7f6690 upstream.
      
      The kernel currently crashes with a low-address-protection exception
      if a user space process executes an instruction that tries to use the
      linkage stack. Set the base-ASTE origin and the subspace-ASTE origin
      of the dispatchable-unit-control-table to point to a dummy ASTE.
      Set up control register 15 to point to an empty linkage stack with no
      room left.
      
      A user space process with a linkage stack instruction will still crash
      but with a different exception which is correctly translated to a
      segmentation fault instead of a kernel oops.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      edb11a9b
    • Michael Holzheu's avatar
      s390/dump: Fix dump memory detection · 312cdf57
      Michael Holzheu authored
      commit d7736ff5 upstream.
      
      Dumps created by kdump or zfcpdump can contain invalid memory holes when
      dumping z/VM systems that have memory pressure.
      
      For example:
      
         # zgetdump -i /proc/vmcore.
         Memory map:
         0000000000000000 - 0000000000bfffff (12 MB)
         0000000000e00000 - 00000000014fffff (7 MB)
         000000000bd00000 - 00000000f3bfffff (3711 MB)
      
      The memory detection function find_memory_chunks() issues tprot to
      find valid memory chunks. In case of CMM it can happen that pages are
      marked as unstable via set_page_unstable() in arch_free_page().
      If z/VM has released that pages, tprot returns -EFAULT and indicates
      a memory hole.
      
      So fix this and switch off CMM in case of kdump or zfcpdump.
      Signed-off-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      312cdf57
    • Oleksij Rempel's avatar
      ar5523: fix usb id for Gigaset. · 22c7a189
      Oleksij Rempel authored
      commit 4fcfc744 upstream.
      
      Raw id and FW id should be switched.
      Tested-by: default avatarOleksij Rempel <linux@rempel-privat.de>
      Signed-off-by: default avatarOleksij Rempel <linux@rempel-privat.de>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      22c7a189
    • Stanislaw Gruszka's avatar
      ath9k_htc: make ->sta_rc_update atomic for most calls · 6180be9f
      Stanislaw Gruszka authored
      commit 2fa4cb90 upstream.
      
      sta_rc_update() callback must be atomic, hence we can not take mutexes
      or do other operations, which can sleep in ath9k_htc_sta_rc_update().
      
      I think we can just return from ath9k_htc_sta_rc_update(), if it is
      called without IEEE80211_RC_SUPP_RATES_CHANGED bit. That will help
      with scheduling while atomic bug for most cases (except mesh and IBSS
      modes).
      
      For mesh and IBSS I do not see other solution like creating additional
      workqueue, because sending firmware command require us to sleep, but
      this can be done in additional patch.
      
      Patch partially fixes bug:
      https://bugzilla.redhat.com/show_bug.cgi?id=990955Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6180be9f
    • Johannes Berg's avatar
      mac80211: fix fragmentation code, particularly for encryption · f8cdcac2
      Johannes Berg authored
      commit 338f977f upstream.
      
      The "new" fragmentation code (since my rewrite almost 5 years ago)
      erroneously sets skb->len rather than using skb_trim() to adjust
      the length of the first fragment after copying out all the others.
      This leaves the skb tail pointer pointing to after where the data
      originally ended, and thus causes the encryption MIC to be written
      at that point, rather than where it belongs: immediately after the
      data.
      
      The impact of this is that if software encryption is done, then
       a) encryption doesn't work for the first fragment, the connection
          becomes unusable as the first fragment will never be properly
          verified at the receiver, the MIC is practically guaranteed to
          be wrong
       b) we leak up to 8 bytes of plaintext (!) of the packet out into
          the air
      
      This is only mitigated by the fact that many devices are capable
      of doing encryption in hardware, in which case this can't happen
      as the tail pointer is irrelevant in that case. Additionally,
      fragmentation is not used very frequently and would normally have
      to be configured manually.
      
      Fix this by using skb_trim() properly.
      
      Fixes: 2de8e0d9 ("mac80211: rewrite fragmentation")
      Reported-by: default avatarJouni Malinen <j@w1.fi>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f8cdcac2
    • Emmanuel Grumbach's avatar
      mac80211: release the channel in error path in start_ap · bd5bcc09
      Emmanuel Grumbach authored
      commit 0297ea17 upstream.
      
      When the driver cannot start the AP or when the assignement
      of the beacon goes wrong, we need to unassign the vif.
      Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bd5bcc09
    • Eliad Peller's avatar
      mac80211: move roc cookie assignment earlier · 7cde93f4
      Eliad Peller authored
      commit 2f617435 upstream.
      
      ieee80211_start_roc_work() might add a new roc
      to existing roc, and tell cfg80211 it has already
      started.
      
      However, this might happen before the roc cookie
      was set, resulting in REMAIN_ON_CHANNEL (started)
      event with null cookie. Consequently, it can make
      wpa_supplicant go out of sync.
      
      Fix it by setting the roc cookie earlier.
      Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7cde93f4
    • Steve French's avatar
      retrieving CIFS ACLs when mounted with SMB2 fails dropping session · 6bd8c850
      Steve French authored
      commit 83e3bc23 upstream.
      
      The get/set ACL xattr support for CIFS ACLs attempts to send old
      cifs dialect protocol requests even when mounted with SMB2 or later
      dialects. Sending cifs requests on an smb2 session causes problems -
      the server drops the session due to the illegal request.
      
      This patch makes CIFS ACL operations protocol specific to fix that.
      
      Attempting to query/set CIFS ACLs for SMB2 will now return
      EOPNOTSUPP (until we add worker routines for sending query
      ACL requests via SMB2) instead of sending invalid (cifs)
      requests.
      
      A separate followon patch will be needed to fix cifs_acl_to_fattr
      (which takes a cifs specific u16 fid so can't be abstracted
      to work with SMB2 until that is changed) and will be needed
      to fix mount problems when "cifsacl" is specified on mount
      with e.g. vers=2.1
      Signed-off-by: default avatarSteve French <smfrench@gmail.com>
      Reviewed-by: default avatarShirish Pargaonkar <spargaonkar@suse.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6bd8c850
    • Steve French's avatar
      Add protocol specific operation for CIFS xattrs · 367d9644
      Steve French authored
      commit d979f3b0 upstream.
      
      Changeset 666753c3 added protocol
      operations for get/setxattr to avoid calling cifs operations
      on smb2/smb3 mounts for xattr operations and this changeset
      adds the calls to cifs specific protocol operations for xattrs
      (in order to reenable cifs support for xattrs which was
      temporarily disabled by the previous changeset.  We do not
      have SMB2/SMB3 worker function for setting xattrs yet so
      this only enables it for cifs.
      
      CCing stable since without these two small changsets (its
      small coreq 666753c3 is
      also needed) calling getfattr/setfattr on smb2/smb3 mounts
      causes problems.
      Signed-off-by: default avatarSteve French <smfrench@gmail.com>
      Reviewed-by: default avatarShirish Pargaonkar <spargaonkar@suse.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      367d9644
    • Steve French's avatar
      CIFS: Fix SMB2 mounts so they don't try to set or get xattrs via cifs · 53fecc53
      Steve French authored
      commit 666753c3 upstream.
      
      When mounting with smb2 (or smb2.1 or smb3) we need to check to make
      sure that attempts to query or set extended attributes do not
      attempt to send the request with the older cifs protocol instead
      (eventually we also need to add the support in SMB2
      to query/set extended attributes but this patch prevents us from
      using the wrong protocol for extended attribute operations).
      Signed-off-by: default avatarSteve French <smfrench@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      53fecc53
    • Naoya Horiguchi's avatar
      mm/memory-failure.c: move refcount only in !MF_COUNT_INCREASED · 2186bb4e
      Naoya Horiguchi authored
      commit 8d547ff4 upstream.
      
      mce-test detected a test failure when injecting error to a thp tail
      page.  This is because we take page refcount of the tail page in
      madvise_hwpoison() while the fix in commit a3e0f9e4
      ("mm/memory-failure.c: transfer page count from head page to tail page
      after split thp") assumes that we always take refcount on the head page.
      
      When a real memory error happens we take refcount on the head page where
      memory_failure() is called without MF_COUNT_INCREASED set, so it seems
      to me that testing memory error on thp tail page using madvise makes
      little sense.
      
      This patch cancels moving refcount in !MF_COUNT_INCREASED for valid
      testing.
      
      [akpm@linux-foundation.org: s/&&/&/]
      Signed-off-by: default avatarNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
      Cc: Chen Gong <gong.chen@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2186bb4e
    • Eric W. Biederman's avatar
      fs/file.c:fdtable: avoid triggering OOMs from alloc_fdmem · 434672c0
      Eric W. Biederman authored
      commit 96c7a2ff upstream.
      
      Recently due to a spike in connections per second memcached on 3
      separate boxes triggered the OOM killer from accept.  At the time the
      OOM killer was triggered there was 4GB out of 36GB free in zone 1.  The
      problem was that alloc_fdtable was allocating an order 3 page (32KiB) to
      hold a bitmap, and there was sufficient fragmentation that the largest
      page available was 8KiB.
      
      I find the logic that PAGE_ALLOC_COSTLY_ORDER can't fail pretty dubious
      but I do agree that order 3 allocations are very likely to succeed.
      
      There are always pathologies where order > 0 allocations can fail when
      there are copious amounts of free memory available.  Using the pigeon
      hole principle it is easy to show that it requires 1 page more than 50%
      of the pages being free to guarantee an order 1 (8KiB) allocation will
      succeed, 1 page more than 75% of the pages being free to guarantee an
      order 2 (16KiB) allocation will succeed and 1 page more than 87.5% of
      the pages being free to guarantee an order 3 allocate will succeed.
      
      A server churning memory with a lot of small requests and replies like
      memcached is a common case that if anything can will skew the odds
      against large pages being available.
      
      Therefore let's not give external applications a practical way to kill
      linux server applications, and specify __GFP_NORETRY to the kmalloc in
      alloc_fdmem.  Unless I am misreading the code and by the time the code
      reaches should_alloc_retry in __alloc_pages_slowpath (where
      __GFP_NORETRY becomes signification).  We have already tried everything
      reasonable to allocate a page and the only thing left to do is wait.  So
      not waiting and falling back to vmalloc immediately seems like the
      reasonable thing to do even if there wasn't a chance of triggering the
      OOM killer.
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: Cong Wang <cwang@twopensource.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      434672c0
    • Frediano Ziglio's avatar
      xen: Fix possible user space selector corruption · 119c1d25
      Frediano Ziglio authored
      commit 7cde9b27 upstream.
      
      Due to the way kernel is initialized under Xen is possible that the
      ring1 selector used by the kernel for the boot cpu end up to be copied
      to userspace leading to segmentation fault in the userspace.
      
      Xen code in the kernel initialize no-boot cpus with correct selectors (ds
      and es set to __USER_DS) but the boot one keep the ring1 (passed by Xen).
      On task context switch (switch_to) we assume that ds, es and cs already
      point to __USER_DS and __KERNEL_CSso these selector are not changed.
      
      If processor is an Intel that support sysenter instruction sysenter/sysexit
      is used so ds and es are not restored switching back from kernel to
      userspace. In the case the selectors point to a ring1 instead of __USER_DS
      the userspace code will crash on first memory access attempt (to be
      precise Xen on the emulated iret used to do sysexit will detect and set ds
      and es to zero which lead to GPF anyway).
      
      Now if an userspace process call kernel using sysenter and get rescheduled
      (for me it happen on a specific init calling wait4) could happen that the
      ring1 selector is set to ds and es.
      
      This is quite hard to detect cause after a while these selectors are fixed
      (__USER_DS seems sticky).
      
      Bisecting the code commit 7076aada appears
      to be the first one that have this issue.
      Signed-off-by: default avatarFrediano Ziglio <frediano.ziglio@citrix.com>
      Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Reviewed-by: default avatarAndrew Cooper <andrew.cooper3@citrix.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      119c1d25
    • David Vrabel's avatar
      xen/p2m: check MFN is in range before using the m2p table · 3d048e58
      David Vrabel authored
      commit 0160676b upstream.
      
      On hosts with more than 168 GB of memory, a 32-bit guest may attempt
      to grant map an MFN that is error cannot lookup in its mapping of the
      m2p table.  There is an m2p lookup as part of m2p_add_override() and
      m2p_remove_override().  The lookup falls off the end of the mapped
      portion of the m2p and (because the mapping is at the highest virtual
      address) wraps around and the lookup causes a fault on what appears to
      be a user space address.
      
      do_page_fault() (thinking it's a fault to a userspace address), tries
      to lock mm->mmap_sem.  If the gntdev device is used for the grant map,
      m2p_add_override() is called from from gnttab_mmap() with mm->mmap_sem
      already locked.  do_page_fault() then deadlocks.
      
      The deadlock would most commonly occur when a 64-bit guest is started
      and xenconsoled attempts to grant map its console ring.
      
      Introduce mfn_to_pfn_no_overrides() which checks the MFN is within the
      mapped portion of the m2p table before accessing the table and use
      this in m2p_add_override(), m2p_remove_override(), and mfn_to_pfn()
      (which already had the correct range check).
      
      All faults caused by accessing the non-existant parts of the m2p are
      thus within the kernel address space and exception_fixup() is called
      without trying to lock mm->mmap_sem.
      
      This means that for MFNs that are outside the mapped range of the m2p
      then mfn_to_pfn() will always look in the m2p overrides.  This is
      correct because it must be a foreign MFN (and the PFN in the m2p in
      this case is only relevant for the other domain).
      
      v3: check for auto_translated_physmap in mfn_to_pfn_no_overrides()
      v2: in mfn_to_pfn() look in m2p_overrides if the MFN is out of
          range as it's probably foreign.
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Cc: Stefano Stabellini <stefano.stabellini@citrix.com>
      Cc: Jan Beulich <JBeulich@suse.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Acked-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3d048e58
    • David Vrabel's avatar
      xen-blkfront: handle backend CLOSED without CLOSING · 80ead821
      David Vrabel authored
      commit 36613717 upstream.
      
      Backend drivers shouldn't transistion to CLOSED unless the frontend is
      CLOSED.  If a backend does transition to CLOSED too soon then the
      frontend may not see the CLOSING state and will not properly shutdown.
      
      So, treat an unexpected backend CLOSED state the same as CLOSING.
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Acked-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      80ead821
  2. 20 Feb, 2014 25 commits