From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (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 E44C81EE7C6 for ; Wed, 11 Mar 2026 16:01:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773244892; cv=none; b=WeZqBoEsoZg0W/1fPVLEYRMt71ypl+STyNjJcpdDkjeGY7Jhb5xVKPuXXRIPqMBKmiRCzY33PYYeDYkpi8PF9/vUJt17p9GMD0MhMPF7NZRLy+u4F9CY7IuMCP+eEh3EOmYEtnX3yFHoLVOP1cb0vcrGL/8epPoYWzy4pVFybaM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773244892; c=relaxed/simple; bh=dAGZ9QDB/AHQYbwzsn1M1UQyB+pSq+QxswCJaxDDu24=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=sxgyXXI572VeZkIWDRge65G0UrrE3VoQXVNbM/QaT7GbaDSnjm9F/wzaTHO0hCUTzJprfGBE4N8rhfrSDjolQESxnBdm7BNezki+8apRYKKOuAQDF7HRCBrzyqKKgUOOSakj+zp9AZimQHap7sY0yBU7CWey9a3H41l598rDkt4= 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=T7eoa007; arc=none smtp.client-ip=91.218.175.182 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="T7eoa007" Message-ID: <8a3c7f14-b3d1-4208-acbd-76e5db6c5320@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1773244877; 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=oNLVd2r8mGNBLCXONY/Iw3RP+/fVmudHh8AMMFKtpgg=; b=T7eoa007BVw9qMjpjq/4/VBG87w4s7+0T8oqqgUYtqzr42Q8zRLZrQFJMdRPGrA0mrxij5 W3DVTQp89FUCmPsJAqcYTcubh9bLsrWUDTBCOaPy9tCsAVspeipcyKCG7KJSsD6OYJxRPb spLeEXgijisarBZtiXgC+0kGwalFLgM= Date: Thu, 12 Mar 2026 00:00:46 +0800 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v3 3/6] bpf: Disallow !kprobe_write_ctx progs tail-calling kprobe_write_ctx progs To: Alexei Starovoitov , Kumar Kartikeya Dwivedi Cc: bot+bpf-ci@kernel.org, bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , Feng Yang , Menglong Dong , Puranjay Mohan , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Pu Lehui , LKML , "open list:KERNEL SELFTEST FRAMEWORK" , Network Development , kernel-patches-bot@fb.com, Martin KaFai Lau , Chris Mason , Ihor Solodrai References: <20260303150639.85007-4-leon.hwang@linux.dev> <47fbcb9aa941b07054bfef30b802d488688fafdf6df889e78b38313a614b98c1@mail.kernel.org> <94cfdbdc-833a-4838-af84-e0989e988418@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Leon Hwang In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 2026/3/11 23:44, Alexei Starovoitov wrote: > On Wed, Mar 11, 2026 at 2:22 AM Kumar Kartikeya Dwivedi > wrote: >> [...] >> >> I agree but the main question is whether such a case is realistic, are >> we going to have write_ctx programs tail calling this way? >> Tail calls are already pretty rare, thinking more about it extension >> programs are probably also broken wrt checks in this set. >> bpf_check_attach_target is doing none of these things for >> prog_extension = true. Nobody reported a problem, so I doubt anyone is >> hitting this. >> It probably also needs to be fixed. >> Since you noticed it, we should close the gap conservatively for now, >> and wait for a real use case to pop up before enabling this one-way. > > +1 > tail_calls in general hopefully will be deprecated soon. > As soon as we have support for indirect calls there won't be any reason > for tail calls to exist. (other than not breaking current users). > We definitely don't want to open it up further. > So the simplest fix. Got it. Will follow the both-ways check approach in the next revision. Will apply the conservative check to extension programs using another patch series, after verifying the potential issues for them. Thanks, Leon