Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp215572ybs; Tue, 26 May 2020 07:31:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTnNLDmxTZKYludCBeTwroP18HPlbvYligqqMVlPKfg1xsLBgr7DnYGaiALH6uQdcOsSa9 X-Received: by 2002:a17:906:454a:: with SMTP id s10mr1360766ejq.112.1590503487926; Tue, 26 May 2020 07:31:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590503487; cv=none; d=google.com; s=arc-20160816; b=Vmc4yYHGwpRzH/nhCEjcUYmAE51KVzlm8D7YszFrUjn/OAaz8miuP23HpAgi+4xIOi 2uqQNjNyxXiQHwNlZI0D3Qqc5EBrAxY9F642qjPEEXh+67tT24RjNj90uyr2K1IOX4d+ 6c7JmfdwOI7+p/1AhafiNyt7vL+8+ur/Tmq/bREt5nRP81RMY7xSGovlo32P0s3JSIv4 nnTLspv8szWjvknRxeO1Uu6Mw3nerSZH23XNpFyyKAg/lEonHaoNGOLmWIsnX9UgjNN1 k5ufspu77aFg2zqjXSiBwuZra9trGmt95gdBSDkX7GmIacSjBCvqWK6WRQwWsW6ZVcU+ XZBg== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=LztMYlNxAp/YzMlFlAsB5KiKAsfpCCfOHvY1s1s4XCs=; b=b0mu0gPhNSKpZGkvs6bh9364oQ7NZ8GmpYNZ5M3uY/BHbuEXmRcCG8KZ6ZMhAdS7PU 5cVIsnFnTTbx2ZzlbL6F5hDX5sml1La60FVWe2U8NJ4/He4uIxp/+41OCPo8tFFPbF67 c2+1nDRzuwmSdmAZb8dgoLpsyV++MTmZnoUv8vFWVWXhQGbvScS83tomrjRp1c+dUQdr N/LMeJ2qGi/CWeHt1h+SiVA4ApHI1FvWdAK4+x2E9yq7hyXsz02zQ7MtTSaHTGtaDM2p mKc6RR89hCvvhDo5yMBQRPbIeg4PMg/zFiB/Byu+ZOySBipjxd79gJnNnLl3kVdlWfhD 9XTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=muB9sQtY; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j6si11464612ejs.245.2020.05.26.07.30.53; Tue, 26 May 2020 07:31:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=muB9sQtY; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727990AbgEZOaj (ORCPT + 99 others); Tue, 26 May 2020 10:30:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727007AbgEZOaj (ORCPT ); Tue, 26 May 2020 10:30:39 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9744DC03E96D for ; Tue, 26 May 2020 07:30:38 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id w10so24817042ljo.0 for ; Tue, 26 May 2020 07:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=LztMYlNxAp/YzMlFlAsB5KiKAsfpCCfOHvY1s1s4XCs=; b=muB9sQtYshmJG2HyGawj5kPZ3mQ9OtxQqO65WeL7XZZGucmQP3f/dpE5Lnsd45jxGK /olNwAccvNEDx0+UiRCswWlbzdsf5J/3DIyLeSmc+Fbi1SbIrOtxY067w7lfcMhSiESz rxNDv4kI+JaXZtq4s8ooU0VPtKBCK7oepo8l2zy4uVZj9vOWTcM0U9tzHcB4aM0TtvEy v/7zqfuXMpHACGXZ5R6S1J7UL9YyWYYr64p5TQbcZlFVDc4X/C+miUJGuRd055G5Wimn SB5MaGWxTnnEEGig4KWaK9mwpYPA4TMKu/VQ/D+yp9lBCKbfAx69kRuCX4HMOfO8u9h1 Hyag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=LztMYlNxAp/YzMlFlAsB5KiKAsfpCCfOHvY1s1s4XCs=; b=da7Y3XnrOhTSpzlFeC5QrUIh1i7M9XafG15Uyw3YMmctxpLdirDPqwWvVV+jCCzN6K Ewcv4BakdrnXyqmrIeA+pzUem66leR8GEJ3JjT5JRFVhrrnSjDurM8K0AznxBfB66E7g pBjbnPqvjysaRaudRTVaN84uykeQANJOk81EDtKhiX555Udvl5j9KTlajb4CLWvSTPT4 EwhUe422RNv+ONRBPvw2xYJj3iCrfkIIYO4y2zgLxDtvRpwb9xuGfNZccS62OJc6y0hu 4BcQ0BZVyQ8uXhTWXE86EWI6o4ormzC4F88AZbF4gT5L33bZ1JuhqkSQCZJknPn6u8x3 WbYw== X-Gm-Message-State: AOAM533sw8K4h49bIwtdmSTkahs/zyd0v6ihG3ysAHYMxrMakNj0n21S zfIydb0fwJIbmW/fG94rSC7wRHwtbdbKDIiNvBezJA== X-Received: by 2002:a2e:9586:: with SMTP id w6mr719718ljh.274.1590503436858; Tue, 26 May 2020 07:30:36 -0700 (PDT) MIME-Version: 1.0 References: <20200519202519.219335-1-luiz.dentz@gmail.com> <20200519202519.219335-2-luiz.dentz@gmail.com> <23C4DB2B-4C5E-45E7-A777-6F26A675EB92@holtmann.org> In-Reply-To: <23C4DB2B-4C5E-45E7-A777-6F26A675EB92@holtmann.org> From: Alain Michaud Date: Tue, 26 May 2020 10:30:25 -0400 Message-ID: Subject: Re: [PATCH 2/4] Bluetooth: Fix assuming EIR flags can result in SSP authentication To: Marcel Holtmann Cc: Luiz Augusto von Dentz , BlueZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Luiz, On Tue, May 26, 2020 at 10:17 AM Marcel Holtmann wrot= e: > > Hi Alain, > > > Starting with the 2.1 specification, it is my interpretation that it > > is not valid to support EIR but not SSP. I understand that SSP may be > > disabled from BlueZ's point of view, but this doesn't seem to be a > > legitimate/qualifiable configuration. Should we instead fail the > > legacy pairing if EIR was received as an invalid condition? > > I know that using EIR requires to also use SSP. However this is just a pr= ecaution in case the other device is an attacked and tries to trick us. > > You might get an inquiry result and not extended inquiry result, but you = are still talking to a SSP device. This has to do with the fact that the re= ception of EIR is not guaranteed. In case of radio interference you might m= iss one and only get an ordinary inquiry result. > > If we indeed received an EIR and then get legacy pairing request, we coul= d try to reject the pairing. However keep in mind that our inquiry cache is= time limited and we through outdated information away. This might cause so= me race condition. So I rather read the remote host features to ensure we k= now the actual host features of the remote device. You are correct, the EIR response is not a guaranteed thing. For this reason, the host should try to resolve the name of the device before initiating bonding where a Remote Host Supported Feature Notification Event is generated to signal the remote side's support of SSP. As you allude to, a remote spoofing a legitimate SSP device may always just jam and downgrade to not SSP, but if you have any signals that SSP is supported by the device, it may be a good defensive posture. Receiving an EIR response or a Remote Host Supported Feature Event with the SSP bit set is a good indication that the device supports SSP and you should expect SSP to take place. Again, it is not a valid configuration to have EIR enabled but not SSP per my interpretation of the 2.1 specification. > > Regards > > Marcel >