From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-171.mta1.migadu.com (out-171.mta1.migadu.com [95.215.58.171]) (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 3F9082F0C71 for ; Tue, 6 Jan 2026 23:12:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767741136; cv=none; b=VzbJHwrY70k4yv5/ji8pFomIJi4oZnreHogUsHZXQpyRxVedCL/fKXeOqN+L7JGuVvyfHKa+T0JvELlZAJklVTSJXgt3oeYkuFKpKGJYy6U3J1TJQhKBZo7G1xJ0Lqfakj1Jwxe7dWKMDHl/q/l5umx/uIEjoLL+u/ONVdnzXP0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767741136; c=relaxed/simple; bh=Olnd6ntWy0T7Fm7UkbaDuXWc5PknhxjePk4OmYP+8uU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hNvh7KlwEFXSdbRreOJ5PAUGS8n6g0Bx0G/Rt7DHSQCsu85lb7yvY6DnLdqSR7djg9cLViddyTW3urtU9b/aaSTgpU/cvO845Mc4a1bJstc1a0NPi3aeB9hJZ5bgsfLqAK/i2+y7PEytkryWlnvMl/dI6K8qsKk9dpjgzkgR8e8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=cgleLD5N; arc=none smtp.client-ip=95.215.58.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="cgleLD5N" Message-ID: <1a7abd3c-5ab4-4d38-a89f-78cb5b6ca14c@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1767741132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aWG7Evt10/KKaS0ZLqsl+z3PfiVaVWRY4OYBns6dWWw=; b=cgleLD5NtZtPaPwxIKp5zL8qCPNm7qYSMnGih0MzcQ+710+7PEaQD9oaL5IXLMtiee/Roa 6WT5/5sW4Tqcvs7HaHQjR+MO0HNuYFpmAK3inu3/0s1WQ8DMxC7b3+vaK0LByevZOFV6Ig Yp4UuOQ2Oxtb4vlNU+Jc8IcXndD+q/M= Date: Tue, 6 Jan 2026 23:11:55 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v4 5/6] bpf: Add ECDSA signature verification kfuncs To: Daniel Hodges , bpf@vger.kernel.org Cc: Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Song Liu , Mykyta Yatsenko , Martin KaFai Lau , Eduard Zingerman , Hao Luo , Jiri Olsa , John Fastabend , KP Singh , Stanislav Fomichev , Yonghong Song , Herbert Xu , "David S . Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20260105173755.22515-1-git@danielhodges.dev> <20260105173755.22515-6-git@danielhodges.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: <20260105173755.22515-6-git@danielhodges.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 05/01/2026 17:37, Daniel Hodges wrote: > Add support for ECDSA signature verification in BPF programs through > the unified bpf_crypto_ctx API. > > Changes: > - Add enum bpf_crypto_type_id for efficient type checking > - Update all crypto type modules to set type_id field > - Implement bpf_ecdsa_verify() for signature verification > - Add bpf_ecdsa_keysize(), bpf_ecdsa_digestsize(), bpf_ecdsa_maxsize() > helper functions for querying context properties > - Add type_id checks in all ECDSA kfuncs for type safety > - Register ECDSA kfuncs for SCHED_CLS and XDP program types > > ECDSA contexts are created using bpf_crypto_ctx_create() with > type="sig" and appropriate algorithm (e.g., "p1363(ecdsa-nist-p256)"). > The public key is passed via the key/key_len fields in bpf_crypto_params. > > This enables BPF programs to perform cryptographic signature verification > for use cases such as packet authentication and content validation. > > Signed-off-by: Daniel Hodges > @@ -57,6 +58,7 @@ struct bpf_crypto_ctx { > refcount_t usage; > }; > > + > int bpf_crypto_register_type(const struct bpf_crypto_type *type) > { > struct bpf_crypto_type_list *node; This chunk is extra empty line - no need for it