From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) (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 4E7142D3A71 for ; Tue, 12 Aug 2025 02:20:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754965225; cv=none; b=kSvHF88LtPlrgOE1dzBHHWOEWQdKDe+o2WXXqiXGLi3/IsBZu5XFpiVQuWeFPxfujVRnj/dqB++kckXx4m03/UyqwebCOI+ycz2yGez9zlKc29erI+2Z3PauSsqlGBv4VqjWgssU1TPnM660b3EcM5ynG2hjOKrrIUpBQWfmqTI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754965225; c=relaxed/simple; bh=QvB1rsxL3xgREXQ61kz9noMqaDOXyWbP6sLyZNWrLaM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GS8jz3rob0wkklRYyUoFK2QSE00naan03ezvtkwF+ZADsYc2+F7jtjeW88/U8DC80AOlKrAsTp/tejq4AzxVftmkrZXBNGAJLqNja/3ac4Cy0jtv9cy2J0X3wIswZijWNmsu2uJa17DpcEHFGu6qAvkns60qosHbnzuzpKf7Ta8= 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=o1GhKnz1; arc=none smtp.client-ip=95.215.58.176 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="o1GhKnz1" Message-ID: <6482acb9-d41a-4167-8fd3-82bc6893cbc2@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1754965216; 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=IzdZ6cbqzGjySiI5E/7svKQXRbnU8yiP2iqSu5Y+noM=; b=o1GhKnz1KGbxWNy5WaRECZ84ZUtaunNEStD1dtTLj4M2FJFqGc0/8laLiPtJNFLSkPgBZI cGhpU140ZkD3FJin2lXAenKNbSao3IlHlx5AnqFlYFFEG6kFJKJVDeELGwq3ixB8E7CkX1 IX+cq5WLs9H7hovu7fA/opMKy4eopeo= Date: Mon, 11 Aug 2025 19:20:10 -0700 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next] bpf: Tidy verifier bug message Content-Language: en-GB To: Paul Chaignon , bpf@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko References: X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yonghong Song In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 8/11/25 11:58 AM, Paul Chaignon wrote: > Yonghong noticed that error messages for potential verifier bugs often > have a '(1)' at the end. This is happening because verifier_bug_if(cond, > env, fmt, args...) prints "(" #cond ")\n" as part of the message and > verifier_bug() is defined as: > > #define verifier_bug(env, fmt, args...) verifier_bug_if(1, env, fmt, ##args) > > Hence, verifier_bug() always ends up displaying '(1)'. This small patch > fixes it by having verifier_bug_if conditionally call verifier_bug > instead of the other way around. > > Fixes: 1cb0f56d9618 ("bpf: WARN_ONCE on verifier bugs") > Reported-by: Yonghong Song > Signed-off-by: Paul Chaignon Acked-by: Yonghong Song