From: Arun Sharma <arun.sharma@intel.com>

- Several instances where we were using pid_t instead of uid_t

- If the caller passed a NULL `oldact' pointer into sys_sigprocmask then
  don't try to write the old sigmask there.



 25-akpm/fs/compat_ioctl.c |    4 ++--
 25-akpm/kernel/compat.c   |    3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff -puN fs/compat_ioctl.c~compat-layer-fixes fs/compat_ioctl.c
--- 25/fs/compat_ioctl.c~compat-layer-fixes	Fri Nov  7 15:03:32 2003
+++ 25-akpm/fs/compat_ioctl.c	Fri Nov  7 15:03:32 2003
@@ -1701,7 +1701,7 @@ static int do_smb_getmountuid(unsigned i
 	set_fs(old_fs);
 
 	if (err >= 0)
-		err = put_user(kuid, (compat_pid_t *)arg);
+		err = put_user(kuid, (compat_uid_t *)arg);
 
 	return err;
 }
@@ -2979,7 +2979,7 @@ HANDLE_IOCTL(VIDIOCSFBUF32, do_video_ioc
 HANDLE_IOCTL(VIDIOCGFREQ32, do_video_ioctl)
 HANDLE_IOCTL(VIDIOCSFREQ32, do_video_ioctl)
 /* One SMB ioctl needs translations. */
-#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_pid_t)
+#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t)
 HANDLE_IOCTL(SMB_IOC_GETMOUNTUID_32, do_smb_getmountuid)
 HANDLE_IOCTL(ATM_GETLINKRATE32, do_atm_ioctl)
 HANDLE_IOCTL(ATM_GETNAMES32, do_atm_ioctl)
diff -puN kernel/compat.c~compat-layer-fixes kernel/compat.c
--- 25/kernel/compat.c~compat-layer-fixes	Fri Nov  7 15:03:32 2003
+++ 25-akpm/kernel/compat.c	Fri Nov  7 15:03:32 2003
@@ -204,7 +204,8 @@ asmlinkage long compat_sys_sigprocmask(i
 	ret = sys_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL);
 	set_fs(old_fs);
 	if (ret == 0)
-		ret = put_user(s, oset);
+		if (oset)
+			ret = put_user(s, oset);
 	return ret;
 }
 

_