Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1974822rdb; Mon, 9 Oct 2023 08:38:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHVXdle3yT+gYqz1Yx/bWzTst1lqNHWpByyJxyl+6R2wKdRECPNtw/FLDSra58U6QYp0Qdy X-Received: by 2002:a17:903:230a:b0:1c7:7e00:8075 with SMTP id d10-20020a170903230a00b001c77e008075mr19899164plh.66.1696865882143; Mon, 09 Oct 2023 08:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696865882; cv=none; d=google.com; s=arc-20160816; b=aOUWrNUGFDCXJdZli9zgGNPJU92Z8B9tPngSfzFHnl7EfvWNE3bWZr28Rw1EXSI6O+ ifk69md0AS8kgI25pnerlG4kx8ajHwbszsDUKcKoKagj6flUK28cFqjATdnPjQKldjMQ 9/O6aHbPu6IRLh8Xdwp+nxnY++/xjIM6+Qi8AP1bG+OUoqDLRS8jODpKPHqL3Sba5Ks5 eff00HGYLYf/4hpTgmQDw/CWUjKGaIuiYDLttQqIK1BRMPUPXkGFmflGF7o3Yy3U0XG6 s4Ccmg69d9rI5DihyQaBKu9Bg5KmwP7HusO7pnPIm2itofFXDQHNg1UY3FYIjjnhGC+u 77jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=n/RImUrhGUlSskecpFuZth4nSILi0fI4B8WAhPM6nNA=; fh=B/PQkUTIFDwot/h8VqQYtFEDMw4GAZEm6pzuaxsz/1c=; b=0t3h/Pij0rZ/yJMzBO5sySNEUwwwJEteTAd3fms79WtUIoEWMUQvQRW0yNpYgjS+Yv 59VEouay0bIs3gwb61J1n8HZV1CdNmhpu+QwN+DQMzUXTgHn62yFK1Vw/9JL4LereG/i zbHYbwWNiT+7LswiqlFx2eEqVj6JH/B554gKBOIoSyWP2Ulqb35qtBD0Irg9kl5SPfzy GJZFhlZbolcORdw6KuDvyI1NpT6QgiMU4UM9zlf9X9LSI9kANZvnTcm1Yv0pVxLDYqXD pMi0D1gXcNF8urEgBoxeeaRa4WiL5hOpqWfSYklw5296NDjnPhBSf0qnlQ//SjxNZw+i GFSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=A9UkaYTI; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=VD2mSF2n; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id kx16-20020a170902f95000b001b8a56b9895si9268328plb.616.2023.10.09.08.38.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 08:38:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=A9UkaYTI; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=VD2mSF2n; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4754C80D7E46; Mon, 9 Oct 2023 08:38:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376907AbjJIPh6 (ORCPT + 99 others); Mon, 9 Oct 2023 11:37:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377730AbjJIPhr (ORCPT ); Mon, 9 Oct 2023 11:37:47 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB99E138; Mon, 9 Oct 2023 08:37:19 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 9FE615C037D; Mon, 9 Oct 2023 11:37:16 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute5.internal (MEProxy); Mon, 09 Oct 2023 11:37:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1696865836; x=1696952236; bh=n/ RImUrhGUlSskecpFuZth4nSILi0fI4B8WAhPM6nNA=; b=A9UkaYTIxgEdYlaJyp nwZTqRq27xI1szesIvtaBAOxsr932PXgwVWE5jTi9alLFy3tRdCrT8ciibCKEWwJ mvGjiDah1kbGXiziKzDBazmeewTbzLmScvzAS/OvOHTgmqKvY2+Z5cynvF9M+gJJ Tn2ueSiWnw0s0o/cqRt0TsHDIMFrSSDIc/Dhg2ptiBHaUmuO5Zxklha7U60viMBQ tU4tKhqHKbBL2PktZ0h/WgaXiN+mPtVFVJQelgeh5ldEhFAL5dMc/qUHtnLdhedo nuDcHsqykgFwcIqcWxZaBwKcHGOoBsHF0zIbjpWz6PnETjhIzVzdV6EnKTIjBVV2 xctQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1696865836; x=1696952236; bh=n/RImUrhGUlSs kecpFuZth4nSILi0fI4B8WAhPM6nNA=; b=VD2mSF2nDLWkTNwmu8uZYUut8IUwx US5Vx1q2Yvrt2+kmFUmkTTuLrk14KUvESIfT/oiARe7bFaIFkLq+uc6bRUf5oklN GUC6uNCFXFrLzItmbdPNJFN5oDKxUKgsnzIwKslfitt4mOrsg2Dku+tXY411Bhqg o7SKVlt6CbBK49g/LnT1BOJzxQmkN2TFSlEXnhkuUxOKwudmvDWUNl5tidvecJ9C o7mPACrHKy0Heig9rR72bRURA3fc9PLVauEQ6HdWEeRSSIZr9gB/Andv4gYPAvrz GKcONUveG+aI2szGWjUQ8VJhZvTfg+VGFAO3rU+C8g5VJR6AI6+bvQAyQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrheefgdeludcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedtkeet ffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id C45B91700089; Mon, 9 Oct 2023 11:37:15 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-958-g1b1b911df8-fm-20230927.002-g1b1b911d MIME-Version: 1.0 Message-Id: <2abaad09-b6e0-4dd5-9796-939f20804865@app.fastmail.com> In-Reply-To: <20231009134826.1063869-1-arnd@kernel.org> References: <20231009134826.1063869-1-arnd@kernel.org> Date: Mon, 09 Oct 2023 17:36:55 +0200 From: "Arnd Bergmann" To: "Arnd Bergmann" , "Marcel Holtmann" , "Johan Hedberg" , "Luiz Augusto von Dentz" , "David S . Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Paolo Abeni" , "Lee, Chun-Yi" Cc: "Kees Cook" , "Luiz Augusto von Dentz" , stable@vger.kernel.org, "Iulia Tanasescu" , "Wenjia Zhang" , linux-bluetooth@vger.kernel.org, Netdev , linux-kernel@vger.kernel.org Subject: Re: [PATCH] Bluetooth: mark bacmp() and bacpy() as __always_inline Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS 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-bluetooth@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 09 Oct 2023 08:38:01 -0700 (PDT) On Mon, Oct 9, 2023, at 15:48, Arnd Bergmann wrote: > From: Arnd Bergmann > > These functions are simple wrappers around memcmp() and memcpy(), which > contain compile-time checks for buffer overflow. Something in gcc-13 and > likely other versions makes this trigger a warning when the functions > are not inlined and the compiler misunderstands the buffer length: > > In file included from net/bluetooth/hci_event.c:32: > In function 'bacmp', > inlined from 'hci_conn_request_evt' at > net/bluetooth/hci_event.c:3276:7: > include/net/bluetooth/bluetooth.h:364:16: error: 'memcmp' specified > bound 6 exceeds source size 0 [-Werror=stringop-overread] > 364 | return memcmp(ba1, ba2, sizeof(bdaddr_t)); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Use the __always_inline annotation to ensure that the helpers are > correctly checked. This has no effect on the actual correctness > of the code, but avoids the warning. Since the patch that introduced > the warning is marked for stable backports, this one should also > go that way to avoid introducing build regressions. > > Fixes: d70e44fef8621 ("Bluetooth: Reject connection with the device > which has same BD_ADDR") > Cc: Kees Cook > Cc: Lee, Chun-Yi > Cc: Luiz Augusto von Dentz > Cc: Marcel Holtmann > Cc: stable@vger.kernel.org > Signed-off-by: Arnd Bergmann Sorry, I have to retract this, something went wrong on my testing and I now see the same problem in some configs regardless of whether the patch is applied or not. Arnd