Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp444339imn; Wed, 3 Aug 2022 10:26:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sMBLcBxVvCSR9r8Q0kZnXETqtYyW1v/7zY877mOXwPVnKfWBhLOirgx8yCQoQQ+n7lb5Ry X-Received: by 2002:a17:907:6d12:b0:72b:6e70:8c7d with SMTP id sa18-20020a1709076d1200b0072b6e708c7dmr22375884ejc.23.1659547582836; Wed, 03 Aug 2022 10:26:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659547582; cv=none; d=google.com; s=arc-20160816; b=Huk4u0wvCIRVOCpCfOWo0Si9LBecyTSXn+B1p34iEaTSX+mfvdq0ukCn0txedk+9Bo VIfu0hPkmRx97nt/hi1bzrbPh/57MOBT4wm8r8KJoWF2aMSs1VOfj0+bRI+mOJXdY1DA arH5rWXFtQfboyrL4CkDFt4GJRz9ZdVwqgfdlSlvrwAyhuj/6Abc2sKrp9R2uBkda/o/ CxltMPEOoIoOAkx/6ee/dPPMws8OxZBXACZD9WC5QlzdVt/Nq9R0jko+dbitnnFLJUMY /gwmulhbm6fGVFwQIXLrtJkMO4GD0l0x7kqWLNzA1oIBXRCrF+rhF6lpkH4bAH+1PWeq ucZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=IwF6MuICpn1REYovk4ZbbzobDF+4fgJWhvIZ608nTt8=; b=wU0pqEV8CeJ2sr/F5fPw60oc4tucMDcTnZGsfuKWBqSIOzhtcsH0FwqH8Vzxxuk8MF P2Ia/Af7OtXz4JMQzAepCUXUd3qs0ebyfoQnm3NtKyDdt1XEhjpfip2I8JA0PPBrUho/ JFNlonE9DlcIg2ONhAlZF6JsL7jktjpb2vUw2UI20xcp3294sn9OPf4yxFprJKV+uYBU 0RsWYPmvnzeM9VkF03TgzDn0h6j/UC4eXdAVFCJwvT4OtI87dzR0HWXe+k8m/4sHZj/2 JIHRnEHCPwJs1j1/fQySsdtuk8p2QPg6BlYy7psJpAovSOwBhmeTFTP/L4mgCvv3tFu2 L8Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SsadRC8c; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js6-20020a17090797c600b00730b9546324si1534265ejc.349.2022.08.03.10.25.48; Wed, 03 Aug 2022 10:26:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SsadRC8c; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237600AbiHCRUY (ORCPT + 99 others); Wed, 3 Aug 2022 13:20:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236055AbiHCRUW (ORCPT ); Wed, 3 Aug 2022 13:20:22 -0400 Received: from mail-vs1-xe2d.google.com (mail-vs1-xe2d.google.com [IPv6:2607:f8b0:4864:20::e2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F2081A836 for ; Wed, 3 Aug 2022 10:20:21 -0700 (PDT) Received: by mail-vs1-xe2d.google.com with SMTP id 125so18576664vsd.5 for ; Wed, 03 Aug 2022 10:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=IwF6MuICpn1REYovk4ZbbzobDF+4fgJWhvIZ608nTt8=; b=SsadRC8c7iDi+qH9Xogrg2q1WstDzJ1zS3ncaov0gArCCv5ZDFftTeJfdcEIWoPqjT v02TeE610OH0SebiUtZ7lvxVFszFSuDXueJVsOeqhApvp1aZulgCH5O3YAK56wUsA9St TDjorrAJI32kgjNSuOrDZ6uAjJ2JoQIBe/Cbg9B5ktLGOFLz21GwVjti7LjUXH0UALMm Dlk3STkrG1Lyj5h0kfUajP9PGpFRL6sPurx3tl0iwi1dOWSod4s66s6a6w8OoPr7jquy Sk5HOQlWanW0kBGRfCUbPUx6r2F/oeABUAvwE2Q0QRZ8Sb1S7Rjeosyybn1UQjhT6Aku mHOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=IwF6MuICpn1REYovk4ZbbzobDF+4fgJWhvIZ608nTt8=; b=bq5i4443XOyb4J+ZLQcacPUknDAt2U7JONd8suvw/JPz3JaPRJfZT1xbieXV4tJHW+ YFAYFbVncRJKzOhsQ6xMc5GrQmXy7BQX9kmYbw2mV4DDzavPmjaBP2/wSzsPITuAwRnm WXhgYxD2HLDGFU1jlZv6EELGgUS5v4NyjLM9DpSrjpKax/QJI7sJsUt47gQpFnJOV3iw +jCwZqVgsFMkiS1fUYw8/M4+qdh73YW9g557not8x4ScUVjMiSHejdC4VEQoWGsVcjmn qdWTT15/+HY6O2vzZTxViXqAcmfRfXKGw4sKNAqx1duMbv5CEE0Egn/5pfVvVS1Zit+L A3ng== X-Gm-Message-State: ACgBeo3hWbCAUaqs8EZi+tbTPpzA9LYOSJ66PA4szuya9AG7IoHa/5JM zIFoShG80+35RDUIhU8qC+M6MaFBN2AM6Hfu X-Received: by 2002:a17:903:240e:b0:16d:cc17:8f16 with SMTP id e14-20020a170903240e00b0016dcc178f16mr26678375plo.100.1659547209544; Wed, 03 Aug 2022 10:20:09 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id b62-20020a62cf41000000b0052dc3796cc2sm5011772pfg.164.2022.08.03.10.20.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Aug 2022 10:20:07 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH] Bluetooth: ISO: Fix iso_sock_getsockopt for BT_DEFER_SETUP Date: Wed, 3 Aug 2022 10:20:06 -0700 Message-Id: <20220803172006.2951684-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz BT_DEFER_SETUP shall be considered valid for all states except for BT_CONNECTED as it is also used when initiated a connection rather then only for BT_BOUND and BT_LISTEN. Fixes: ccf74f2390d6 ("Bluetooth: Add BTPROTO_ISO socket type") Signed-off-by: Luiz Augusto von Dentz --- net/bluetooth/iso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c index 70c2dd30cb13..015d1b41bc32 100644 --- a/net/bluetooth/iso.c +++ b/net/bluetooth/iso.c @@ -1251,7 +1251,7 @@ static int iso_sock_getsockopt(struct socket *sock, int level, int optname, switch (optname) { case BT_DEFER_SETUP: - if (sk->sk_state != BT_BOUND && sk->sk_state != BT_LISTEN) { + if (sk->sk_state == BT_CONNECTED) { err = -EINVAL; break; } -- 2.37.1