From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f45.google.com (mail-oa1-f45.google.com [209.85.160.45]) (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 B65C33E2AB6 for ; Wed, 24 Jun 2026 20:59:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782334745; cv=none; b=Ih8cZc+NkpfmXtJCCDFfSmUVhVINGKN/nwGHReXimMKfedYzxVzjh0EHgDwKMj5wccGS2y8Adj/hHHzES1Ro90ok7N3KUgyR1v65uOTpeRSQY4DFyC0z90+nl26urDUoeIytM6aAkOdgJW3qeWjiIr0LLTcz5kSeO4CcHsw1MA0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782334745; c=relaxed/simple; bh=EBkFIJ93p7H/YLvd1bjDixSjBj1WJcUuUZBZooQYb6I=; h=Mime-Version:Content-Type:Date:Message-Id:From:To:Cc:Subject: References:In-Reply-To; b=H0aWgA4AJkRkxf2DIa5JvldVKAxX3GA0dJ5psc5+HFzG+1OagJDVq/3V4RPbnkSxae2ThOM84RKh5p15GLp0N+4edicM50eF9F1zc3wptCmlWsaADSDL+7D71sJjxYCMzkvkYWt2rY3gN/MS+AMqicjXjFlRGWE6lnoinFNb5ZI= 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=nEu8tmHw; arc=none smtp.client-ip=209.85.160.45 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="nEu8tmHw" Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-43d16405b54so740834fac.3 for ; Wed, 24 Jun 2026 13:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782334744; x=1782939544; darn=vger.kernel.org; h=in-reply-to:references:subject:cc:to:from:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=EBkFIJ93p7H/YLvd1bjDixSjBj1WJcUuUZBZooQYb6I=; b=nEu8tmHwx2U1PBAEVk9SSfaKDiWHpWY0GgE6lK42n19VrwT9Yhbx3bqUjkJlvyV6e6 McKV/XKeL5WVIq5rbaObT75GmdM4C+cuolkcEXQ6+pQJ80+ClZws1fyHkABkBo3Q7koP T4SQPvwKcW994KV3TwAQ7YlE+RUvL6z39EHjoA6DAtHh699CI+v6Bh0UhuAaQ4TWmoyi A12Fxepo3h5RNXzCp7lkr8rUQ9ydZarT/GpW567cP9s5Gd2awsVxDRpI5OYwzvsFx7nu z3eeYl4KzvslZetxr0dhx5ixvHwhXBwLTVz/xANyimNjvKc96mpbS1Mykys45X1RtbG+ KUpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782334744; x=1782939544; h=in-reply-to:references:subject:cc:to:from:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=EBkFIJ93p7H/YLvd1bjDixSjBj1WJcUuUZBZooQYb6I=; b=GkL29SxuHoVaw0fGPhT1HhxkzVOL7VOlOzaWzJ28VnF8tredgpskSJbWaVRL3o+RAg fYQKgvwJkTs6SkmS3F09uOLypdB4ZWi1coy6CkHoIOw6g/tmGYtXFGVrAn/eP2FwOT6C iC6QfioZfhjxgMVeNWSpuR2f7Cbb42T604GrtPLWdER4FLkds5Rv2qCdhXCLBMzfcn2o 66IhqIqTKR+94TJegPcCEAm38QXil8EOvKpJgBCm7ln5lbH6T+pqkrfRdbyaxZ9oCvcI MPIWBCl4pT+4N2dtvZWDP8/oSicEW0GBL0UxEk6EFlGKn2Uohr1DyNLxABrV7Q82rttc l21w== X-Forwarded-Encrypted: i=1; AFNElJ+TczGpnDrgRo6t+2x+3j6U1jFx3gocrHicWfIVmkBDWaYKM24kJ/GCg+X3sBSI+jj/63sZd4vtM4NtbwE=@vger.kernel.org X-Gm-Message-State: AOJu0Yz8eV/hONF5fRt9vqpbnMfxLIc0TS3DIdBS2ZrZdJglgyC8rrqk P2agXAu7izfAu5JzpJiIOOZ0j5qC16+lvny7W1GsZbQAmVZVLTKpx6zN X-Gm-Gg: AfdE7clEQxCxUBHHeUqv0cpfTAPBjn2ZQHHjMh7+3yR8BFLZNSFhhuDybNOJTxE9KGa 0Hvm/9flGuD23BoLRcnt4dZ8D1NiLwSX8rMDWP3gsnqIxNwvvxlqeqjm2FurbuQlFklokRAxf0N /0J5P30dpANAM90DbYHN7Ul3YXGk7PjS18de3BDdyUkFXZNFidtMxjgbPi58snEXLKbKf7TpkNK 8eHXT/+MRphX02DFewFW5/LyuUupx92zZi9PArtXFoNcNMq8w4bPbXGk72WgQ93x42mvA3Kp9Qj 6bkmQk3UcXZtjW/6T1MvlvvUQ9Te+kM9tlBNTsLZe4oMzoe2iMzoTtb55z/z3bSgT08ckKjxXWj 5W0EHD3NHlJp1OZiJlT98e/s1EVseLUlIjA0V8iAMW2Xud8yxY8EsA0jNDQbWc0nBfEfPLeiNBZ lzydG/hvN4raQBwptKIVdjeBJTN4bVw/9xi/CoT8glTYBMP+uv9N6q/jkibuYfPt2Nbcw1JGLrT yx9hg== X-Received: by 2002:a05:6870:f28c:b0:447:48b6:83c6 with SMTP id 586e51a60fabf-447dce9c2efmr3673260fac.24.1782334743603; Wed, 24 Jun 2026 13:59:03 -0700 (PDT) Received: from localhost ([2a03:2880:10ff:5::]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4472efb37fesm11646096fac.10.2026.06.24.13.59.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Jun 2026 13:59:03 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 24 Jun 2026 13:59:02 -0700 Message-Id: From: "Alexei Starovoitov" To: "Sun Jian" , Cc: , , , , , , , , , , , , , , Subject: Re: [PATCH bpf 1/2] bpf: Preserve link info metadata on ENOSPC X-Mailer: aerc References: <20260624111837.889209-1-sun.jian.kdev@gmail.com> In-Reply-To: <20260624111837.889209-1-sun.jian.kdev@gmail.com> On Wed Jun 24, 2026 at 4:18 AM PDT, Sun Jian wrote: > BPF_OBJ_GET_INFO_BY_FD for bpf_link copies struct bpf_link_info back to > userspace only when ->fill_link_info() succeeds. Some link info providers= , > however, can return -ENOSPC after computing valid metadata when a nested > userspace output buffer is too small. > > For example, perf event tracepoint link info can determine the required > tp_name length before copying the name fails with -ENOSPC. The current > top-level error handling returns immediately in that case, so userspace > observes -ENOSPC but loses the metadata needed to retry with a sufficient= ly > large buffer. > > Allow bpf_link_get_info_by_fd() to copy the top-level bpf_link_info back > on -ENOSPC, while still returning -ENOSPC to userspace. Also let perf > event kprobe, uprobe, and tracepoint link info fill their metadata before > returning -ENOSPC from nested name buffer copying. > > Fixes: f2e10bff16a0 ("bpf: Add support for BPF_OBJ_GET_INFO_BY_FD for bpf= _link") > Fixes: 1b715e1b0ec5 ("bpf: Support ->fill_link_info for perf_event") > Signed-off-by: Sun Jian This one is in "wont-fix" category. Please stop taking AI reports and convert them to pointless patches. Fix only what humans can hit. pw-bot: cr