All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: linux-kernel@vger.kernel.org
Subject: Re: Why does x86_64 support a SuSE-specific ioctl?
Date: 5 Oct 2002 00:56:31 -0700	[thread overview]
Message-ID: <anm5vf$m6p$1@cesium.transmeta.com> (raw)
In-Reply-To: p73adltqz9g.fsf@oldwotan.suse.de

Followup to:  <p73adltqz9g.fsf@oldwotan.suse.de>
By author:    Andi Kleen <ak@suse.de>
In newsgroup: linux.dev.kernel
>
> Adrian Bunk <bunk@fs.tum.de> writes:
> > 
> > TIOCGDEV is (as the comment above indicates) in neither 2.4.20-pre9 nor in
> > 2.5.40 and I'm wondering why the x86_64 kernel supports a SuSE-specific
> > i386 ioctl?
> 
> Why not? 
> 
> I resubmitted the TIOCGDEV patch to Marcelo now, which implements it 
> for the console device.
> 

> -
> +		case TIOCGDEV:
> +			return put_user (kdev_t_to_nr (real_tty->device), (unsigned int*) arg);

This is broken -- you're returning a dev_t as an unsigned int.  On
i386 that means overwriting two bytes of userspace you shouldn't be,
and if dev_t > unsigned int in the future it has the opposite problem.
Note that this is different from TIOCGPTN which return a pts number,
not a dev_t.

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<amsp@zytor.com>

  parent reply	other threads:[~2002-10-05  7:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.NEB.4.44.0210041654570.11119-100000@mimas.fachschaften.tu-muenchen.de.suse.lists.linux.kernel>
2002-10-05  4:35 ` Why does x86_64 support a SuSE-specific ioctl? Andi Kleen
2002-10-05  5:04   ` Jeff Garzik
2002-10-05  5:10     ` Andi Kleen
2002-10-05 13:21       ` Alan Cox
2002-10-05 15:19         ` TIOCGDEV Andi Kleen
2002-10-05 17:00         ` Why does x86_64 support a SuSE-specific ioctl? Miquel van Smoorenburg
2002-10-09 18:03           ` Miquel van Smoorenburg
2002-10-05  7:56   ` H. Peter Anvin [this message]
2002-10-05 15:00     ` Andi Kleen
2002-10-07 17:48       ` Marcelo Tosatti
2002-10-05 13:20   ` Alan Cox
2002-10-05 14:36     ` Andrea Arcangeli
2002-10-04 14:59 Adrian Bunk

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='anm5vf$m6p$1@cesium.transmeta.com' \
    --to=hpa@zytor.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.