From: Stian Halseth <stian@itx.no>
To: brauner@kernel.org, viro@zeniv.linux.org.uk
Cc: jack@suse.cz, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org,
schwab@suse.de, fweimer@redhat.com
Subject: Re: [PATCH 0/2] fs: honor FOP_UNSIGNED_OFFSET in llseek and positional I/O
Date: Sun, 18 Oct 2026 11:33:28 +0200 [thread overview]
Message-ID: <7db77dd421c0d6d76460486b7c5b51862d45d896.camel@itx.no> (raw)
In-Reply-To: <20260917151614.376867-1-stian@itx.no>
[-- Attachment #1: Type: text/plain, Size: 2332 bytes --]
Ping. The series still applies cleanly to current master (7.3-rc7).
Since posting it has run on an UltraSPARC T4-1 (7.2.y) and a SPARC T7-1
(7.3-rc5) as the production kernel for a month. Is there anything you
would like changed before it can be picked up?
https://lore.kernel.org/linux-fsdevel/20260917151614.376867-1-stian@itx.no/
/Stian
On Thu, 2026-09-17 at 17:16 +0200, Stian Halseth wrote:
> Two generic VFS bugs found while fixing pldd(1) on sparc64, where
> userspace is mapped above 2^63 so file positions on /proc/PID/mem
> have
> the top bit set.
>
> FOP_UNSIGNED_OFFSET declares a file's offsets unsigned, and
> vfs_llseek(),
> rw_verify_area() and the mmap path honor it. Two sets of syscall
> wrappers do not:
>
> 1. sys_llseek() takes a negative result from vfs_llseek() for an
> error
> and returns it truncated to int without filling *result.
> 2. pread64/pwrite64/preadv/pwritev reject a negative position
> before
> looking up the file.
>
> Both patches only change behavior for a file with FOP_UNSIGNED_OFFSET
> and a position with the top bit set. Today that is /proc/PID/mem,
> /dev/mem, the sparc ADI driver and the DRM/accel device files; for
> all
> of them lseek() followed by read() at that position already works, so
> the wrappers now match it.
>
> Tested on an UltraSPARC T4: pread(), preadv(), pwrite(), pwritev()
> and
> lseek() on /proc/PID/mem at positions above 2^63 return the correct
> data
> and offset; a negative position on a regular file or a pipe still
> fails
> with EINVAL and position 0 on a pipe with ESPIPE, as before; and the
> stock pldd(1) works again. On other architectures the change is a
> no-op
> for every file without FOP_UNSIGNED_OFFSET, and userspace addresses
> never set the top bit, so the new paths are only reachable by passing
> a bogus position to /proc/PID/mem or /dev/mem, which then fails in
> the
> driver instead of the wrapper.
>
> The glibc side is
> https://sourceware.org/bugzilla/show_bug.cgi?id=34641;
>
> Stian Halseth (2):
> fs: fix llseek() result for files with unsigned offsets
> fs: allow positional I/O on files with unsigned offsets
>
> fs/read_write.c | 38 +++++++++++++++++++-------------------
> 1 file changed, 19 insertions(+), 19 deletions(-)
>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-10-18 9:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 15:16 Stian Halseth
2026-09-17 15:16 ` [PATCH 1/2] fs: fix llseek() result for files with unsigned offsets Stian Halseth
2026-09-17 15:16 ` [PATCH 2/2] fs: allow positional I/O on " Stian Halseth
2026-09-17 16:01 ` [PATCH 0/2] fs: honor FOP_UNSIGNED_OFFSET in llseek and positional I/O Florian Weimer
2026-09-17 16:45 ` Stian Halseth
2026-09-17 18:39 ` Stian Halseth
2026-10-18 9:33 ` Stian Halseth [this message]
2026-10-21 10:37 ` Christian Brauner
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=7db77dd421c0d6d76460486b7c5b51862d45d896.camel@itx.no \
--to=stian@itx.no \
--cc=brauner@kernel.org \
--cc=fweimer@redhat.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=schwab@suse.de \
--cc=sparclinux@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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®