All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "zhangchujun" <zhangchujun@cmss.chinamobile.com>, <bpf@vger.kernel.org>
Cc: <daniel@iogearbox.net>, <andrii@kernel.org>
Subject: Re: [PATCH] samples/bpf: hbm: check the return value of fopen()
Date: Wed, 04 Nov 2026 04:15:23 +0000	[thread overview]
Message-ID: <DMM4VPCRUGPX.2NW9IS2F4A3FX@gmail.com> (raw)
In-Reply-To: <20261104035317.1133-1-zhangchujun@cmss.chinamobile.com>

On Tue, Nov 03, 2026 at 07:53 PM zhangchujun <zhangchujun@cmss.chinamobile.com> wrote:
> run_bpf_prog() passes the FILE pointer returned by fopen() directly
> to fscanf() without checking it for NULL.  When the file cannot be
> opened (e.g. the network interface is not named eth0), fscanf()
> dereferences NULL and the program crashes.

samples/bpf/ are dead.
'hbm -w' works with eth0 only. Usage() says so.
Without eth0 it fails with and without this patch.
I don't think we need this patch.

pw-bot: cr

      reply	other threads:[~2026-11-04  4:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  3:53 [PATCH] samples/bpf: hbm: check the return value of fopen() zhangchujun
2026-11-04  4:15 ` Alexei Starovoitov [this message]

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=DMM4VPCRUGPX.2NW9IS2F4A3FX@gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=zhangchujun@cmss.chinamobile.com \
    /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.