Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1164105ybi; Fri, 2 Aug 2019 10:20:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWEurHJBAbNVBf6yAuRo3bFeYs2PRK+qqRSMbhCx+AnH+M9NWwd6aOtabLGkhbTwvSxtQo X-Received: by 2002:a17:902:2f:: with SMTP id 44mr134625657pla.5.1564766432271; Fri, 02 Aug 2019 10:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564766432; cv=none; d=google.com; s=arc-20160816; b=rTAUwOrULoMNqpyQXX2ipa6g4TKSzCRW13m+rdAz7KdDtWAlw18Pd6PTfM6w5+Duu1 TneAbZWraTzKc5wRiXdbBR0hTAzXHrb9Wq3+xbRmXuzLyVqlOz+BEkbMphoKbge6W6Tc Y6n0qrNshi1ZF1pAh6fSl7EmPHWvS0zIxhYIFkqcmMshRQzREvHrheHA14J8wPlZ82tX CQXEJ3e/eXhHmasPtL4sok+AE/hz5S8lPEgKguplyuN6Q69SvW9x9O//HgYo3bn1ENiS E8WyQSnV2mAqSO5u4q8+VG7rbSPf9X/hCTAZ/X6LVlnm5kutCRuPLjnpYHr4V9knUkNc X/Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/EjlxvKb5kALfbSyvxw+zDl9Bem+2rjsdV9sLw2ViTM=; b=ZjN/jtxL9sM67Ww/sbCYg39hXeiKOQzznFgtChjn39NyhFpa8ibje921hNUIMuMlMi 6CSJ6Tgbxc0KKO/31csMGUwmzchXOZ8hA18vmFUZFO8+GMn1zvdq+r8vAEYsEa6P3tBo RaUFKM7VgmmWrSH7T7LBNEiS2+E1DOmR+UirvLy4v6YybB+eQVJL76ZD+oqcxdm5Dvzy HCNivL8opa1gFqubZ3yUyuaqAXkBx7Yq0GxOFaP5cGsS80vqZPQbYtl33xTGZlYsSI+3 PgISxvt/9eYWazr0nBNMhgPPftEVW2V2msYk+UK6Uld6AXiXZEeKGfsEDpoY7sxNDoNi 9YgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qdeFOlys; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 44si36572524plb.366.2019.08.02.10.20.16; Fri, 02 Aug 2019 10:20:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qdeFOlys; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732841AbfHBJqE (ORCPT + 99 others); Fri, 2 Aug 2019 05:46:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:50082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405471AbfHBJqD (ORCPT ); Fri, 2 Aug 2019 05:46:03 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 18EFC216C8; Fri, 2 Aug 2019 09:46:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564739162; bh=6rAfEz0VaxnRmTfVyrHrl5rArO9Sto31J1SKv7Io9EQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qdeFOlysktMMYlgwJLzFMrcsQuTK9ZxwQBdxOkPA+HRnGLy/ZQaIQrN+gKxjfyFO1 o+tYP1RmbJxBxMPlhwzIAHbZynq/GDPfwrBpPWnUeeJBNjurqKS+DMKCyzArAuhAlT 5LCnSflvpfIuiCph5MjW33pv8gCN/7AN7cmRmNhQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Szymon Janc , Maarten Fonville , Marcel Holtmann Subject: [PATCH 4.9 122/223] Bluetooth: Add SMP workaround Microsoft Surface Precision Mouse bug Date: Fri, 2 Aug 2019 11:35:47 +0200 Message-Id: <20190802092247.058386240@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092238.692035242@linuxfoundation.org> References: <20190802092238.692035242@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Szymon Janc commit 1d87b88ba26eabd4745e158ecfd87c93a9b51dc2 upstream. Microsoft Surface Precision Mouse provides bogus identity address when pairing. It connects with Static Random address but provides Public Address in SMP Identity Address Information PDU. Address has same value but type is different. Workaround this by dropping IRK if ID address discrepancy is detected. > HCI Event: LE Meta Event (0x3e) plen 19 LE Connection Complete (0x01) Status: Success (0x00) Handle: 75 Role: Master (0x00) Peer address type: Random (0x01) Peer address: E0:52:33:93:3B:21 (Static) Connection interval: 50.00 msec (0x0028) Connection latency: 0 (0x0000) Supervision timeout: 420 msec (0x002a) Master clock accuracy: 0x00 .... > ACL Data RX: Handle 75 flags 0x02 dlen 12 SMP: Identity Address Information (0x09) len 7 Address type: Public (0x00) Address: E0:52:33:93:3B:21 Signed-off-by: Szymon Janc Tested-by: Maarten Fonville Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199461 Cc: stable@vger.kernel.org Signed-off-by: Marcel Holtmann Signed-off-by: Greg Kroah-Hartman --- net/bluetooth/smp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -2514,6 +2514,19 @@ static int smp_cmd_ident_addr_info(struc goto distribute; } + /* Drop IRK if peer is using identity address during pairing but is + * providing different address as identity information. + * + * Microsoft Surface Precision Mouse is known to have this bug. + */ + if (hci_is_identity_address(&hcon->dst, hcon->dst_type) && + (bacmp(&info->bdaddr, &hcon->dst) || + info->addr_type != hcon->dst_type)) { + bt_dev_err(hcon->hdev, + "ignoring IRK with invalid identity address"); + goto distribute; + } + bacpy(&smp->id_addr, &info->bdaddr); smp->id_addr_type = info->addr_type;