[parisc-linux] Re: [PATCH] Compat signal fixes for 64-bit parisc.

Kyle McMartin kyle at mcmartin.ca
Mon Feb 12 19:18:40 MST 2007


On Mon, Feb 12, 2007 at 09:14:28PM -0500, Carlos O'Donell wrote:
> @@ -505,17 +505,15 @@ asmlinkage long compat_sys_rt_sigqueuein
> 	struct compat_siginfo __user *uinfo)
> {
> 	siginfo_t info;
> +	int ret;
> +	mm_segment_t old_fs = get_fs();
> 
> 	if (copy_siginfo_from_user32(&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);
> +	set_fs (KERNEL_DS);
> +	ret = sys_rt_sigqueueinfo(pid, sig, &info);
> +	set_fs (old_fs);
> +	return ret;
> }
> 

Why? We replicate the code in sys_rt_sigqueueinfo here to avoid the nasty
set_fs/get_fs hacks. See my compat_sys_sysinfo changes for reference.



More information about the parisc-linux mailing list