Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1297190lqm; Thu, 2 May 2024 10:18:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXbX8ZhxhOgphKLS8E56SWLWKX1dD9cV5+maczonmHiWpUdvG67tpDaKM2icxcoSQvH5Bdf39nAjdSCE6fGX2d0BExHcya9dBfVWBHV4A== X-Google-Smtp-Source: AGHT+IHp7ObFoxb/983HgOCDQZISr8jzMhv/LZmwMu1Z1axXMhO9hctvgB4jAIXRCokPB5L5StG7 X-Received: by 2002:a05:6808:18a8:b0:3c6:d9:2c75 with SMTP id bi40-20020a05680818a800b003c600d92c75mr628472oib.30.1714670325532; Thu, 02 May 2024 10:18:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714670325; cv=pass; d=google.com; s=arc-20160816; b=PS0UapP7shfKXNop9frlFZCstSr9qG9MXfpwpMSQHWIoWynJvjl5Q6FlobysKt5HTz pe9aNjAbITYWazvtz7co1ubfRG/xrub4N9APVD+5UMexVHXMr9n7i3YuIIbzZ4dtrdxm zkhPmYs/FhrcTMBAThEwgPaKv3+uo/djAVAnoumvpfIHFIHtZjG5Am5n90lY3vKIc0Gd 2D6/k+HDcyPU+ZeqYiby4bKk2tZN/kv/s4okZfpvrpPwXJ4i69qeqpf8nw6adh51NUaD zAhxIMZiFe0pRZLIbPnd6TCIHKviWrmgXyfEkItKGcb1FME49IA0TyIfJVvdAePiwivG lRCw== 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:cc:to :from; bh=AV67mCTFYc91UN8X5RKRCwNnRRGn+tgUiRcAMg+Lp/c=; fh=IDSKTy1aNCxuU4G2sR9zhX7OA09ecR0NydLnG+Uo2WU=; b=K19SpfXdrCmmMuvDQB2ImUvYI3puIGrAJR2uh3uSlHVxw4pRupxx64t3652qIKrymV zo3vb3a5r820msDo721zKSMvTa8Msml1r3kQHc0YB9O0wAQZOsaIxZcOrp+ZhNjG75jc qtkCMTA2MgiQJfKfFNWE5g3zdljKl6qL2uQlQnqusyEf2BY2odzV5mjg+w5OqzWW/ku5 P29v/Srwx1RsV0GA0lKSFSyA/Nq2UHakMjh7A4hgLZuYpV1nsBoUPQF8dDv6QQx6LHCc 5Sn8vnbSro9btPIUbMFamuZErfeJTCy3m1s00RBGOO6W9sQqOFzh8JWswlEPB9OWLcZx NBpw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-166773-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166773-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sung-woo.kim Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id iy2-20020a0562140f6200b006a0d3ef2b74si1368167qvb.137.2024.05.02.10.18.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 10:18:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166773-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-166773-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166773-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sung-woo.kim 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3DA771C21B6F for ; Thu, 2 May 2024 17:18:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB8D416FF3F; Thu, 2 May 2024 17:18:36 +0000 (UTC) Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (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 DE17216D4C0; Thu, 2 May 2024 17:18:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714670316; cv=none; b=mkmoNSld0TtbsslbZ5ibWKgBZRnKqVwdkpDiPtNWzYau5Vf4bSXgheP9WPhmtqeEf2LhsKiRw1LywpR1OleE4aXKS6382SGxOTP9fHZERrEtTfliFOe14K9DSAACB1EXiWjQ5AZzTO/lma/EG8JCX+2cENY92B2m/Q5FuC2NAvc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714670316; c=relaxed/simple; bh=D8D6R0MTWj2AZqJhJXCP7hDVz2lRpbK9k5gLOEwYack=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=azNpQYP6PzDTSLMoIaKT1UtivxXLNmC8JHnivZTDv4JmCDxAdx4nQbtiTcwKc1PpBWbXnyr5b71FeDJ1fOz79JUGdSzCxi/6Vnz759Do/6DrpQswlSoxNh582saZR5XUvzcKUcYXj20T/usSS9891MfH72VLAiQqFedHd8oY6mg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=sung-woo.kim; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.219.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=sung-woo.kim Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-69b10ead8f5so42940946d6.0; Thu, 02 May 2024 10:18:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714670314; x=1715275114; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AV67mCTFYc91UN8X5RKRCwNnRRGn+tgUiRcAMg+Lp/c=; b=k3bD0dAwKNJ3TSLT+oBONGiouw575F0ThErc4ptJvN9cDmPWK1G0qvL9292mGUr+zO 3Ezxc4sBz3spGwyRNQEpS+yAsM0yWFRyh6jwxYZiw7sXGJJnGsISCIyM8lJUxObRmv39 5ZLOQqqtScsUhFq56xRuFKs4LTal9d3LuPcB52mT7CFiml+3NXj5MPrHzKuF56ssAtCq skREktmH880xvEBlv3q26aQWUlUC8rATrM8/BzMBttnbkB5Jbt3XcLAluYHv6cI/ag5D PvQHvVZHp05hXNXF4nb3TK7/hqwSbwwk44b4X/TZTgWdc6b7xN8UnbxZDKUxd98Pppee DP1g== X-Forwarded-Encrypted: i=1; AJvYcCVHwaV7SBvBjM54bDkIud6toDFRGchhQLTP1xg1lSI10koDFZA4Wr2/2qeEvmIpVORwrxZ1y+6T09XdONOc1Qb1mG0ONyXA6gsewV/mV0aOwZOZTZ5TnuRg9rcIMvLj7aRgW2hOzl3pP8J2aQ9j X-Gm-Message-State: AOJu0Yx2pyB8mPHtFpz49HyXWrTAdFBC5Augy1F6s40BVsaH9cVOu+wW Ng39hpVZ8vZaTtQHOEn7yAywS3nRQdTi8R1+ws8LswQLhTAqc4O2UkA7lGDgff4= X-Received: by 2002:a05:6214:2aa1:b0:6a0:ce12:b8a4 with SMTP id js1-20020a0562142aa100b006a0ce12b8a4mr235826qvb.21.1714670313840; Thu, 02 May 2024 10:18:33 -0700 (PDT) Received: from tofu.cs.purdue.edu ([128.210.0.165]) by smtp.gmail.com with ESMTPSA id n18-20020a0ce952000000b006a0e08d2b24sm496355qvo.79.2024.05.02.10.18.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 10:18:33 -0700 (PDT) From: Sungwoo Kim To: luiz.dentz@gmail.com Cc: daveti@purdue.edu, benquike@gmail.com, Sungwoo Kim , Marcel Holtmann , Johan Hedberg , Iulia Tanasescu , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] Bluetooth: HCI: Fix potential null-ptr-deref Date: Thu, 2 May 2024 13:17:10 -0400 Message-Id: <20240502171709.1280128-1-iam@sung-woo.kim> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Fix potential null-ptr-deref in hci_le_big_sync_established_evt(). Fixes: f777d8827817 ("Bluetooth: ISO: Notify user space about failed bis connections") Signed-off-by: Sungwoo Kim --- v1 -> v2: - add a Fixes tag - make the commit message concise v2 -> v3: - fix a wrong Fixes tag format net/bluetooth/hci_event.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 4a27e4a17..d72d238c1 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -7037,6 +7037,8 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data, u16 handle = le16_to_cpu(ev->bis[i]); bis = hci_conn_hash_lookup_handle(hdev, handle); + if (!bis) + continue; set_bit(HCI_CONN_BIG_SYNC_FAILED, &bis->flags); hci_connect_cfm(bis, ev->status); -- 2.34.1