All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd.bergmann@de.ibm.com>
To: Kyle McMartin <kyle@parisc-linux.org>
Cc: akpm@osdl.org, linux-arch@vger.kernel.org
Subject: Re: Generic compat_sys_rt_sigqueueinfo
Date: Sun, 29 Oct 2006 01:09:08 +0200	[thread overview]
Message-ID: <200610290109.08844.arnd.bergmann@de.ibm.com> (raw)
In-Reply-To: <20061028223730.GC3243@athena.road.mcmartin.ca>

On Sunday 29 October 2006 00:37, Kyle McMartin wrote:
> +asmlinkage long compat_sys_rt_sigqueueinfo(int pid, int sig,
> +       struct compat_siginfo __user *uinfo)
> +{
> +       mm_segment_t old_fs = get_fs();
> +       siginfo_t info;
> +       int ret;
> +
> +       if (copy_siginfo_from_user32(&info, uinfo))
> +               return -EFAULT;
> +
> +       set_fs(KERNEL_DS);
> +       ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *)&info);
> +       set_fs(old_fs);
> +
> +       return ret;
> +}

Since sys_rt_sigqueueinfo() is so simple, I think it would be much
better to define the common version as 

asmlinkage long
sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo)
{
	siginfo_t info;

	if (compat_copy_siginfo_from_user(&info, uinfo))
		return -EFAULT;

	/* Not even root can pretend to send signals from the kernel.
	   Nor can they impersonate a kill(), which adds source info.  */
	if (info.si_code >= 0)
		return -EPERM;
	info.si_signo = sig;

	/* POSIX.1b doesn't mention process groups.  */
	return kill_proc_info(sig, &info, pid);
}

	Arnd <><

  parent reply	other threads:[~2006-10-28 23:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-28 22:37 Generic compat_sys_rt_sigqueueinfo Kyle McMartin
2006-10-28 22:47 ` Matthew Wilcox
2006-10-28 22:53   ` Kyle McMartin
2006-10-28 23:09     ` Matthew Wilcox
2006-10-28 23:09 ` Arnd Bergmann [this message]
2006-10-28 23:12   ` Arnd Bergmann
2006-10-30 15:46   ` Kyle McMartin
2006-10-30 15:59 ` Kyle McMartin
2006-10-31  7:02   ` Andrew Morton
2006-11-01  7:23     ` Stephen Rothwell
2006-11-01 14:24       ` Kyle McMartin

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=200610290109.08844.arnd.bergmann@de.ibm.com \
    --to=arnd.bergmann@de.ibm.com \
    --cc=akpm@osdl.org \
    --cc=kyle@parisc-linux.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.