From: Al Viro <viro@ZenIV.linux.org.uk>
To: Corey Minyard <minyard@acm.org>
Cc: linux-kernel@vger.kernel.org
Subject: [RFC] COMPAT_IPMICTL_RECEIVE_MSG semantics
Date: Mon, 26 Jun 2017 21:21:02 +0100 [thread overview]
Message-ID: <20170626202102.GB10672@ZenIV.linux.org.uk> (raw)
There's something odd about IPMICTL_RECEIVE_MSG and
its compat counterpart. The former checks if copying
struct ipmi_recv back to userland succeeds and put the
message back into queue on failure. The latter does not;
it copies native structure to userland stack and then
(after having freed msg) copies it back to kernel, converts
to 32bit analogue and copies _that_ to userland.
To trigger that just use it with ipmi_recv sitting
in read-only mapping; native ioctl will fail with EFAULT
and requeue the message, compat one will fail with EFAULT
and discard the sucker.
Do we really care in either case? If not, it would
be easier to leave copyout to after freeing msg and if it
fails, so be it. Compat would avoid all the dances with
copying in, copying native out, copying it back in, copying
32bit out, stack allocations, etc.
If we do, we need to do conversion and final copyout
before freeing msg. Also not hard to do. Either way, the
current variant is inconsistent. Which way would you prefer
it to go?
reply other threads:[~2017-06-26 20:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20170626202102.GB10672@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=minyard@acm.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