Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3130364lqo; Tue, 21 May 2024 07:43:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXs1cP5pevEQLIs5kaBpLyUjK8l49qo0abuojXURgP4/yrzWSwS7uBOTzQUWqvwJd5DAP9CEIbGzrhi+MPssEQJyQ1JRA5iV65Zns6iAg== X-Google-Smtp-Source: AGHT+IHA8+yc6rqJetTYCE9CtbScXbT37PO2yheWtarM0pnL9S0aBUPKoYP8F4b8gEcR87uiN1pQ X-Received: by 2002:a05:6e02:1c23:b0:36c:4c02:f172 with SMTP id e9e14a558f8ab-36cc1465d9amr358205765ab.17.1716302635373; Tue, 21 May 2024 07:43:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716302635; cv=pass; d=google.com; s=arc-20160816; b=x4At9DydtYtdQT6fGIvkMB8PWFQfM8NCIqIpEXS2LEHMh2XohDifX1RavrS5pfGw5P 3z1ti/yD03letE8v+l7KxTIJm1l6IsKkzaxdheyqkPeQ3Yly6nx3eRR23ERw/j2yxkro 6ZEcwQZZBH6oU82mQ2lWpzdIB79pm1zXT+v3vXJeDAT30SbazC7cAcgRdtzPWJ/oSvUG ttiD+qxpYT9mNC0NfKDBNF9hunfrE4+0ipuW7kaUNZ0R43yucSicXDcPAbKrCBCjAQo8 TmdZWYfOtha1eAhnCi5Q3FGxJ2lVems/myL2qEWY0yd/kPAV28A1U5Ln1jZy6XMqjdA3 FK6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=w+dDlQEM5zkJlOihLGtcBsuJEL9SRpaokILu3HX4UcY=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=fkGwkMWTzH5f9+aIVbVeEGGvz+lrzxaVyyZ/+K3dFM8VWnFFcQXymkvKZVfvYiEKPF sdRL0jTGghaSdiggeSG3GvUjtJ+cjomOc6yxL8Hm8ZH14nycuIAAsTdrwncmA25tP5TH L0IYEfMo/XR3tcrCUfBR81rJQIP22K7BzX2wWkEGki/4bls83Syo/HCugi4kU3Vr0HoF MPJRof0tDYxvzubOAPbbfxcO8+oi1Gy8/SLeHG21Nbt34ClLGNycjq6buOlm5XQHmcgi ZgaJCyiYwHOTdHA8UtZJ1yRLNLOVCzeK4txt/wrbBL8TP6YTGd6B3SdQ2JexhTKb2dgj qj0g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FWaDLRuL; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4838-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4838-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f6c5deffafsi1544137b3a.171.2024.05.21.07.43.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 07:43:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4838-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FWaDLRuL; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4838-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4838-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 28698B268D2 for ; Tue, 21 May 2024 14:25:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D2BF13049C; Tue, 21 May 2024 14:24:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FWaDLRuL" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com [209.85.217.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5208F12FF8F for ; Tue, 21 May 2024 14:24:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716301474; cv=none; b=fhmfFHrE6u8hGm1QYfJDbRUQmWPknoz6h+QPpuAh5ykplVvlhidsKItq17pLMd7P8b7WZfHcXA4UEV+0sixZC/W/B/UBv8XRq8zFxXlH3nABJdMFnT5ejI6NKTv534TaFiKL/FT3Y4+e0CHdvXUgRqLZo1u5JTF18/1eFE8pDPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716301474; c=relaxed/simple; bh=dUin6YS5IiH3aJ4DieH367+JG5gWSMWwzGigk6xOrv4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Ci55nVKrhOn22f4W08xQVCiWmCotZSTznLu5ctUYxi+EMcZuFL7a5exWJ9pIGZtxuXP6mqi3C0g+0Y2YBRrONXSztMYwDAonEfg5FLonbdekOgaMC/jshnFWUT/2JeTxEHSFpk2eYZogei5wyGDLv7KyVlxPsIyy6d4mL9udDik= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FWaDLRuL; arc=none smtp.client-ip=209.85.217.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vs1-f48.google.com with SMTP id ada2fe7eead31-47ef5a51829so1168093137.2 for ; Tue, 21 May 2024 07:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716301471; x=1716906271; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=w+dDlQEM5zkJlOihLGtcBsuJEL9SRpaokILu3HX4UcY=; b=FWaDLRuLOBb5TsD45PyKkd70VszMMegkm6pK85D/HT7ARFsggl/Ct8iNzBOUuTH3KC 60yMUN9LtY2NDVgEcLsgJrOfVNUI2WLJoFU2KlrZvgkBzLXQZsL4KiKeGA6QyNmvj0gZ 0uBitkmmJJVTGSAg59l5TfzyigwdmhhqkGtYO/fu5r0ruLgAUac15OKLJaI2CMB6ywZo wbg3uirWwBz255Yqq1/HinifiPls3qKLLn+b0uCWP9clZQfPrSeaGfZ9+m50+m2hxOoV BrRtbQsBaygHqdi5o5SUmrBuIHR5oDcBVqgCTfqHJ1603xyEJJPaVjVIxE9SXjC7f+Zi lo3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716301471; x=1716906271; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w+dDlQEM5zkJlOihLGtcBsuJEL9SRpaokILu3HX4UcY=; b=VV3ybNT5/ufrPodXAjH2UEbmsCPFxNutVftIv2vxAmQVyemm2hyiSVtpvKQKtTR8Wj Hw7N+ygDBdMFeLJJollmd1jRQYqQzkq5G97S6jwXNRpgLVmdAvuFDalWiz21xlhqnnrp i/M/aAbGsH03htxHLwO52YcZzlMVoqgmxQQSewLZaSi4Q7d76lMd6nSaihwxWd2Rvd5u 5H53WHpexenzWb+puqm67dpVFYizYvTGiBURz7ygwzY1kHp0lDMEhxVRXAV5ehxr8lKx 5ZShhuXmVMauJ1QkwqDF86gDt6u66BgAJT1VzqShfujnSEvC1S9hHtNWkcX4u9Xb5gGC ffpA== X-Gm-Message-State: AOJu0YyD6gXELmN0vPVFc4NVi+GdYO/F03s34hLAzMqXuUZkCUG3LApD G/Ggel3wkCBc/Cm1xgUQnKuekoAJZ3X2czGbpA6quQgjJICZIzGv7/G44Q== X-Received: by 2002:a05:6102:f0b:b0:47b:d49b:c57 with SMTP id ada2fe7eead31-48077e1576emr30732097137.18.1716301470936; Tue, 21 May 2024 07:24:30 -0700 (PDT) Received: from lvondent-mobl4.. (syn-107-146-107-067.res.spectrum.com. [107.146.107.67]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-4806cc1f740sm3634050137.30.2024.05.21.07.24.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 07:24:30 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v2] Bluetooth: L2CAP: Fix rejecting L2CAP_CONN_PARAM_UPDATE_REQ Date: Tue, 21 May 2024 10:24:29 -0400 Message-ID: <20240521142429.1562347-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.45.1 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Luiz Augusto von Dentz This removes the bogus check for max > hcon->le_conn_max_interval since the later is just the initial maximum conn interval not the maximum the stack could support which is really 3200=4000ms. In order to pass GAP/CONN/CPUP/BV-05-C one shall probably enter values of the following fields in IXIT that would cause hci_check_conn_params to fail: TSPX_conn_update_int_min TSPX_conn_update_int_max TSPX_conn_update_peripheral_latency TSPX_conn_update_supervision_timeout Link: https://github.com/bluez/bluez/issues/847 Fixes: e4b019515f95 ("Bluetooth: Enforce validation on max value of connection interval") Signed-off-by: Luiz Augusto von Dentz --- net/bluetooth/l2cap_core.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 5b509b767557..c8a34283f1d8 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -4647,17 +4647,13 @@ static inline int l2cap_conn_param_update_req(struct l2cap_conn *conn, memset(&rsp, 0, sizeof(rsp)); - if (max > hcon->le_conn_max_interval) { - BT_DBG("requested connection interval exceeds current bounds."); - err = -EINVAL; - } else { - err = hci_check_conn_params(min, max, latency, to_multiplier); - } - - if (err) + err = hci_check_conn_params(min, max, latency, to_multiplier); + if (err) { + BT_WARN("hci_check_conn_params failed err: %d", err); rsp.result = cpu_to_le16(L2CAP_CONN_PARAM_REJECTED); - else + } else { rsp.result = cpu_to_le16(L2CAP_CONN_PARAM_ACCEPTED); + } l2cap_send_cmd(conn, cmd->ident, L2CAP_CONN_PARAM_UPDATE_RSP, sizeof(rsp), &rsp); -- 2.45.1