public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arch@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: posix message queues
Date: Thu, 08 Apr 2004 16:08:10 +0200	[thread overview]
Message-ID: <40755CCA.8030507@colorfullife.com> (raw)
In-Reply-To: <200404081017.46132.arnd@arndb.de>

Arnd Bergmann wrote:

>What worries me more than mq_attr compatibility is the conversion
>of struct sigevent, which might turn out really hard when more
>fields in there are used.
>
What is the problem for the wrappers with sigevent?

>+
>+static int get_compat_sigevent(struct sigevent *event,
>+		const struct compat_sigevent __user *u_event)
>+{
>+	if (verify_area(VERIFY_READ, u_event, sizeof(*u_event)))
>+		return -EFAULT;
>+
>+	return __get_user(event->sigev_value.sival_int,
>+			  &u_event->sigev_value.sival_int)
>+	     | __get_user(event->sigev_signo, &u_event->sigev_signo)
>+	     | __get_user(event->sigev_notify, &u_event->sigev_notify)
>+	     | __get_user(event->sigev_notify_thread_id,
>+			  &u_event->sigev_notify_thread_id);
>+}
>+
>
The dangerous case for the wrappers is mq_notify for SIGEV_THREAD: The 
kernel will read (with copy_from_user()) from the pointer 
u_event->sigev_value.sival_ptr. Fixed 32-byte buffer. The data is opaque 
- the kernel copies it back to the same process without any 
interpretation. Would that work on all archs?

--
    Manfred

  parent reply	other threads:[~2004-04-08 14:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-07 19:07 posix message queues Andrew Morton
2004-04-07 19:15 ` Manfred Spraul
2004-04-08  8:17   ` Arnd Bergmann
2004-04-08  8:49     ` Andrew Morton
2004-04-08 14:08     ` Manfred Spraul [this message]
2004-04-08 20:24     ` Andrew Morton
2004-04-09 23:45   ` David S. Miller
2004-04-10 11:19     ` Manfred Spraul
2004-04-10 11:53       ` Manfred Spraul
2004-04-10 20:43         ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2004-04-08 22:22 Arnd Bergmann

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=40755CCA.8030507@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=akpm@osdl.org \
    --cc=arnd@arndb.de \
    --cc=linux-arch@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