Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1979295rwe; Fri, 2 Sep 2022 06:55:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR6vCJ7cv4HigHTrWE76ljhv+2x/eLApjpkopIRkQvYD7542TnnaWa8N474TcM9KsUQ5JlcS X-Received: by 2002:a05:6a00:1408:b0:53a:97e2:d725 with SMTP id l8-20020a056a00140800b0053a97e2d725mr15272530pfu.39.1662126956889; Fri, 02 Sep 2022 06:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662126956; cv=none; d=google.com; s=arc-20160816; b=xmYZeANB6Xfow93oNKgS3gwo1BwNf4A/eaxSzdpzIrMUjeuyOJgqIdCresfdexw+Ur i7hVXH5a1TltuK0WO6GG5HdW0Boz4snNcKNltVHvf6CIdWiaBu2YvVH0LhCpiBrgwtBe H7zk9RvUyMq/wX6fvfIm/gkTcrXGDVOdhcEXGurgN519W3EsL1awMor/DdCI5/Xo07Y9 q+C6caKYkPAsQo95t2e6lwE7Q1NS1qcv/uhlATEPmQL78W8/GIcBnTBnpdkEnGsZGi7Q JtGA8BPYxsXi2kz7UWLMMZwU7mU9VuMZnL+htV8raopVMDC16CwCZELqdc0fZB0LDg3E mwjw== 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=oQWfbXZedJI4Wy/FswNm/CXuiERNvfTQAq1v6rMzaL0=; b=pBI9Enck8aaQprdWZtXles2/h4GI4FM2YqkrllDjNw70k6xEgJGGKdMTJyz4tHp6He qRXDEEwgQVCee4XVhFRn4Kck7aoL8QnArrJyJk44Oj87Vgu17E3j/pfwNz/VuxTAvT/A VFNUJpPVADvxtTA7WN8XIDV4cghVMj2bvGJNZSXu2laxVt4zePbDNK4+XSQ7m8QLBJjg ZRUVyA2PVgo0GE18pfPc1Mchjr7x/5xiao6qUVUj2jgLYTwJPDg0JCLcWZw5cVLrlN+B pPXtBQbI7XtbezNgbBed6A9h6pu6GAHrSo/qbfuVizmt3rGQWVoFTmO4Y8nK/tp/Cf1s 5jcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CPGCMahO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b20-20020a637154000000b004307ac80d22si2042299pgn.332.2022.09.02.06.55.44; Fri, 02 Sep 2022 06:55:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=CPGCMahO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S237432AbiIBNgb (ORCPT + 99 others); Fri, 2 Sep 2022 09:36:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236576AbiIBNgF (ORCPT ); Fri, 2 Sep 2022 09:36:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FB091CFC2; Fri, 2 Sep 2022 06:15:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EB035621ED; Fri, 2 Sep 2022 12:35:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1537C433D7; Fri, 2 Sep 2022 12:35:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662122145; bh=W639fYXNBMvTaEK/415DIIqTQm17Loa2KJIsjP3wMS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CPGCMahOPVNuaP3i3f4z8Pzy1I9c6sPE4v0wh7rEN8f1kH/FW1YMgzO/df5VHNFeW 8NXEI86LkxOBQsft8MTid33Meoknw1TSybDkg6vLMiCwD/Oz4pPn3TMvFK3zRG5TkA JoRY/ZZVBvBGjaJ0FDpCzTB78otNV40IWDI3jGfE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luiz Augusto von Dentz , Sudip Mukherjee Subject: [PATCH 5.19 07/72] Bluetooth: L2CAP: Fix build errors in some archs Date: Fri, 2 Sep 2022 14:18:43 +0200 Message-Id: <20220902121405.027946732@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220902121404.772492078@linuxfoundation.org> References: <20220902121404.772492078@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org From: Luiz Augusto von Dentz commit b840304fb46cdf7012722f456bce06f151b3e81b upstream. This attempts to fix the follow errors: In function 'memcmp', inlined from 'bacmp' at ./include/net/bluetooth/bluetooth.h:347:9, inlined from 'l2cap_global_chan_by_psm' at net/bluetooth/l2cap_core.c:2003:15: ./include/linux/fortify-string.h:44:33: error: '__builtin_memcmp' specified bound 6 exceeds source size 0 [-Werror=stringop-overread] 44 | #define __underlying_memcmp __builtin_memcmp | ^ ./include/linux/fortify-string.h:420:16: note: in expansion of macro '__underlying_memcmp' 420 | return __underlying_memcmp(p, q, size); | ^~~~~~~~~~~~~~~~~~~ In function 'memcmp', inlined from 'bacmp' at ./include/net/bluetooth/bluetooth.h:347:9, inlined from 'l2cap_global_chan_by_psm' at net/bluetooth/l2cap_core.c:2004:15: ./include/linux/fortify-string.h:44:33: error: '__builtin_memcmp' specified bound 6 exceeds source size 0 [-Werror=stringop-overread] 44 | #define __underlying_memcmp __builtin_memcmp | ^ ./include/linux/fortify-string.h:420:16: note: in expansion of macro '__underlying_memcmp' 420 | return __underlying_memcmp(p, q, size); | ^~~~~~~~~~~~~~~~~~~ Fixes: 332f1795ca20 ("Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression") Signed-off-by: Luiz Augusto von Dentz Cc: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman --- net/bluetooth/l2cap_core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -1991,11 +1991,11 @@ static struct l2cap_chan *l2cap_global_c src_match = !bacmp(&c->src, src); dst_match = !bacmp(&c->dst, dst); if (src_match && dst_match) { - c = l2cap_chan_hold_unless_zero(c); - if (c) { - read_unlock(&chan_list_lock); - return c; - } + if (!l2cap_chan_hold_unless_zero(c)) + continue; + + read_unlock(&chan_list_lock); + return c; } /* Closest match */