From mboxrd@z Thu Jan 1 00:00:00 1970 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 11ED0145B12; Fri, 5 Jul 2024 23:10:54 +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=1720221055; cv=none; b=omvVrhBtsAkWgD3avtKBjmzPYQV2h1WS+WWNgFw9sOK7Rgla6mkAcI51Gzx7NT/W5Wa/rFcj3aO1rv7as5z6iJMtDzGeZKY0FGWHMCIi0EB49KPN+HahpAkys/GYZoqZC9Q7Z+8O1PbF7UOD1d5AUTp2VnGXt4sH6qaJQtGC0MU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720221055; c=relaxed/simple; bh=xS7VcBK27sfR8bV43BCjPhUhK+xwxmamXbp7tcVxbE4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=m4TQS5yO01Z3ahaA5fbEQ7xdukcDWgYmIGePu94GJM4FDM6THeHy59tlN1Z6K7TbTTVDU6eX2mi27J2koN11PcNsmaRG6Wdp7an2rKnDodQibDbDBuXCvFomGUlqZZY1T43uoC4IPKcWs9HgYDdGfiQx+OP4ZBuNQeWBNVNjPHg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dJaGgKwE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dJaGgKwE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BBEEC116B1; Fri, 5 Jul 2024 23:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720221054; bh=xS7VcBK27sfR8bV43BCjPhUhK+xwxmamXbp7tcVxbE4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dJaGgKwEv7m9AUO5+9/KlAbm+lSmetXgHFTo3EP3/UOrcNyr6HtuZZtqZ0KcQOXDg Si49IU7A0exScQD2PHzAuQ5Enkok09M2c4pSafl5l9Q2vondxxxLfuw6aImzYHgZ+r 6CINML8fU7DzMYPip4qb6QZmFnIlUetu+1QSS5LuhmSlCoGuCPQ2eJNrIR26t7njwU xO2V/b/GkP/OJLwtvDRtwJPXjyMm8nVfb8Wn/5Cs3VQZZ16NnPtwuPvU8pB5ngSKA4 1tGSv/snfiH/GChZ4GzQRFbgtpEInUPh5PXB+/fGzuTpJeKCLtzjg7rZBVHPRWrm/1 oPrgSW+vWW0bQ== Date: Fri, 5 Jul 2024 16:10:54 -0700 From: Kees Cook To: Peter Zijlstra Cc: Andrii Nakryiko , Jiri Olsa , Oleg Nesterov , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , bpf@vger.kernel.org, Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Steven Rostedt , Masami Hiramatsu , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCHv2 bpf-next 1/9] uprobe: Add support for session consumer Message-ID: <202407051604.377EA59@keescook> References: <20240701164115.723677-1-jolsa@kernel.org> <20240701164115.723677-2-jolsa@kernel.org> <20240703081042.GM11386@noisy.programming.kicks-ass.net> <202407031330.F9016C60B@keescook> <20240705071036.GW11386@noisy.programming.kicks-ass.net> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240705071036.GW11386@noisy.programming.kicks-ass.net> On Fri, Jul 05, 2024 at 09:10:36AM +0200, Peter Zijlstra wrote: > On Wed, Jul 03, 2024 at 01:36:19PM -0700, Kees Cook wrote: > > > Yes, please use struct_size_t(). This is exactly what it was designed for. > > Kees, please, just let up, not going to happen. I'm getting really fed > up having to endlessly repeat what a piece of shite struct_size() is. I mean, okay, but the wrapper in the patch is basically the same thing. *shrug* > Put your time and effort into doing a proper language extension so we > can go and delete all that __builtin_*_overflow() based garbage. We are! That's in the future. Today, we have a saturating wrapper that provides type checking for the calculation's operands, and is in common use through-out the kernel. These are all things that the open-coded does not provide, so I continue to see it as an improvement over what else is available right now. I got asked for my opinion about whether to use struct_size() or not. In my opinion, this is a good place for it. I know you don't agree with me, but that wasn't the question. :) -Kees -- Kees Cook