mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: airlied@linux.ie
Cc: dri-devel@lists.sourceforge.net, andi@firstfloor.org,
	linux-kernel@vger.kernel.org, arnd@arndb.de
Subject: Re: is avoiding compat ioctls possible?
Date: Tue, 27 Oct 2009 22:28:14 -0700 (PDT)	[thread overview]
Message-ID: <20091027.222814.137568780.davem@davemloft.net> (raw)
In-Reply-To: <alpine.DEB.2.00.0910280353080.19088@skynet.skynet.ie>

From: Dave Airlie <airlied@linux.ie>
Date: Wed, 28 Oct 2009 03:54:34 +0000 (GMT)

>> 
>> > we already opencoded this (probably before it was macroisied or we just 
>> > pasted it), so the radeon one is buggy, I should just go and compat_* all 
>> > of these then and we should be all happy?
>> 
>> It should be, it's only working because:
>> 
>> 1) A malicious userland hasn't put garbage in the upper bits for
>>    you yet.
>> 
>> 2) Nobody has tested s390 yet :-)
>> 
> 
> So will an inline like this work?
> 
> static inline void *__user convert_user_ptr(uint64_t ioctl_ptr)
> {

Please don't do this.

This is exactly what I feared people would do when is_compat_task()
was added.  is_compat_task() is for situations where there is
otherwise no other way to handle the compat situation properly.

It's not that much work for you to hook up the compat ioctls properly,
and if you are clever you can do it in such a way that you'll get
warnings if someone accidently adds a new ioctl but forgets the
compat bits :-)

  reply	other threads:[~2009-10-28  5:27 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-28  1:22 Dave Airlie
2009-10-28  2:25 ` David Miller
2009-10-28  3:01   ` Dave Airlie
2009-10-28  2:53 ` Andi Kleen
2009-10-28  3:05   ` Dave Airlie
2009-10-28  3:19     ` Andi Kleen
2009-10-28  3:28       ` Dave Airlie
2009-10-28  3:34         ` Andi Kleen
2009-10-28  3:43           ` David Miller
2009-10-28  3:41         ` David Miller
2009-10-28 21:05       ` Maciej W. Rozycki
2009-10-29  8:27         ` Arnd Bergmann
2009-10-28  3:38     ` David Miller
2009-10-28  3:43       ` Dave Airlie
2009-10-28  3:45         ` David Miller
2009-10-28  3:51           ` Andi Kleen
2009-10-28  3:54           ` Dave Airlie
2009-10-28  5:28             ` David Miller [this message]
2009-10-28  5:42               ` Dave Airlie
2009-10-28  6:04                 ` David Miller
2009-10-28  7:53                   ` David Miller
2009-10-28  7:59                     ` Andi Kleen
2009-10-28  8:11                       ` David Miller
2009-10-28  8:19                         ` Andi Kleen
2009-10-28  8:28                           ` David Miller
2009-10-28 12:13                     ` Arnd Bergmann
2009-10-28 12:16                       ` David Miller
2009-10-28 15:40                         ` Arnd Bergmann
2009-10-29  5:41                           ` David Miller
2009-10-29  8:16                             ` Arnd Bergmann
2009-10-29  8:34                             ` Heiko Carstens
2009-10-29  8:39                               ` David Miller
2009-10-28 12:17                       ` David Miller
2009-10-30  1:13                     ` Dave Airlie
2009-10-30 10:13                       ` Arnd Bergmann
2009-11-18  0:26                         ` Dave Airlie
2009-11-18  9:09                           ` Andi Kleen
2009-11-18 14:42                             ` Arnd Bergmann
2009-10-28  3:37   ` David Miller
2009-10-28  4:36     ` Andi Kleen
2009-10-28  5:29       ` David Miller
2009-10-28 10:27       ` Arnd Bergmann

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=20091027.222814.137568780.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=airlied@linux.ie \
    --cc=andi@firstfloor.org \
    --cc=arnd@arndb.de \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=linux-kernel@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 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®