From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 076ED3630AC for ; Mon, 13 Jul 2026 22:09:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783980591; cv=none; b=W7a9Zm3qY67Pf9ok/rgvmTYkG1k81pCN5YY5Z2l4fIXHsTc5TMIYHfUN4bNMnxt/2snq8w9eS5sZcbJ7qUUPsWxKp3XveE1KKsryYK+6SqzdU6eNOS49znqj0OfaLwAF00rl6OWIbseKqFWdIvSm/begMhVS8mLYyZ/p/+7ucig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783980591; c=relaxed/simple; bh=gsD/yMciq6j/2dAEmngjHdGj+1UyGMFNx2TIoF99TTk=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=KlaRa0um3FUoQWdqzpzKzyn3qtpy/05G634R2hzt2qXMFPu6r/TYbOmZzbcIIBX7ztClFKj+IwdSetTo3z9HVpSBN8Rxtpz9ag4uVtiV68lvdKELAY1SPFiQYPd7+IBv2k9pDOlyD9+IM4kn4ET/pe0efWt2+cx4ha5n1juUCLA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=rxBWUgdM; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rxBWUgdM" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2cac59f8b64so40032085ad.0 for ; Mon, 13 Jul 2026 15:09:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783980589; x=1784585389; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:from:to :cc:subject:date:message-id:reply-to:content-type; bh=gsD/yMciq6j/2dAEmngjHdGj+1UyGMFNx2TIoF99TTk=; b=rxBWUgdMaN0/ptGAotpKubxqPXVD+8DAJzCx4DH2eA2ud1tu8Ig1MZjQuLVeM3Zopo My+xfKnsBtEzAbBEQibVen3Z9l1BdxrQn+tHhYQov1yCSmrqp2iX9eJlT1RS8EWVRAfp Vw0BXb+Vdz0f3tCbLeH2qcgULUw15SGhtBbo0bAYJN0oVH598Dzdxzl5ne46YkhPr+GQ uydlLjTC4FHp2+l58UchcWstBzX6QhUJDPdP3+TAFPyt+bMEb4l1B6t2QgNz/2iSwIIz BkjqFmUD5Oz8FSh8tu2WVHL+Nr22MEBPS7nWkSxJ/UvR8rFWqK/CdsAAzxu7yxtILlBT YxiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783980589; x=1784585389; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=gsD/yMciq6j/2dAEmngjHdGj+1UyGMFNx2TIoF99TTk=; b=aYqKdly0gjINY7HWJYBWHDx726rq3J4tHPSQPUdk0JTUTPQY4jTRDaycsQXcWVYhXA gvplStVwNwnB4eqbqpS8cQPbb8DMHcHDAjhrf7l4pYWTAx2Zaeb16q0hEfbs18EATHdw 4Uk3cew1vDUKTfZlRcFjXaeSrOoBLfL1OOsO6ac6fj9NJ1bwNwJwZIGpUDiyBwQsJkw2 QBV45GcYbrw6LQWuLS4Md3ShXmGJtG8XH72/oC6OdC7ltpLYt94ipGQpvYhXH4Mz+7jH //eFIlulIUQHfF+XpoM5T03QDcz1oy6YdvCZjiHe8NQcD7evlJ44+0AoHPVQuUjsFNeQ sG4Q== X-Forwarded-Encrypted: i=1; AHgh+RpLA6rzsCMIBgHeDRj+zn7gTneznAhOLkcHB3uL/K4BpQSRi0uOIwFRlqHV393CZR8mdh7SAMY553IlgbI=@vger.kernel.org X-Gm-Message-State: AOJu0YyNik1qAGVLAHZ7fAoYP8eYvhv3EzrlerrZOFJiwsuEOT6xBszQ +PpUMvxqaxGM/3iCbEaYttrAxMjKPCpygAawaVGCuHcqzsaMibY+QH1CHe7lPw== X-Gm-Gg: AfdE7ckNmhpU2YLUbMoHazHdw0Dpw8OSTN4v/KIKYlvggaoPLab58FKOfuolrlfmz5c UAPnTmz++/cKd9doeMbAYQxnd3VlAzvWagmF9HtK3U++N6b74kIWoZBxVyMLN8b5Q7bv8GM4Z0O tV2AgwNFTtKqgY39nBRgBEu/jOgXEfj1ke2c3rn+IjUwiDmkv3Z/qWIeDu9xI1RMBHqYIdFJKdc YfNOcjo3/ugcxULEJQdUZ288XZ9n8bHRNxUP/hcv13A1P5uSODlVmjwH3c5vEXsgQanONWw+pW8 4U+hU6u/Wp5w06Mkbltc/MIx2RUYM6on8u2AEak+o1BNu+fQ1ZgP+MjVjK9vKio87pts5LVcbUp NXaH0/kBYT0eiuvJiWXZGlSUpCSdyoTLRa5allGTkpv2oc8mSRkLI55iiL8CzZPTFeGz7L6H1je 0Ol4uyZ2w2oIsufozRaMzWTb4ZMJDHl1OWhO8oAN7Crp2vTBvgYSRdD2ciLx5JNw== X-Received: by 2002:a17:903:19ec:b0:2be:3850:297e with SMTP id d9443c01a7336-2ce9f052d20mr101568855ad.31.1783980589319; Mon, 13 Jul 2026 15:09:49 -0700 (PDT) Received: from [192.168.0.13] ([38.34.87.7]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ccc9d59e33sm103432975ad.74.2026.07.13.15.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 15:09:48 -0700 (PDT) Message-ID: <3e15d4b9ce4e24e94e0a95d3785fcc0c90448c10.camel@gmail.com> Subject: Re: [PATCH bpf-next 1/2] bpf: Reject callback subprogs invoke tailcall From: Eduard Zingerman To: Pu Lehui , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, =?ISO-8859-1?Q?Bj=F6rn_T=F6pel?= , Daniel Borkmann Cc: Alexei Starovoitov , Andrii Nakryiko , Kumar Kartikeya Dwivedi , Yonghong Song , Martin KaFai Lau , John Fastabend , Song Liu , Jiri Olsa , Emil Tsalapatis , Pu Lehui Date: Mon, 13 Jul 2026 15:09:45 -0700 In-Reply-To: <20260711104727.4023420-2-pulehui@huaweicloud.com> References: <20260711104727.4023420-1-pulehui@huaweicloud.com> <20260711104727.4023420-2-pulehui@huaweicloud.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2-10 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Sat, 2026-07-11 at 10:47 +0000, Pu Lehui wrote: > From: Pu Lehui >=20 > Some JIT compilers, such as x86_64, rely on a register to pass the TCC. > When subprograms of synchronous callback invoke tailcall, C helpers > invoking bpf callback clobber this register, and the corrupted TCC may > bypass the TCC limit, leading to infinite tailcall. >=20 > Fix this by rejecting tailcall inside all subprogs of sync callback. > This also cleanly consolidates the existing async and exception callback > checks into a single unified `is_cb` check. >=20 > Reported-by: Sashiko > Reported-by: Bj=C3=B6rn T=C3=B6pel > Signed-off-by: Pu Lehui > --- Acked-by: Eduard Zingerman [...]