Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp460587pxj; Thu, 20 May 2021 13:29:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuWziM+MEvjAlXY/h52wlMRSAuH7StB6ZYrbcxEAyTdtdmmeUGFnbu13QXMr3OmrtNlnY1 X-Received: by 2002:a05:6602:2d8f:: with SMTP id k15mr7541872iow.114.1621542565468; Thu, 20 May 2021 13:29:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621542565; cv=none; d=google.com; s=arc-20160816; b=eA2u7QAUYhSqBnwNevVNkfZojCMIcyocvuy86DNfhAGX0yWbwHGP+j+ijKBQd3LPuu Sq0NXKv6GHMcQpf9k4MZhvsUlCNvI605Syv5PkO7xQ+iWpzvwQ1LFKDdNweQOIEr1qpJ mPvVpVS9DKNIGrWDLiA41UW3//sdNNBcWGY+AkaPqqPALwCnjj93YClduKGVM5oyuHfG ijsBfZp+92oikpZ9eldrZTV8typslMpBBI5CkU5caA9l9/uMl3bU2xwizUklfPzhC499 g9STVVayvLft/PfqcMM4v3QTARo8sKr3rl4fmCL91FvFaujK75VOOvTA4NxAJfA85J38 SkyA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=C5hG5fWI4cXmz+jBMg6nzToimDfROgf+YL/TEnXp3k0=; b=zf6V+Bq4WzZS9ZQ/xWRTKED3jDJFLE87eZQeH9766T3r5VpnCu8RNwzSDQo37RZXpb kwKqeAmRnxzNy6VfASLXhuhlpIN6zcJV2XwhqWzvwQbyAvAUMFjkbxifZ+pbOdd3ohMw ABcBZD4oR5Oo24pM93WS57c5bxVhKnqmkc5d3hIL9vXqAXpQtpqo0e4TYRLBT4IITpb+ tJCAQvYtBBY1TzczpnHw35LozvLIEi6byeB6JcDZdguegoXSG07BDYaodwRt4eAu+OAa H0u8/2hRLyxpQ5NbfpGU4rLQXQJat1vCbowqAL2t6Y+ZolVbSjcpMjLXKtJF9mP/OxGq 8KDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eULwJoAg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si3423522ilj.7.2021.05.20.13.29.12; Thu, 20 May 2021 13:29:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=eULwJoAg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238952AbhETKyW (ORCPT + 99 others); Thu, 20 May 2021 06:54:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:40014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234813AbhETKiF (ORCPT ); Thu, 20 May 2021 06:38:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1032E61C6C; Thu, 20 May 2021 09:54:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504488; bh=dPx9z9fKQJ6K4YmTJcUomZVJhoMxNaHdCoO5HYefZCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eULwJoAg91lKSGSNCcbArjNBrhFaV573E6OqFVwCbmRVBbTxtPjSKxBMQuRFbEEOi 3zw4uIFuuaBzCyO5x+nf2j0m6N28AW9DqDMDd7T6M0krbiKdm2j4es91ygIKvobWG2 gz9Wdc20ZIh/Vx6qjH74oKRLuXGAOO8BYP+j5tlA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tetsuo Handa , Marcel Holtmann , Sasha Levin , syzbot Subject: [PATCH 4.14 241/323] Bluetooth: initialize skb_queue_head at l2cap_chan_create() Date: Thu, 20 May 2021 11:22:13 +0200 Message-Id: <20210520092128.439367429@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tetsuo Handa [ Upstream commit be8597239379f0f53c9710dd6ab551bbf535bec6 ] syzbot is hitting "INFO: trying to register non-static key." message [1], for "struct l2cap_chan"->tx_q.lock spinlock is not yet initialized when l2cap_chan_del() is called due to e.g. timeout. Since "struct l2cap_chan"->lock mutex is initialized at l2cap_chan_create() immediately after "struct l2cap_chan" is allocated using kzalloc(), let's as well initialize "struct l2cap_chan"->{tx_q,srej_q}.lock spinlocks there. [1] https://syzkaller.appspot.com/bug?extid=fadfba6a911f6bf71842 Reported-and-tested-by: syzbot Signed-off-by: Tetsuo Handa Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- net/bluetooth/l2cap_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index b5a7d04066ec..460401349255 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -445,6 +445,8 @@ struct l2cap_chan *l2cap_chan_create(void) if (!chan) return NULL; + skb_queue_head_init(&chan->tx_q); + skb_queue_head_init(&chan->srej_q); mutex_init(&chan->lock); /* Set default lock nesting level */ -- 2.30.2