All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v4 01/16] bpf: Add verifier diagnostics report helpers
Date: Wed, 12 Aug 2026 23:41:46 +0000	[thread overview]
Message-ID: <20260812234147.02D6E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812233326.3575958-2-memxor@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The patch completely fails to implement the prose wrapping and reusable report sections promised in the commit message.
- [Low] Diagnostic category string macros are defined in the .c file instead of the header, making them inaccessible to callers.
--

--- Patch [1]: [PATCH bpf-next v4 01/16] bpf: Add verifier diagnostics report helpers ---
commit 2d39aa0d2b938aedc24539fb306c5c0aabb08c25
Author: Kumar Kartikeya Dwivedi <memxor@gmail.com>

bpf: Add verifier diagnostics report helpers

This patch adds a small diagnostics renderer for verifier reports and wires it
into the BPF build. It includes helpers to emit a failure header and aims to
provide reusable report sections.

> Wrap report prose at 100 columns so Reason and Suggestion text stays
> readable without changing source or instruction gutters.

[Severity: Medium]
Is this description accurate for the current implementation? Looking at the
code for bpf_diag_header() and diag_write() added in this patch, there does
not appear to be any text wrapping logic or implementation for reusable
report sections like Reason and Suggestion. Was this logic accidentally
omitted from this patch?

> diff --git a/kernel/bpf/diagnostics.c b/kernel/bpf/diagnostics.c
> new file mode 100644
> --- /dev/null
> +++ b/kernel/bpf/diagnostics.c
> @@ -0,0 +1,55 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +// Copyright (c) 2026 Meta Platforms, Inc. and affiliates.
> +
> +#include <linux/bpf_verifier.h>
> +#include <linux/ctype.h>
> +#include <linux/stdarg.h>
> +
> +#include "diagnostics.h"
> +
> +#define MEMORY_SAFETY "Memory Safety"
> +#define REGISTER_TYPE_SAFETY "Register Type Safety"
> +#define CALL_TYPE_SAFETY "Call Type Safety"
> +#define RESOURCE_LIFETIME_SAFETY "Resource Lifetime Safety"
> +#define EXECUTION_CONTEXT_SAFETY "Execution Context Safety"
> +#define PROGRAM_STRUCTURE "Program Structure"
> +#define POLICY "Policy"
> +#define VERIFIER_LIMIT "Verifier Limit"

[Severity: Low]
Should these category string macros be defined in diagnostics.h instead of
here in the source file? Since they are not used within diagnostics.c and
are not exported in the header file, other files in the verifier will not be
able to use them as standardized arguments when calling bpf_diag_header().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260812233326.3575958-1-memxor@gmail.com?part=1

  reply	other threads:[~2026-08-12 23:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 23:33 [PATCH bpf-next v4 00/16] Redesign Verification Errors Kumar Kartikeya Dwivedi
2026-08-12 23:33 ` [PATCH bpf-next v4 01/16] bpf: Add verifier diagnostics report helpers Kumar Kartikeya Dwivedi
2026-08-12 23:41   ` sashiko-bot [this message]
2026-08-12 23:33 ` [PATCH bpf-next v4 02/16] bpf: Add source and instruction diagnostic context Kumar Kartikeya Dwivedi
2026-08-13  0:15   ` sashiko-bot
2026-08-12 23:33 ` [PATCH bpf-next v4 03/16] bpf: Add verifier diagnostic event log Kumar Kartikeya Dwivedi
2026-08-12 23:33 ` [PATCH bpf-next v4 04/16] bpf: Prune verifier diagnostics when switching paths Kumar Kartikeya Dwivedi
2026-08-12 23:33 ` [PATCH bpf-next v4 05/16] bpf: Track verifier register diagnostic events Kumar Kartikeya Dwivedi
2026-08-12 23:53   ` sashiko-bot
2026-08-12 23:33 ` [PATCH bpf-next v4 06/16] bpf: Track verifier reference " Kumar Kartikeya Dwivedi
2026-08-12 23:33 ` [PATCH bpf-next v4 07/16] bpf: Track verifier context " Kumar Kartikeya Dwivedi
2026-08-12 23:33 ` [PATCH bpf-next v4 08/16] bpf: Report Register Type Safety errors Kumar Kartikeya Dwivedi
2026-08-12 23:33 ` [PATCH bpf-next v4 09/16] bpf: Report Memory Safety bounds errors Kumar Kartikeya Dwivedi
2026-08-12 23:33 ` [PATCH bpf-next v4 10/16] bpf: Report Resource Lifetime reference leaks Kumar Kartikeya Dwivedi
2026-08-12 23:33 ` [PATCH bpf-next v4 11/16] bpf: Report Call Type Safety argument errors Kumar Kartikeya Dwivedi
2026-08-12 23:58   ` sashiko-bot
2026-08-12 23:33 ` [PATCH bpf-next v4 12/16] bpf: Report Execution Context Safety errors Kumar Kartikeya Dwivedi
2026-08-12 23:33 ` [PATCH bpf-next v4 13/16] bpf: Report Program Structure CFG errors Kumar Kartikeya Dwivedi
2026-08-12 23:33 ` [PATCH bpf-next v4 14/16] bpf: Report Policy helper and kfunc errors Kumar Kartikeya Dwivedi
2026-08-12 23:33 ` [PATCH bpf-next v4 15/16] bpf: Report Verifier Limit errors Kumar Kartikeya Dwivedi
2026-08-12 23:33 ` [PATCH bpf-next v4 16/16] bpf: Gate verifier diagnostics on log level Kumar Kartikeya Dwivedi
2026-08-13  1:38 ` [PATCH bpf-next v4 00/16] Redesign Verification Errors Eduard Zingerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260812234147.02D6E1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=memxor@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.