From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) (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 050D32DC765 for ; Sat, 18 Apr 2026 21:33:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776548026; cv=none; b=YRoQSKVE/63ZwF2lthrdaz4mH9zADxZ97HTTmqJLO0MwiIdOo//AoUsJ1UrqIQ8yqci4YIwE/0NmdJd5QUdV+gdcc35kDhvYVdTsleLeXuSZoMXVOaUMIOjGolcr75+vgjd8ptw1D1UiyMDN59dZOpcH+gn7x8ikLJ1UCi8H2/o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776548026; c=relaxed/simple; bh=jTyvOXOCiYvzFnNNvh3qlkrm9hMic4NNsp2eVgQ57JY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kd7FAeAyCfOGODef+OmBgR/boqS2rqh6d3GdO86D99cpu+lN2bHEWGPPj1m8Hw6iNBpa/7UVzaS3iZoZBNrGpL44jsioVyxVgtBwcVPNLMQVFpJmrQrkBjh75YtS38iL4iW18l2q7xMn1Zb4P5IqihwkG7MnazGgerGf32zFBAQ= 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=ErQGw9aO; arc=none smtp.client-ip=91.218.175.189 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="ErQGw9aO" Message-ID: <894455f6-eb66-4625-879b-a20c6c23acef@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1776548021; 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=D4X4SIOVC+VXLJ7Iz/lQN35olmgueb4Sia9NnFavWMc=; b=ErQGw9aOlDGdJCW967n6heS2EKWe1aDT6d0HODK2MYfp4VTNZa3d3Ks0sxB6jiYh3rWFcv FJXGkEcsZ70RlDF/pK57g0QYITbArlAzIosci2cboDw36uDmjlvIMRXBiESEL1YC4KkjZ0 XQEcbHjZt7HX394ehoMwGoGhpKNQB08= Date: Sat, 18 Apr 2026 22:33:37 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH] bpf: crypto: reject unterminated type and algorithm names To: Pengpeng Hou , Alexei Starovoitov Cc: Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20260417073128.91029-1-pengpeng@iscas.ac.cn> 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: <20260417073128.91029-1-pengpeng@iscas.ac.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 17.04.2026 08:31, Pengpeng Hou wrote: > bpf_crypto_ctx_create() validates the overall size of > struct bpf_crypto_params, but it does not verify that the fixed-width > type[14] and algo[128] fields are NUL-terminated before passing them to > string consumers. > > A caller can therefore fill either field without a terminator and cause > bpf_crypto_get_type(), has_algo(), or alloc_tfm() to read past the end > of the fixed buffer. How can this happen for static defined type/algo structures?