From: Walter Harms <wharms@bfs.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Tigran A. Aivazian" <aivazian.tigran@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>
Subject: AW: [PATCH] bfs: prevent underflow in bfs_find_entry()
Date: Tue, 10 Mar 2020 17:57:18 +0000 [thread overview]
Message-ID: <fabccce3c25444bbb5aa51f8c08e9865@bfs.de> (raw)
In-Reply-To: <20200310090644.GA11583@kadam>
________________________________________
Von: Dan Carpenter <dan.carpenter@oracle.com>
Gesendet: Dienstag, 10. März 2020 10:06
An: Walter Harms
Cc: Tigran A. Aivazian; linux-kernel@vger.kernel.org; kernel-janitors@vger.kernel.org
Betreff: Re: [PATCH] bfs: prevent underflow in bfs_find_entry()
On Mon, Mar 09, 2020 at 08:40:28AM +0000, Walter Harms wrote:
> hi Dan,
> the namelen usage is fishy. It goes into bfs_namecmp()
> where it is checked for namelen < BFS_NAMELEN, leaving
> only the case ==.
The rule in bfs_namecmp() is that the name has to be NUL terminated if
there is enough space.
that raises the question why is there a len paramter in the first place.
Surely the writer can make sure that there is always a NUL terminated
string, then it would be possible the use a simple strcmp() and the
range check is useless and can be removed.
seems a question for the maintainer.
re,
wh
next prev parent reply other threads:[~2020-03-10 17:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-07 6:08 Dan Carpenter
2020-03-09 8:40 ` AW: " Walter Harms
2020-03-10 9:06 ` Dan Carpenter
2020-03-10 17:57 ` Walter Harms [this message]
2020-03-10 18:22 ` Tigran Aivazian
2020-03-09 9:14 ` Tigran Aivazian
2020-03-10 8:38 ` Dan Carpenter
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=fabccce3c25444bbb5aa51f8c08e9865@bfs.de \
--to=wharms@bfs.de \
--cc=aivazian.tigran@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome