public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Paul Larson <plars@austin.ibm.com>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] vfs_read/vfs_write small bug fix (2.5.29)
Date: Tue, 30 Jul 2002 09:37:50 +0200	[thread overview]
Message-ID: <jefzy1wtrl.fsf@sykes.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.33.0207291510340.1492-100000@penguin.transmeta.com> (Linus Torvalds's message of "Mon, 29 Jul 2002 15:17:32 -0700 (PDT)")

Linus Torvalds <torvalds@transmeta.com> writes:

|> On 29 Jul 2002, Paul Larson wrote:
|> > > 
|> > > (Or maybe glibc doesn't know that the kernel pread/pwrite system calls 
|> > > were always 64-bit clean, and it just happened to work).
|> ?
|> > No, with just this patch it still fails on pread02 and pwrite02.
|> 
|> Ok, that just means that it's a library issue now - having looked at
|> historical kernel behaviour (and a lot of 64/bit architectures emulating
|> their old 32/bit system calls), the kernel system call interface is
|> clearly a 64-bit value, ie the kernel only export pread64/pwrite64, not a
|> "traditional" pread/pwrite at all.
|> 
|> So the question is what the library should do with a 32-bit negative 
|> "offset_t" passed in to the user-level "pread()" implementation. 
|> 
|> Looking at the disassembly of glibc pread, the implementation seems to be 
|> to just clear %edx on x86 (which are the high bits of the 64-bit offset 
|> value passed into sys_pread64()). 
|> 
|> And equally clearly your test wants to get EINVAL.
|> 
|> Your test would pass if glibc just sign-extended the 32-bit value to 64 
|> bits, instead of zero-extending it.

Yes, this was a bug in glibc, it has been fixed already in CVS.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

      reply	other threads:[~2002-07-30  7:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-29 18:25 [PATCH] vfs_read/vfs_write small bug fix (2.5.29) Badari Pulavarty
2002-07-29 19:02 ` Paul Larson
2002-07-29 20:11 ` Linus Torvalds
2002-07-29 21:06   ` Paul Larson
2002-07-29 21:22     ` Linus Torvalds
2002-07-29 22:06       ` Paul Larson
2002-07-29 22:17         ` Linus Torvalds
2002-07-30  7:37           ` Andreas Schwab [this message]

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=jefzy1wtrl.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=plars@austin.ibm.com \
    --cc=torvalds@transmeta.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