From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (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 BEC973537EF for ; Wed, 4 Mar 2026 06:17:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772605079; cv=none; b=Q8N6pW+ZKLmfAHOsg5SZzlhRW3PXSWLYyXxjP+S+X1FA0Znn0Er11bIfjhdpPC6k0kf+R2kp6IQlQ+bmdmjmtRCjcH1QXe29fIkcuG1LqDMNL0cyz6/3FIjMZkDCwn/yNTymuJCBSdcsAmKQH6pLm6JDokLjpbBkPLxgDh2Xsrc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772605079; c=relaxed/simple; bh=A4Xtcv5kM6K6vci3wtfbZ4vMYs3E/kbIxMZAcCaxwlg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nwUj+UBcsczHWQadRFqbci50nkDUFf+02hfP8W2NI59Od4TLboNMa9HdwIc7JtsLBViMC5Oa+zvKaxWta56mEyuc3cDh02NvwOXtSwKISg8xhOgpO3JTKHjaDm327Rq7bZngPLGeoKgSFbPGPFxFae0Y6C2wH9FnM/vFkoNQvIg= 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=G1ztogz3; arc=none smtp.client-ip=91.218.175.181 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="G1ztogz3" Message-ID: <91bad178-9cbe-42db-a91c-01bacfdf9653@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1772605065; 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=NmtNQLaw6mVn27gnuT4O9OA3tJ6/3X+wThoJDlyqgko=; b=G1ztogz35lYYrJLq86l9llfZAbHF6iIW2G4izdPZJuehYTp5KTQgG4mTbpq4DP3wpm5CRQ FKD6kLAjS8MpqLVjIrB+jlcQW2lAGlUllBiqhIYcQiqVJuhFYqhet5zzbNh4Q5P04UtFgK Y90PUMwiprF1rhvLdvu8IfC0HVgdeLo= Date: Wed, 4 Mar 2026 14:17:31 +0800 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 v10 3/8] bpf: Refactor reporting log_true_size for prog_load Content-Language: en-US To: Alexei Starovoitov Cc: bpf , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , Christian Brauner , Seth Forshee , Yuichiro Tsuji , Andrey Albershteyn , Willem de Bruijn , Jason Xing , Tao Chen , Mykyta Yatsenko , Kumar Kartikeya Dwivedi , Anton Protopopov , Amery Hung , Rong Tao , LKML , Linux API , "open list:KERNEL SELFTEST FRAMEWORK" , kernel-patches-bot@fb.com References: <20260211151115.78013-1-leon.hwang@linux.dev> <20260211151115.78013-4-leon.hwang@linux.dev> 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 4/3/26 13:58, Alexei Starovoitov wrote: > On Tue, Mar 3, 2026 at 9:47 PM Leon Hwang wrote: >> >> On 4/3/26 00:32, Alexei Starovoitov wrote: >>> On Wed, Feb 11, 2026 at 7:13 AM Leon Hwang wrote: >>>> >> >> [...] >> >>>> @@ -6241,7 +6244,11 @@ static int __sys_bpf(enum bpf_cmd cmd, bpfptr_t uattr, unsigned int size, >>>> err = map_freeze(&attr); >>>> break; >>>> case BPF_PROG_LOAD: >>>> - err = bpf_prog_load(&attr, uattr, size); >>>> + if (from_user && size >= offsetofend(union bpf_attr, log_true_size)) >>>> + log_true_size = uattr.user + offsetof(union bpf_attr, log_true_size); >>> >>> So you added 'from_user' gating because >>> you replaced copy_to_bpfptr_offset() with copy_to_user()? >>> This is a drastic change in behavior and you don't even talk about >>> it in the commit log. >>> You said "refactor". This is not a refactoring! >>> >>> This is v10. The common_attr feature is useful, but >>> you really need to think harder about what your patches >>> are doing. >>> >> >> Refactoring should not introduce any functional changes. If a functional >> change is involved, it should be factored out of the refactoring commit >> into a separate commit with an explanation in the commit log. >> >> I'll add this to my self-review checklist. >> >> The intention of 'from_user' was to replace copy_to_bpfptr_offset() with >> copy_to_user(), since the log is always copied to the user-space buffer >> when the log level is not BPF_LOG_KERNEL in >> kernel/bpf/log.c::bpf_verifier_vlog(). >> >> The 'from_user' gating will be dropped in v12 to keep this patch as pure >> refactoring. > > You were told multiple times to avoid copy pasting AI into your emails. > Sorry, but this crosses the line for me. > Your patches will be ignored for 2 weeks. Oops. The above reply was written by my hand. Possibly, the reply carried LLM smell because I learnt LLM tongue recently. As you said, I won't send patches for 2 weeks. :-( Thanks, Leon