Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2332517pxk; Sat, 19 Sep 2020 23:24:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuOwJaPSP6j7KPGkcV6ELGlZ1t8E4kMWeMLUWzxIJGDQg9bCA23vCnk2XKosuiyaasmnXa X-Received: by 2002:a05:6402:515:: with SMTP id m21mr47332205edv.348.1600583040012; Sat, 19 Sep 2020 23:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600583040; cv=none; d=google.com; s=arc-20160816; b=1FmL4+CcHG9k03ZQ7YhQgMnpc7FqazbF3tKnIFIk1kVOvHM04cwb9+sAmB3sCVQTC1 QsYOVCcuTFH9ppFd3Q+hWVzaKLb4yIc/kicKqSUWAk0F5GpHUBFDEqiCCYvHokeW3yte +Na3M2Un7rRIvH/Z6LvloIVVTWTSXVTNjNSK5+cpfYnLfgGTQu1Xh2XOyVhAa7qY0odG mj1iSx/aKrREKr5Ox7XCYCuITG1Fgg/2E62qBqW0Vn2c1GM2Kd9mxyeWOf6fTOBiiuh9 PLsHjg958V4YQkI7L63NvUeNBXYZzbwh4LWxBCU6ZDv3A4VKg/eTr9tlNY3U/9OqSWQZ DSag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=ThBBpA/+qTFIdTbXA/Z9VxXKS/agHC5m59hnd4ioLyU=; b=kXncP6nrrNuKJISi+F+SXlMiXCKzBSzKu44lgrbWV5IOS/rtWNqdHHXhMJIMSy2LnR 6XgUrqYcYjna45R+ZJE+K+bcstZHpwY5LiHwNVNgvhON1sx4A+TDgqPOK0rArtAk+bPK xap95qwFPsN1IS/j0VBypzL1SMNKGEMsbvzsPrDhkB5zeg47t4v0iyABRrVjV+0yoeg6 24n8m5O46iMF9UMLQVhAplAbR9YW+miwTS9Ny6boZwuR4Soi+nBhKpcGuXXXXy5t9rKx K834hclrLBqiqsVDZUD9wNzMX7uVVEsiIa6kAxyUVdRflaK6gQwWovPxmdbEuipAk4j2 wXgA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si3128904ejr.733.2020.09.19.23.23.35; Sat, 19 Sep 2020 23:24:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726201AbgITGWd (ORCPT + 99 others); Sun, 20 Sep 2020 02:22:33 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:32788 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726200AbgITGWd (ORCPT ); Sun, 20 Sep 2020 02:22:33 -0400 Received: from marcel-macbook.fritz.box (p4fefc7f4.dip0.t-ipconnect.de [79.239.199.244]) by mail.holtmann.org (Postfix) with ESMTPSA id 86496CECBE; Sun, 20 Sep 2020 08:29:29 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: [PATCH v2] Bluetooth: Fix auto-creation of hci_conn at Conn Complete event From: Marcel Holtmann In-Reply-To: <20200814190909.361764-1-sonnysasaka@chromium.org> Date: Sun, 20 Sep 2020 08:22:31 +0200 Cc: linux-bluetooth , Abhishek Pandit-Subedi Content-Transfer-Encoding: 7bit Message-Id: References: <20200814190909.361764-1-sonnysasaka@chromium.org> To: Sonny Sasaka X-Mailer: Apple Mail (2.3608.120.23.2.1) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Sonny, > Currently the code auto-creates hci_conn only if the remote address has > been discovered before. This may not be the case. For example, the > remote device may trigger connection after reboot at already-paired > state so there is no inquiry result found, but it is still correct to > create the hci_conn when Connection Complete event is received. > > A better guard is to check against bredr allowlist. Devices in the > allowlist have been given permission to auto-connect. > > Fixes: 4f40afc6c764 ("Bluetooth: Handle BR/EDR devices during suspend") > Signed-off-by: Sonny Sasaka > Reviewed-by: Abhishek Pandit-Subedi > > --- > net/bluetooth/hci_event.c | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel