Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3133650pxj; Mon, 17 May 2021 18:40:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxX/uj6QlEIX449lXZW8+svBxLkU5/8lZRb17cInLxtxm15uhGSOrHrCeNlA8tME9w0vDJT X-Received: by 2002:a5e:a902:: with SMTP id c2mr2349446iod.80.1621302017333; Mon, 17 May 2021 18:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621302017; cv=none; d=google.com; s=arc-20160816; b=eenaUlKaKhRflK9Y1VfDUlmGEPFfja1PLT7+/ZQTXOgC6crHOkSkxxVAWYrFEmEpWo EFszLTj6Dg+VjACU6NHd/4ZpT6K1mY0FtyNonutNyhdSvBJ9/Ld2abHlvVk78rqcI1zz 2VEvf9dRRZV5DFzDC4e/5ucnWzaWu1v7sy4eLScpNFoPGr+j41Q5ybaPdF/QF85H2jGQ WK8fEmZmRqX6LPAXgr9ulxDHWcARZkMtdQyGIDoesCtb2DlbO1/ModFupJElJ9M9pYts YlEaYLx95r1aj4UqI/y0yMdL7QE8zjfQK6gegar0yMuNIY+LyMaVbFNSxVpzS8bc1NVL nfBQ== 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=Wa8HDju4aoIrWb9EfCMN54hF1Pg1FLlOGGEnV73QYcQ=; b=B2LmpaN3rqoh2ilciJfytKSzATbFvjDtTKVkhjxUB2myMxmsnkEHgCMBfnWsdsLrX6 0p/znOwky5TMg5IoXrZLnaqpvIR1QJ4sl7klwvbeil76iPsxzX9JEY0AdTKlQ8o+Kk3a 1t/jj0fQzOwqGjpAt11XEryAA9vYZvbcJBKpPIai0tVgoJBhKJ1c4a0u1lx46siE7aHW XzvdaaXRfDnBDQT3P7IGgDbP9INKoFVrC7oTIVpA7kpPSfPr0kToNflSC0QYxX1Q26O8 5CpHYszGT2xbH/pBeDmgiitIi3mwH8IgX11ObstrnJTqTrDn0T7oBsiKFTUYBUi1ssBq dm6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JVxEq9oz; 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 p8si18554674ils.114.2021.05.17.18.39.53; Mon, 17 May 2021 18:40:17 -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=JVxEq9oz; 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 S240778AbhEQOfP (ORCPT + 99 others); Mon, 17 May 2021 10:35:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:45054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238578AbhEQOaO (ORCPT ); Mon, 17 May 2021 10:30:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 638A6616EC; Mon, 17 May 2021 14:15:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260917; bh=nlRjb1u7hSZ9ilo4vAun6ueLqcGnriYGmhd3kAeYos4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JVxEq9ozpbh8ccICZAkiEvETFRa1CWpLYLVeDq/zBF4xQyTAtNYJpXl/yec6AHRvq iABUMr34T2zZ5jU3Lh6M+eDfJqkmCoN/T34rfmAH9KcR3pBnf6jciY0jYdOre1ot4k Zt9F0UBQzdTOowp2iqCvMK61yomiY2TNSgTYW5Qo= 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.11 034/329] Bluetooth: initialize skb_queue_head at l2cap_chan_create() Date: Mon, 17 May 2021 15:59:05 +0200 Message-Id: <20210517140303.193130629@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.043055203@linuxfoundation.org> References: <20210517140302.043055203@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 46da4c1d0177..78776d0782c5 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