Skip to content
Snippets Groups Projects
  1. Jan 04, 2019
  2. Nov 02, 2018
    • Suren Baghdasaryan's avatar
      NFC: Fix the number of pipes · 9ad37d62
      Suren Baghdasaryan authored
      
      commit e285d5bf upstream.
      
      According to ETSI TS 102 622 specification chapter 4.4 pipe identifier
      is 7 bits long which allows for 128 unique pipe IDs. Because
      NFC_HCI_MAX_PIPES is used as the number of pipes supported and not
      as the max pipe ID, its value should be 128 instead of 127.
      
      nfc_hci_recv_from_llc extracts pipe ID from packet header using
      NFC_HCI_FRAGMENT(0x7F) mask which allows for pipe ID value of 127.
      Same happens when NCI_HCP_MSG_GET_PIPE() is being used. With
      pipes array having only 127 elements and pipe ID of 127 the OOB memory
      access will result.
      
      Cc: Samuel Ortiz <sameo@linux.intel.com>
      Cc: Allen Pais <allen.pais@oracle.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Suggested-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2 tags
      9ad37d62
    • Greg Hackmann's avatar
      staging: android: ion: fix ION_IOC_{MAP,SHARE} use-after-free · b6bb8eb0
      Greg Hackmann authored
      
      This patch is 4.9.y only.  Kernels 4.12 and later are unaffected, since
      all the underlying ion_handle infrastructure has been ripped out.
      
      The ION_IOC_{MAP,SHARE} ioctls drop and reacquire client->lock several
      times while operating on one of the client's ion_handles.  This creates
      windows where userspace can call ION_IOC_FREE on the same client with
      the same handle, and effectively make the kernel drop its own reference.
      For example:
      
      - thread A: ION_IOC_ALLOC creates an ion_handle with refcount 1
      - thread A: starts ION_IOC_MAP and increments the refcount to 2
      - thread B: ION_IOC_FREE decrements the refcount to 1
      - thread B: ION_IOC_FREE decrements the refcount to 0 and frees the
                  handle
      - thread A: continues ION_IOC_MAP with a dangling ion_handle * to
                  freed memory
      
      Fix this by holding client->lock for the duration of
      ION_IOC_{MAP,SHARE}, preventing the concurrent ION_IOC_FREE.  Also
      remove ion_handle_get_by_id(), since there's literally no way to use it
      safely.
      
      Cc: stable@vger.kernel.org # v4.11-
      Signed-off-by: default avatarGreg Hackmann <ghackmann@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b6bb8eb0
    • Adrian Salido's avatar
      ANDROID: tracing: fix race condition reading saved tgids · ac941ef6
      Adrian Salido authored
      
      Commit 939c7a4f ("tracing: Introduce saved_cmdlines_size file")
      introduced ability to change saved cmdlines size. This resized saved
      command lines but missed resizing tgid mapping as well.
      
      Another issue is that when the resize happens, it removes saved command
      lines and reallocates new memory for it. This introduced a race
      condition when reading the global savecmd as this can be freed in the
      middle of accessing it causing a use after free access. Fix this by
      implementing locking.
      
      Signed-off-by: default avatarAdrian Salido <salidoa@google.com>
      Bug: 36007735
      Change-Id: I334791ac35f8bcbd34362ed112aa624275a46947
      (cherry picked from commit 7116d306)
      ac941ef6
    • Mark Salyzyn's avatar
      Bluetooth: hidp: buffer overflow in hidp_process_report · 8a67b428
      Mark Salyzyn authored
      
      commit 7992c188 upstream.
      
      CVE-2018-9363
      
      The buffer length is unsigned at all layers, but gets cast to int and
      checked in hidp_process_report and can lead to a buffer overflow.
      Switch len parameter to unsigned int to resolve issue.
      
      This affects 3.18 and newer kernels.
      
      Signed-off-by: default avatarMark Salyzyn <salyzyn@android.com>
      Fixes: a4b1b587 ("HID: Bluetooth: hidp: make sure input buffers are big enough")
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
      Cc: linux-bluetooth@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: security@kernel.org
      Cc: kernel-team@android.com
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8a67b428
  3. Oct 04, 2018
  4. Sep 14, 2018
  5. Aug 08, 2018
  6. Aug 06, 2018
Loading