The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd.bergmann@de.ibm.com>
To: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux-kernel@vger.kernel.org,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: Re: [patch/rfc] s390: get rid of own uid16 compat system calls
Date: Thu, 27 Jul 2006 03:03:42 +0200	[thread overview]
Message-ID: <200607270303.42959.arnd.bergmann@de.ibm.com> (raw)
In-Reply-To: <20060710085142.GB9440@osiris.boeblingen.de.ibm.com>

On Monday 10 July 2006 10:51, Heiko Carstens wrote:
> "Only" thing is that we unfortunately have different sizes for
> __kernel_old_[uid|gid]_t (16 bit on s390, 32 on s390x). I was tempted to
> change these just to find out that there are other users as well:
> 
> include/linux/ncp_fs.h:
>  #define NCP_IOC_GETMOUNTUID _IOW('n', 2, __kernel_old_uid_t)
> include/linux/smb_fs.h:
>  #define SMB_IOC_GETMOUNTUID _IOR('u', 1, __kernel_old_uid_t)
> 
> So, this is no option. Would anybody know of something to get this work?
> Or is this just a stupid idea?

Ok, I don't know exactly what you're talking about, but I have in the
past tried to hack that area as well. It's probably a good idea to
pick up my old patch and work from there, by making these two file systems
understand all possible ways:

#ifdef __KERNEL__
/* anything the user may be passing to us */
#define NCP_IOC_GETMOUNTUID16 _IOW('n', 2, u16)
#define NCP_IOC_GETMOUNTUID32 _IOW('n', 2, u32)
#define NCP_IOC_GETMOUNTUID64 _IOW('n', 2, u64)
#else
/* what the user is _supposed_ to pass */
#define NCP_IOC_GETMOUNTUID _IOW('n', 2, __kernel_old_uid_t) /* 16/32 bit */
#define NCP_IOC_GETMOUNTUID2 _IOW('n', 2, unsigned long) /* 32 or 64 bit */
#endif

int ncp_ioctl(struct inode *inode, struct file *filp, ...)
{
	...
	switch (arg) {
		...
	case NCP_IOC_GETMOUNTUID16:
	case NCP_IOC_GETMOUNTUID32:
	case NCP_IOC_GETMOUNTUID64:
		{
			unsigned long tmp = server->m.mounted_uid;

			if ((file_permission(filp, MAY_READ) != 0)
			    && (current->uid != server->m.mounted_uid))	{
				return -EACCES;
			}
			switch (arg) {
#ifdef CONFIG_UID16
			case NCP_IOC_GETMOUNTUID16:
				SET_UID(tmp, server->m.mounted_uid);
				if (put_user(tmp, (u16 __user *)argp)) 
					return -EFAULT;
#endif
			case NCP_IOC_GETMOUNTUID32:
				if (put_user(tmp, (u32 __user *)argp)) 
					return -EFAULT;
#ifdef CONFIG_64BIT
			case NCP_IOC_GETMOUNTUID64:
				if (put_user(tmp, (u64 __user *)argp)) 
					return -EFAULT;
			}
#endif
			return 0;
		}
	}
	...
}

I'm also posting the two patches I made a long time ago as a reference.

	Arnd <><

  reply	other threads:[~2006-07-27  1:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-10  8:51 [patch/rfc] s390: get rid of own uid16 compat system calls Heiko Carstens
2006-07-27  1:03 ` Arnd Bergmann [this message]
2006-07-27  1:08   ` reference: ncpfs: move ioctl32 code to fs/ncpfs/ioctl.c Arnd Bergmann
2006-07-27  2:53     ` Arnd Bergmann
2006-07-27  1:09   ` reference: smbfs: simplify compat_ioctl handling Arnd Bergmann
2006-07-27  2:56     ` [PATCH] ncpfs: move ioctl32 code to fs/ncpfs/ioctl.c Arnd Bergmann
2006-07-27  3:35       ` Petr Vandrovec
2006-07-27  5:45         ` Arnd Bergmann
2006-07-28  2:15           ` Petr Vandrovec
2006-07-28  3:38             ` Arnd Bergmann
2006-07-27  6:06   ` [patch/rfc] s390: get rid of own uid16 compat system calls Heiko Carstens

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=200607270303.42959.arnd.bergmann@de.ibm.com \
    --to=arnd.bergmann@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    /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