Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp822843lqs; Tue, 5 Mar 2024 19:10:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU33UtHCe/WcQ7uSqlbOa/TURM/eOBWib2KM/V8rK8NgBt+btK9+NMD9CpZOugFwyGWdbdqblIBxvhi1wlbJYPGlpfv5XN983KpHTiAXA== X-Google-Smtp-Source: AGHT+IElWilTlDNufkK+cZ0/2zb5y9TslE2pbUUswLyQGLoWdF5S8jMSdbE5Unmg51MzbN4PgNtl X-Received: by 2002:ac2:5e38:0:b0:513:58a5:ab77 with SMTP id o24-20020ac25e38000000b0051358a5ab77mr1413859lfg.6.1709694658417; Tue, 05 Mar 2024 19:10:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709694658; cv=pass; d=google.com; s=arc-20160816; b=kxXpQS5SsSyP8F8IpCjS30YdAPK3LeO+tC1a783dIIfQmK1s2IosH2AT8EY+3i9hp2 O/FX66QTlf8aj6ppdydWX24HOTjjX3kW/PdRjZ+9TmUlWqDwWLCvPpWfUrYOgy9y7vQp hF94TNMRm+xfF5VZGWYuRC0QmitrT9FGdnOu7STecWoKJ0sVHKEF8aY5VB0dwJr3QWiM CX162Lf6NvPGka6fMG3gRgwRE/N0qd241ZntGwPlqZOlEvsFYVOiEdVQaMOiUB6HxUCn Qhs3MViNWcDWQuIxi5BfSp45TDLpunJOjcFo8Woiycwcdr6SDxcQGpB4STk0LJYIoHAx XPMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:date:message-id:from:subject :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=KLBEIVZFM+i1sn70hhj0WaJXbD1emTMZMrx+5hXYWEw=; fh=e/DeZcV7OV7b3E1KqewieOwAtq2X1Xj1/6MOgAgsRp0=; b=VVOuimSL0grgEFBBe6AhSdzqGH0KGEnjRyWP3PZxrZBIPbNVlumnU9cgA6n5H1PWGs T1yFMOut9Mk8H34Ac+S3qJrQK6gCBoZY1Aig9ZdMtKr5kMrPlriN7l5DZbYwJipnIyYJ /kzyhKckguTK7nMJqkn1WfzbC1gfykMj+GzuSlSKy2+OFHBiThwLtAW7+QzzEq/xYvyS eZhN4lq3QRbMyLzaacqI7P/Cb6nvxCreRBDeJMY+yQRwkuiDJKa33ENaDTqZXrEypSGR bHgiXoWE2ONp3YVm0t+nd8DelzskMQnh7xhBbF9g0Y7WjCz8PSUwHEvPxRRj0TRi5CWx lhuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r2d585M6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-93277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93277-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y21-20020a056402359500b00566d2e3212esi4609594edc.609.2024.03.05.19.10.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 19:10:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r2d585M6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-93277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93277-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2600C1F23733 for ; Wed, 6 Mar 2024 03:10:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EEF414A8B; Wed, 6 Mar 2024 03:10:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r2d585M6" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F3BB101D5; Wed, 6 Mar 2024 03:10:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709694629; cv=none; b=GgMyGz4Rke12zXykWZ4mPCIfEkZ5E7DtlDbHLfVE2dmQNHP4X947tdmFuelkxAZvkOfaJg5m8OrxIR7XGWJeZGSMmRva/4QnozzQF7KsvlxuBxE7emt1n0wK+Mnsh5Njlk8mwSzHmjpCG1G/sRMstJ4QhRT+OvI0RwhSMHgng+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709694629; c=relaxed/simple; bh=/YslR42HHcCT8sP2owzUHr13FtcYZuFcf1y1syHWAZg=; h=Content-Type:MIME-Version:Subject:From:Message-Id:Date:References: In-Reply-To:To:Cc; b=aEkOIoIDmgJhds1ZalK/ADAz7kU81oPOhpBBUPbMcOv/NnvV0E6pb8PKp71fz7jtnxzEbR3SSMmr/yWA615pvpa8Zd+tdd1DVRdUdMUooa9zRBOWDNyPQwyuSjitdy0cBaqYShom/yIPtkLhnEVQXPAw6Ydx+x1a4CEkE7N7fhw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r2d585M6; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 8EA3EC43390; Wed, 6 Mar 2024 03:10:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709694628; bh=/YslR42HHcCT8sP2owzUHr13FtcYZuFcf1y1syHWAZg=; h=Subject:From:Date:References:In-Reply-To:To:Cc:From; b=r2d585M6FNt260vmjaiMeW6EVvSaH2z2yRcJKBO/D/hgpMl6TnuHo63A4kkuMiCDJ SXUHMEAbtCC122J6cs7g+dIpTU6WP/rb9Yo5FPJklTP8/1/rlF3AxH9Tu0OuuYC4XO AdQSidFW2plxVWMI/gcXApA2m/4ILTriD8l4boBulWrNMYogZz/X+Z2ByNsfWTtJlN SijJXcj5WQu48qiuhtSLknlqCViuR/ljg6hp217roVzp8vx3a+f83qMIJb2mbpAnLB GZOdves6jhRbUz4EhNiWBC/bciDVCPI8zFezUwAN5TwZXaIsHhkFLXcmMtdRaQa/BQ lITNDhWRIsGVw== 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 7307DD9A4BB; Wed, 6 Mar 2024 03:10:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [PATCH v3] sock: Use unsafe_memcpy() for sock_copy() From: patchwork-bot+netdevbpf@kernel.org Message-Id: <170969462846.24513.2351243182107643239.git-patchwork-notify@kernel.org> Date: Wed, 06 Mar 2024 03:10:28 +0000 References: <20240304212928.make.772-kees@kernel.org> In-Reply-To: <20240304212928.make.772-kees@kernel.org> To: Kees Cook Cc: kuba@kernel.org, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, dsahern@kernel.org, kuniyu@amazon.com, wuyun.abel@bytedance.com, leitao@debian.org, alexander@mihalicyn.com, dhowells@redhat.com, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski : On Mon, 4 Mar 2024 13:29:31 -0800 you wrote: > While testing for places where zero-sized destinations were still showing > up in the kernel, sock_copy() and inet_reqsk_clone() were found, which > are using very specific memcpy() offsets for both avoiding a portion of > struct sock, and copying beyond the end of it (since struct sock is really > just a common header before the protocol-specific allocation). Instead > of trying to unravel this historical lack of container_of(), just switch > to unsafe_memcpy(), since that's effectively what was happening already > (memcpy() wasn't checking 0-sized destinations while the code base was > being converted away from fake flexible arrays). > > [...] Here is the summary with links: - [v3] sock: Use unsafe_memcpy() for sock_copy() https://git.kernel.org/netdev/net-next/c/ff73f8344e58 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html