From: Al Viro <viro@zeniv.linux.org.uk>
To: Rohit <rsingh.ind.1272@gmail.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: Missing Null Pointer check in seq_open
Date: Thu, 9 Apr 2026 10:14:36 +0100 [thread overview]
Message-ID: <20260409091436.GO3836593@ZenIV> (raw)
In-Reply-To: <CAD+278XmGAdCDL46vxhTuVLoVE4uSNXTz0LGSivjctyUDhWZMA@mail.gmail.com>
On Thu, Mar 05, 2026 at 03:27:08PM +0530, Rohit wrote:
> Hi,
>
> I would like to report a missing NULL pointer check in the fs/seq_file.c APIs.
>
> The seq_open(struct file *file, const struct seq_operations *op) function
> does not check whether the second argument is NULL or not.
>
> Other functions, such as seq_read_iter(), directly dereference seq_operations
> pointers, possibly resulting in a kernel NULL pointer dereference.
It also does not verify that argument is not (void *)0x6969696969696969
and passing that would lead to massive clusterfuck in aforementioned
seq_read_iter(). Your point being...?
Should we check that caller is not passing BS values to arguments to functions
and if we should, where do we stop?
Why is NULL any different from e.g. ERR_PTR(-ENOMEM) in that respect? Or from
any random invalid value, for that matter?
prev parent reply other threads:[~2026-04-09 9:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 9:57 Missing Null Pointer check in seq_open Rohit
2026-04-09 9:14 ` Al Viro [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=20260409091436.GO3836593@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=rsingh.ind.1272@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox