From: Rich Felker <dalias@libc.org>
To: "zhuyan (M)" <zhuyan34@huawei.com>
Cc: "musl@lists.openwall.com" <musl@lists.openwall.com>,
Zengweilin <zengweilin@huawei.com>,
"liucheng (G)" <liucheng32@huawei.com>,
"chenzefeng (A)" <chenzefeng2@huawei.com>
Subject: Re: [musl] [PATCH] fix segfault in recvmsg when msg argument is NULL
Date: Tue, 26 Jan 2021 12:41:36 -0500 [thread overview]
Message-ID: <20210126174136.GC23432@brightrain.aerifal.cx> (raw)
In-Reply-To: <20210126024422.GZ23432@brightrain.aerifal.cx>
On Mon, Jan 25, 2021 at 09:44:25PM -0500, Rich Felker wrote:
> On Tue, Jan 12, 2021 at 07:58:26AM +0000, zhuyan (M) wrote:
> >
> > When msg is NULL, msg->msg_controllen exists to dereference a null pointer in recvmsg.
>
> "The recvmsg() function takes the following arguments:
> ...
> message
> Points to a msghdr structure, ..."
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It was pointed out to me on IRC that there is an "if (msg) condition
later (only on 64-bit archs), which makes this at least inconsistent.
So some cleanup is probably called for.
Also, the patch was incorrect even if you want to avoid crashing. It
returns a negated error code rather than setting errno and returning
-1.
Rich
next prev parent reply other threads:[~2021-01-26 17:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210112075724.58561-1-zhuyan34@huawei.com>
2021-01-12 7:58 ` zhuyan (M)
2021-01-26 2:44 ` Rich Felker
2021-01-26 17:41 ` Rich Felker [this message]
2021-01-26 2:32 ` zhuyan (M)
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=20210126174136.GC23432@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=chenzefeng2@huawei.com \
--cc=liucheng32@huawei.com \
--cc=musl@lists.openwall.com \
--cc=zengweilin@huawei.com \
--cc=zhuyan34@huawei.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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).