OSDN Git Service

Merge android-4.4.132 (46155cc) into msm-4.4
authorSrinivasarao P <spathi@codeaurora.org>
Tue, 22 May 2018 09:39:44 +0000 (15:09 +0530)
committerSrinivasarao P <spathi@codeaurora.org>
Tue, 22 May 2018 09:53:13 +0000 (15:23 +0530)
* refs/heads/tmp-46155cc
  Linux 4.4.132
  perf/x86: Fix possible Spectre-v1 indexing for x86_pmu::event_map()
  perf/core: Fix possible Spectre-v1 indexing for ->aux_pages[]
  perf/x86/msr: Fix possible Spectre-v1 indexing in the MSR driver
  perf/x86/cstate: Fix possible Spectre-v1 indexing for pkg_msr
  perf/x86: Fix possible Spectre-v1 indexing for hw_perf_event cache_*
  tracing/uprobe_event: Fix strncpy corner case
  Revert "Bluetooth: btusb: Fix quirk for Atheros 1525/QCA6174"
  atm: zatm: Fix potential Spectre v1
  net: atm: Fix potential Spectre v1
  can: kvaser_usb: Increase correct stats counter in kvaser_usb_rx_can_msg()
  tracing: Fix regex_match_front() to not over compare the test string
  libata: Apply NOLPM quirk for SanDisk SD7UB3Q*G1001 SSDs
  rfkill: gpio: fix memory leak in probe error path
  xfrm_user: fix return value from xfrm_user_rcv_msg
  f2fs: fix a dead loop in f2fs_fiemap()
  bdi: Fix oops in wb_workfn()
  tcp: fix TCP_REPAIR_QUEUE bound checking
  perf: Remove superfluous allocation error check
  soreuseport: initialise timewait reuseport field
  dccp: initialize ireq->ir_mark
  net: fix uninit-value in __hw_addr_add_ex()
  net: initialize skb->peeked when cloning
  net: fix rtnh_ok()
  netlink: fix uninit-value in netlink_sendmsg
  crypto: af_alg - fix possible uninit-value in alg_bind()
  ipvs: fix rtnl_lock lockups caused by start_sync_thread
  usb: musb: host: fix potential NULL pointer dereference
  USB: serial: option: adding support for ublox R410M
  USB: serial: option: reimplement interface masking
  USB: Accept bulk endpoints with 1024-byte maxpacket
  USB: serial: visor: handle potential invalid device configuration
  test_firmware: fix setting old custom fw path back on exit, second try
  drm/vmwgfx: Fix a buffer object leak
  IB/mlx5: Use unlimited rate when static rate is not supported
  NET: usb: qmi_wwan: add support for ublox R410M PID 0x90b2
  RDMA/mlx5: Protect from shift operand overflow
  RDMA/ucma: Allow resolving address w/o specifying source address
  xfs: prevent creating negative-sized file via INSERT_RANGE
  Input: atmel_mxt_ts - add touchpad button mapping for Samsung Chromebook Pro
  Input: leds - fix out of bound access
  tracepoint: Do not warn on ENOMEM
  ALSA: aloop: Add missing cable lock to ctl API callbacks
  ALSA: aloop: Mark paused device as inactive
  ALSA: seq: Fix races at MIDI encoding in snd_virmidi_output_trigger()
  ALSA: pcm: Check PCM state at xfern compat ioctl
  USB: serial: option: Add support for Quectel EP06
  gpmi-nand: Handle ECC Errors in erased pages
  ath10k: rebuild crypto header in rx data frames
  ath10k: fix rfc1042 header retrieval in QCA4019 with eth decap mode
  mac80211: Add RX flag to indicate ICV stripped
  mac80211: allow same PN for AMSDU sub-frames
  mac80211: allow not sending MIC up from driver for HW crypto
  percpu: include linux/sched.h for cond_resched()
  KVM: s390: Enable all facility bits that are known good for passthrough
  bpf: map_get_next_key to return first key on NULL
  perf/core: Fix the perf_cpu_time_max_percent check
  goldfish: pipe: ANDROID: mark local functions static
  Revert "goldfish: pipe: ANDROID: Allocate memory with GFP_KERNEL."
  UPSTREAM: ANDROID: binder: prevent transactions into own process.
  goldfish: pipe: ANDROID: Add DMA support
  UPSTREAM: f2fs: clear PageError on writepage - part 2
  UPSTREAM: f2fs: avoid fsync() failure caused by EAGAIN in writepage()
  ANDROID: build.config: enforce trace_printk check
  ANDROID: x86_64_cuttlefish_defconfig: Disable KPTI
  UPSTREAM: mac80211: ibss: Fix channel type enum in ieee80211_sta_join_ibss()
  UPSTREAM: mac80211: Fix clang warning about constant operand in logical operation
  UPSTREAM: nl80211: Fix enum type of variable in nl80211_put_sta_rate()
  UPSTREAM: sysfs: remove signedness from sysfs_get_dirent
  UPSTREAM: tracing: Use cpumask_available() to check if cpumask variable may be used
  BACKPORT: clocksource: Use GENMASK_ULL in definition of CLOCKSOURCE_MASK
  UPSTREAM: netpoll: Fix device name check in netpoll_setup()
  FROMLIST: staging: Fix sparse warnings in vsoc driver.
  FROMLIST: staging: vsoc: Fix a i386-randconfig warning.
  FROMLIST: staging: vsoc: Create wc kernel mapping for region shm.
  Revert "goldfish: pipe: ANDROID: remove a redundant target"
  goldfish: pipe: ANDROID: Replace writel with gf_write_ptr
  goldfish: pipe: ANDROID: Use dev_ logging instead of pr_
  goldfish: pipe: ANDROID: fix checkpatch warnings
  goldfish: pipe: ANDROID: Update module license

Conflicts:
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/core.h
drivers/net/wireless/ath/ath10k/htt_rx.c

Change-Id: If2ede1dea6a07b3fd498724e83071fd547170e1c
[spathi@codeaurora.org: resolved compilation errors in ath10k
by rebuilding crypto header in rx data frames]
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
18 files changed:
1  2 
Makefile
drivers/android/binder.c
drivers/net/wireless/ath/ath10k/htt_rx.c
drivers/net/wireless/ath/ath10k/rx_desc.h
drivers/usb/core/config.c
include/linux/clocksource.h
include/net/mac80211.h
kernel/events/core.c
kernel/events/ring_buffer.c
kernel/trace/trace.c
kernel/trace/trace_uprobe.c
net/core/skbuff.c
net/ipv4/tcp.c
net/mac80211/util.c
net/netfilter/ipvs/ip_vs_ctl.c
net/netlink/af_netlink.c
net/wireless/nl80211.c
sound/core/pcm_compat.c

diff --cc Makefile
Simple merge
Simple merge
@@@ -564,6 -603,6 +564,11 @@@ static int ath10k_htt_rx_crypto_param_l
                return IEEE80211_TKIP_IV_LEN;
        case HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2:
                return IEEE80211_CCMP_HDR_LEN;
++      case HTT_RX_MPDU_ENCRYPT_AES_CCM256_WPA2:
++              return IEEE80211_CCMP_256_HDR_LEN;
++      case HTT_RX_MPDU_ENCRYPT_AES_GCMP_WPA2:
++      case HTT_RX_MPDU_ENCRYPT_AES_GCMP256_WPA2:
++              return IEEE80211_GCMP_HDR_LEN;
        case HTT_RX_MPDU_ENCRYPT_WEP128:
        case HTT_RX_MPDU_ENCRYPT_WAPI:
                break;
@@@ -589,6 -628,6 +594,11 @@@ static int ath10k_htt_rx_crypto_tail_le
                return IEEE80211_TKIP_ICV_LEN;
        case HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2:
                return IEEE80211_CCMP_MIC_LEN;
++      case HTT_RX_MPDU_ENCRYPT_AES_CCM256_WPA2:
++              return IEEE80211_CCMP_256_MIC_LEN;
++      case HTT_RX_MPDU_ENCRYPT_AES_GCMP_WPA2:
++      case HTT_RX_MPDU_ENCRYPT_AES_GCMP256_WPA2:
++              return IEEE80211_GCMP_MIC_LEN;
        case HTT_RX_MPDU_ENCRYPT_WEP128:
        case HTT_RX_MPDU_ENCRYPT_WAPI:
                break;
@@@ -940,9 -977,9 +950,9 @@@ static void ath10k_process_rx(struct at
  
        status = IEEE80211_SKB_RXCB(skb);
        *status = *rx_status;
 -
 +      fill_datapath_stats(ar, status);
        ath10k_dbg(ar, ATH10K_DBG_DATA,
-                  "rx skb %pK len %u peer %pM %s %s sn %u %s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n",
 -                 "rx skb %p len %u peer %pM %s %s sn %u %s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%llx fcs-err %i mic-err %i amsdu-more %i\n",
++                 "rx skb %pK len %u peer %pM %s %s sn %u %s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%llx fcs-err %i mic-err %i amsdu-more %i\n",
                   skb,
                   skb->len,
                   ieee80211_get_SA(hdr),
@@@ -1041,13 -1076,24 +1051,25 @@@ static void ath10k_htt_rx_h_undecap_raw
        hdr = (void *)msdu->data;
  
        /* Tail */
-       if (status->flag & RX_FLAG_IV_STRIPPED)
+       if (status->flag & RX_FLAG_IV_STRIPPED) {
                skb_trim(msdu, msdu->len -
                         ath10k_htt_rx_crypto_tail_len(ar, enctype));
+       } else {
+               /* MIC */
+               if ((status->flag & RX_FLAG_MIC_STRIPPED) &&
+                   enctype == HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2)
+                       skb_trim(msdu, msdu->len - 8);
+               /* ICV */
+               if (status->flag & RX_FLAG_ICV_STRIPPED &&
+                   enctype != HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2)
+                       skb_trim(msdu, msdu->len -
+                                ath10k_htt_rx_crypto_tail_len(ar, enctype));
+       }
  
        /* MMIC */
 -      if (!ieee80211_has_morefrags(hdr->frame_control) &&
 +      if ((status->flag & RX_FLAG_MMIC_STRIPPED) &&
 +          !ieee80211_has_morefrags(hdr->frame_control) &&
            enctype == HTT_RX_MPDU_ENCRYPT_TKIP_WPA)
                skb_trim(msdu, msdu->len - 8);
  
  static void ath10k_htt_rx_h_undecap_nwifi(struct ath10k *ar,
                                          struct sk_buff *msdu,
                                          struct ieee80211_rx_status *status,
-                                         const u8 first_hdr[64])
+                                         const u8 first_hdr[64],
+                                         enum htt_rx_mpdu_encrypt_type enctype)
  {
        struct ieee80211_hdr *hdr;
 +      struct htt_rx_desc *rxd;
        size_t hdr_len;
        u8 da[ETH_ALEN];
        u8 sa[ETH_ALEN];
 +      int l3_pad_bytes;
+       int bytes_aligned = ar->hw_params.decap_align_bytes;
  
        /* Delivered decapped frame:
         * [nwifi 802.11 header] <-- replaced with 802.11 hdr
@@@ -1159,8 -1204,7 +1191,9 @@@ static void ath10k_htt_rx_h_undecap_eth
        void *rfc1042;
        u8 da[ETH_ALEN];
        u8 sa[ETH_ALEN];
 +      int l3_pad_bytes;
 +      struct htt_rx_desc *rxd;
+       int bytes_aligned = ar->hw_params.decap_align_bytes;
  
        /* Delivered decapped frame:
         * [eth header] <-- replaced with 802.11 hdr & rfc1042/llc
@@@ -1206,8 -1254,7 +1248,9 @@@ static void ath10k_htt_rx_h_undecap_sna
  {
        struct ieee80211_hdr *hdr;
        size_t hdr_len;
 +      int l3_pad_bytes;
 +      struct htt_rx_desc *rxd;
+       int bytes_aligned = ar->hw_params.decap_align_bytes;
  
        /* Delivered decapped frame:
         * [amsdu header] <-- replaced with 802.11 hdr
@@@ -1384,21 -1434,16 +1439,26 @@@ static void ath10k_htt_rx_h_mpdu(struc
        if (has_tkip_err)
                status->flag |= RX_FLAG_MMIC_ERROR;
  
 +      /* Firmware reports all necessary management frames via WMI already.
 +       * They are not reported to monitor interfaces at all so pass the ones
 +       * coming via HTT to monitor interfaces instead. This simplifies
 +       * matters a lot.
 +       */
 +      if (is_mgmt)
 +              status->flag |= RX_FLAG_ONLY_MONITOR;
 +
        if (is_decrypted) {
 -              status->flag |= RX_FLAG_DECRYPTED |
 -                              RX_FLAG_MMIC_STRIPPED;
 +              status->flag |= RX_FLAG_DECRYPTED;
 +
 +              if (likely(!is_mgmt))
-                       status->flag |= RX_FLAG_IV_STRIPPED |
-                                       RX_FLAG_MMIC_STRIPPED;
- }
++                      status->flag |= RX_FLAG_MMIC_STRIPPED;
+               if (fill_crypt_header)
+                       status->flag |= RX_FLAG_MIC_STRIPPED |
+                                       RX_FLAG_ICV_STRIPPED;
+               else
+                       status->flag |= RX_FLAG_IV_STRIPPED;
+       }
  
        skb_queue_walk(amsdu, msdu) {
                ath10k_htt_rx_h_csum_offload(msdu);
                 */
                if (!is_decrypted)
                        continue;
 +              if (is_mgmt)
 +                      continue;
  
+               if (fill_crypt_header)
+                       continue;
                hdr = (void *)msdu->data;
                hdr->frame_control &= ~__cpu_to_le16(IEEE80211_FCTL_PROTECTED);
        }
@@@ -1547,46 -1629,20 +1620,46 @@@ static int ath10k_htt_rx_handle_amsdu(s
  {
        struct ath10k *ar = htt->ar;
        struct ieee80211_rx_status *rx_status = &htt->rx_status;
 -      struct htt_rx_indication_mpdu_range *mpdu_ranges;
        struct sk_buff_head amsdu;
 -      int num_mpdu_ranges;
 -      int fw_desc_len;
 -      u8 *fw_desc;
 -      int i, ret, mpdu_count = 0;
 +      int ret, num_msdus;
  
 -      lockdep_assert_held(&htt->rx_ring.lock);
 +      __skb_queue_head_init(&amsdu);
  
 -      if (htt->rx_confused)
 -              return;
 +      spin_lock_bh(&htt->rx_ring.lock);
 +      if (htt->rx_confused) {
 +              spin_unlock_bh(&htt->rx_ring.lock);
 +              return -EIO;
 +      }
 +      ret = ath10k_htt_rx_amsdu_pop(htt, &amsdu);
 +      spin_unlock_bh(&htt->rx_ring.lock);
 +
 +      if (ret < 0) {
 +              ath10k_warn(ar, "rx ring became corrupted: %d\n", ret);
 +              __skb_queue_purge(&amsdu);
 +              /* FIXME: It's probably a good idea to reboot the
 +               * device instead of leaving it inoperable.
 +               */
 +              htt->rx_confused = true;
 +              return ret;
 +      }
  
 -      fw_desc_len = __le16_to_cpu(rx->prefix.fw_rx_desc_bytes);
 -      fw_desc = (u8 *)&rx->fw_desc;
 +      num_msdus = skb_queue_len(&amsdu);
 +      ath10k_htt_rx_h_ppdu(ar, &amsdu, rx_status, 0xffff);
 +      ath10k_htt_rx_h_unchain(ar, &amsdu, ret > 0);
 +      ath10k_htt_rx_h_filter(ar, &amsdu, rx_status);
-       ath10k_htt_rx_h_mpdu(ar, &amsdu, rx_status);
++      ath10k_htt_rx_h_mpdu(ar, &amsdu, rx_status, true);
 +      ath10k_htt_rx_h_deliver(ar, &amsdu, rx_status);
 +
 +      return num_msdus;
 +}
 +
 +static void ath10k_htt_rx_proc_rx_ind(struct ath10k_htt *htt,
 +                                    struct htt_rx_indication *rx)
 +{
 +      struct ath10k *ar = htt->ar;
 +      struct htt_rx_indication_mpdu_range *mpdu_ranges;
 +      int num_mpdu_ranges;
 +      int i, mpdu_count = 0;
  
        num_mpdu_ranges = MS(__le32_to_cpu(rx->hdr.info1),
                             HTT_RX_INDICATION_INFO1_NUM_MPDU_RANGES);
@@@ -1910,10 -2016,9 +1983,10 @@@ static int ath10k_htt_rx_in_ord_ind(str
                         * better to report something than nothing though. This
                         * should still give an idea about rx rate to the user.
                         */
 +                      num_msdus += skb_queue_len(&amsdu);
                        ath10k_htt_rx_h_ppdu(ar, &amsdu, status, vdev_id);
                        ath10k_htt_rx_h_filter(ar, &amsdu, status);
-                       ath10k_htt_rx_h_mpdu(ar, &amsdu, status);
+                       ath10k_htt_rx_h_mpdu(ar, &amsdu, status, false);
                        ath10k_htt_rx_h_deliver(ar, &amsdu, status);
                        break;
                case -EAGAIN:
@@@ -252,6 -239,6 +252,9 @@@ enum htt_rx_mpdu_encrypt_type 
        HTT_RX_MPDU_ENCRYPT_WAPI             = 5,
        HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2     = 6,
        HTT_RX_MPDU_ENCRYPT_NONE             = 7,
++      HTT_RX_MPDU_ENCRYPT_AES_CCM256_WPA2  = 8,
++      HTT_RX_MPDU_ENCRYPT_AES_GCMP_WPA2    = 9,
++      HTT_RX_MPDU_ENCRYPT_AES_GCMP256_WPA2 = 10,
  };
  
  #define RX_MPDU_START_INFO0_PEER_IDX_MASK     0x000007ff
Simple merge
Simple merge
@@@ -1013,15 -1013,9 +1013,17 @@@ ieee80211_tx_info_clear_status(struct i
   *    on this subframe
   * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC
   *    is stored in the @ampdu_delimiter_crc field)
+  * @RX_FLAG_MIC_STRIPPED: The mic was stripped of this packet. Decryption was
+  *    done by the hardware
   * @RX_FLAG_LDPC: LDPC was used
 + * @RX_FLAG_ONLY_MONITOR: Report frame only to monitor interfaces without
 + *    processing it in any regular way.
 + *    This is useful if drivers offload some frames but still want to report
 + *    them for sniffing purposes.
 + * @RX_FLAG_SKIP_MONITOR: Process and report frame to all interfaces except
 + *    monitor interfaces.
 + *    This is useful if drivers offload some frames but still want to report
 + *    them for sniffing purposes.
   * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3
   * @RX_FLAG_10MHZ: 10 MHz (half channel) was used
   * @RX_FLAG_5MHZ: 5 MHz (quarter channel) was used
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc net/ipv4/tcp.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge