mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: David Howells <dhowells@redhat.com>
Cc: akpm@osdl.org, Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: Using __user with compat_uptr_t
Date: Tue, 26 Apr 2005 07:40:50 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0504260737040.18901@ppc970.osdl.org> (raw)
In-Reply-To: <4872.1114506372@redhat.com>



On Tue, 26 Apr 2005, David Howells wrote:
> 
> For example, is this right?:
> 
> 	struct compat_nfs_string {
> 		compat_uint_t len;
> 		compat_uptr_t __user data;
> 	};

Nope. That makes "data" itself (the compat-pointer, not the thing it
points to) be marked as being in user space, which is not right.

> Or is this right?:
> 
> 	struct compat_nfs_string {
> 		compat_uint_t len;
> 		compat_uptr_t data;
> 	};

Yes. Now, when you use "compat_ptr()" on that thing, compat_ptr() will do 
the proper thing, and results in a "void __user *", so assuming you 
convert the pointer correctly, it will always end up having the right user 
annotation.

(Except on MIPS, where compat_ptr() doesn't, but MIPS hasn't been updated 
to do any sparse checking anyway).

		Linus

  reply	other threads:[~2005-04-26 14:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-15 14:45 [PATCH] Add 32-bit compatibility for NFSv4 mount David Howells
2005-04-16 17:38 ` Stephen Rothwell
2005-04-26  9:06 ` Using __user with compat_uptr_t David Howells
2005-04-26 14:40   ` Linus Torvalds [this message]
2005-04-27  9:28   ` [PATCH] NFS4: Don't use " David Howells

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=Pine.LNX.4.58.0504260737040.18901@ppc970.osdl.org \
    --to=torvalds@osdl.org \
    --cc=akpm@osdl.org \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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

all inboxes | Powered by JetHome®