Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2981661pxj; Mon, 17 May 2021 14:48:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUVMSH9ag+rODJMes8gPOwJVMl7skpTAK7MapUlNSNF/ItiRwJ2HFwNKou87ubVTN949t0 X-Received: by 2002:a05:6e02:1ca1:: with SMTP id x1mr1457433ill.86.1621288129298; Mon, 17 May 2021 14:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621288129; cv=none; d=google.com; s=arc-20160816; b=gGI6wcXKaNEXMN2o4dcXI3PuGrQiK5dEOBSxEbvnsi+NFgptRnyCRS0MmpXaqSnWVJ 1aSR75zj4EgLZoKalbpP4y7TT3cyWH1nkBgjeimfLL+A/NBLW2msE1JgCApAPTuMAdcw voHBpDEI77r97J0sDdq+wcFz580uSYTdyDycdGYVHxc0jJxVaihJ+7jH5yCE5F2N+Jz/ HLfIzpZzDDog8ULyorJnXcV5kzb2+Qy56S/YsKaN5f3VYgVLnxzgtLAMZv2OOE/XExkl 8CenO/KQInGhPUAG/6GDDcmS5pNPllljlEupnvQqIIv/9gfWtiLmcfYNEmNgT4DZxImJ GPqw== 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=E9OF4JFjkV1F0xitcNiNrRNbReR+PgJSHiZi1fWWca8=; b=ZMDCzcK2kPBu4mlCG+4np9R17ChoNNm+5OR7Eo9EZ+GNHhPBP35i0d1bkp2wy5CMpz bR1ssC36s6YqwKu6Mv44jgWPZPIqAQNDpx/pwi/0/gDsQq6pZAyYSrZjAK6ErA521F/S /eRS/eLCINeC8jYHRC31NTVq3DBuDUYeHjxhjBIEQBUKp6Jq9/ApJcREOMvJVE88QEKO Tj+ajNcW88USFYmrItI7mJx+iSLf5PvwpfS00aJ8QDBd9PgsowE2Vpy9LmIfQ9u3N4y7 0MU6eBKFCC+zo1p/9oA3jjvnswIn7bESncS/yMyQuFr6H+p7ERygQy3rZQTYOuh8/1oZ t0yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="sr/320+y"; 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 r1si3285245ilj.100.2021.05.17.14.48.36; Mon, 17 May 2021 14:48:49 -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="sr/320+y"; 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 S238197AbhEQOL1 (ORCPT + 99 others); Mon, 17 May 2021 10:11:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:58348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238190AbhEQOJg (ORCPT ); Mon, 17 May 2021 10:09:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 224246134F; Mon, 17 May 2021 14:06:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260411; bh=ozxYQK2I4m6WXRH/vrM28MgAhUkooC2xtMvHqQPFQho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sr/320+yVl9k8cbC8PKIGLWIRGJlGeyJxZeavRh/QI27g4YYAGoc5uv58god+MztA uUTdshdmhm/k8Koo+6BvkQAuHKV6dlB858AeMaxhlV2RKhdARQOdv/y43Nd6cYdRo6 aaCDIZPbhSeD1EKZditTpoZSHHU65qkBUIqiprZY= 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 5.12 034/363] Bluetooth: initialize skb_queue_head at l2cap_chan_create() Date: Mon, 17 May 2021 15:58:20 +0200 Message-Id: <20210517140303.753816561@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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 db6a4b2d0d77..53ddbee459b9 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -451,6 +451,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