Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp981762rdg; Wed, 11 Oct 2023 10:41:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAQ56Q1OUv0vn0iM5BXV6WFXOtzYZFCy8LVAfFVmEezFpUv8CtLigHJbJ6PBfbEHnUSzkp X-Received: by 2002:a54:4e84:0:b0:3a7:48eb:2de2 with SMTP id c4-20020a544e84000000b003a748eb2de2mr22837202oiy.26.1697046060843; Wed, 11 Oct 2023 10:41:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697046060; cv=none; d=google.com; s=arc-20160816; b=x+GkygNxHqw4qUnyCJWrWPEXzKEp72IQiUuYM3diA/yOTjc05K/bgooShnfLmfveZG GqjaJJ4WitRsZ5yovS7r8NYvoY1PhdwEO1Ks7F+NVndRdNw4QgSyUI0jtRVyRmupcjDK 22Eq7Gph1HG15qJtndYte26ywn4XMnOiDDUvhmQgYmeWxcL8ED98KHWWwRtrZ6iZQhCL CtDSEPrJKOwh9yW+eoMB2LuU81IvvGWseJdBV9wMSfWXuiAtdE3Jw+87T6Dc0rb/lH/z tqMv2YtivR3cKdpao5RYJcmZ//Dxue9WYlGXs+h3fMBWbOSUwNEsUSqgpVOE7N5UjTmy /DYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:date:message-id :from:subject:content-transfer-encoding:mime-version:dkim-signature; bh=8stfrQox/ffvjex/mAWdgIqsqN4qC3xRECinSzCledw=; fh=ohZBpJd9p+DH502AFubkIiMb8frln267IGLSW3ECCUo=; b=nJS2Xbc2ScuOz7NTluywM21nakHbhrKTQC3LakMM9CnX4iufI2Ze8sV3oaqNcBfug8 +KXGChSS7bBRBUHPhUu951oEPfay3ukG1kuTNaCyIv4pq7VbVBVMeOQrXc3emWcLM1zr +PJeHbTJSQtUiaG6sgq3eBKUHRT8ueDF8KZEF33xD0pREuxH90oswKMAzdeAIsGsAbXZ UTiJoLpuxrVZADywwulZhqjsHlcM2Pbp7EnR2cT7pvrsEdA1GMJXYeCo8yk+BDawpGnd d0RB4Da5mSDw7hn7zc5s5F/r5Df/PRLAG6DNm7F7SP6Bj2pWo9DEZWa6RzJHUpBQpAbI x+LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TMQSrzaM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id u69-20020a637948000000b00578cbee11e2si228841pgc.642.2023.10.11.10.41.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 10:41:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TMQSrzaM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 8FDAD80F668B; Wed, 11 Oct 2023 10:40:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233045AbjJKRkt (ORCPT + 99 others); Wed, 11 Oct 2023 13:40:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234817AbjJKRkf (ORCPT ); Wed, 11 Oct 2023 13:40:35 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADAAB115; Wed, 11 Oct 2023 10:40:25 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPS id 50678C433C9; Wed, 11 Oct 2023 17:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697046025; bh=ASe+Jx12t2/axReJbaYPLyiArb/zifhujifxJT1BgeE=; h=Subject:From:Date:References:In-Reply-To:To:Cc:From; b=TMQSrzaMvfjlwCu1l7I7IKb//ZqRmZ6a6t0FSYx+E2xIv90vzoMLoM54VmmmPfpXv 3mcusSKSdn9DNvyEdeDX4d5+VEqZMWqadFmIUXqUSI8sHEjrTwwC5B3Z3E4vJHGmTG fgtZKsjZBMgUBcDgVrGcMQR1XX2afKyz/izrx4vnWnYhomQFSCpUYKKSTS72myc3A7 +PAHoxDW75OiTHr6VzlE+oftKx/tmzIwkYQzFwqEc9l1cc2r9Bxc/nRl4FbeOP5Hr1 M7n9vT54dksRBJW4HKp3z6SHXSBgH0zL2ww806Kj0VrnHB1f7PMyzmgdtcjsclMamC KJfcHOewF8pCA== Received: from aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (localhost.localdomain [127.0.0.1]) by aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (Postfix) with ESMTP id 34FC0C1614E; Wed, 11 Oct 2023 17:40:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [PATCH] Bluetooth: hci_sock: Correctly bounds check and pad HCI_MON_NEW_INDEX name From: patchwork-bot+bluetooth@kernel.org Message-Id: <169704602521.20012.6049823285233364562.git-patchwork-notify@kernel.org> Date: Wed, 11 Oct 2023 17:40:25 +0000 References: <20231011163140.work.317-kees@kernel.org> In-Reply-To: <20231011163140.work.317-kees@kernel.org> To: Kees Cook Cc: luiz.von.dentz@intel.com, twuufnxlz@gmail.com, marcel@holtmann.org, johan.hedberg@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, luiz.dentz@gmail.com, linux-kernel@vger.kernel.org, syzbot+c90849c50ed209d77689@syzkaller.appspotmail.com, linux-hardening@vger.kernel.org X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 11 Oct 2023 10:40:58 -0700 (PDT) X-Spam-Level: ** Hello: This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz : On Wed, 11 Oct 2023 09:31:44 -0700 you wrote: > The code pattern of memcpy(dst, src, strlen(src)) is almost always > wrong. In this case it is wrong because it leaves memory uninitialized > if it is less than sizeof(ni->name), and overflows ni->name when longer. > > Normally strtomem_pad() could be used here, but since ni->name is a > trailing array in struct hci_mon_new_index, compilers that don't support > -fstrict-flex-arrays=3 can't tell how large this array is via > __builtin_object_size(). Instead, open-code the helper and use sizeof() > since it will work correctly. > > [...] Here is the summary with links: - Bluetooth: hci_sock: Correctly bounds check and pad HCI_MON_NEW_INDEX name https://git.kernel.org/bluetooth/bluetooth-next/c/fbd34cc57479 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html