Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
This bug was recently introduced into the upstream kernel by this commit:
commit 74cedf9b6c603f2278a05bc91b140b32b434d0b5
Author: Jan Kara <jack>
Date: Mon Nov 30 10:15:42 2015 -0700
direct-io: Fix negative return from dio read beyond eof
Assume a filesystem with 4KB blocks. When a file has size 1000 bytes and
we issue direct IO read at offset 1024, blockdev_direct_IO() reads the
tail of the last block and the logic for handling short DIO reads in
dio_complete() results in a return value -24 (1000 - 1024) which
obviously confuses userspace.
Fix the problem by bailing out early once we sample i_size and can
reliably check that direct IO read starts beyond i_size.
Reported-by: Avi Kivity <avi>
Fixes: 9fe55eea7e4b444bafc42fa0000cc2d1d2847275
CC: stable.org
CC: Steven Whitehouse <swhiteho>
Signed-off-by: Jan Kara <jack>
Signed-off-by: Jens Axboe <axboe>
which was in 4.4-rc4:
# git describe --contains 74cedf9b6c603f2278a05bc91b140b32b434d0b5
v4.4-rc4~14^2~5
#
It was subsequently fixed by this commit:
commit 2d4594acbf6d8f75a27f3578476b6a27d8b13ebb
Author: Al Viro <viro.org.uk>
Date: Tue Dec 8 12:22:47 2015 -0500
fix the regression from "direct-io: Fix negative return from dio read beyond eof"
Sure, it's better to bail out of past-the-eof read and return 0 than return
a bogus negative value on such. Only we'd better make sure we are bailing out
with 0 and not -ENOMEM...
Cc: stable.org
Signed-off-by: Al Viro <viro.org.uk>
which was in 4.4-rc5:
git describe --contains 2d4594acbf6d8f75a27f3578476b6a27d8b13ebb
v4.4-rc5~24^2
The 4.4.0-0.rc4.21.el7 kernel-aarch64 snapshot just happened to
be taken in between the two commits above:
%define rpmversion 4.4.0
%define pkgrelease 0.rc4.21.el7
The current kernel-aarch64 kernel is version 4.5.0-0.rc3.27.el7, which
has Al Viro's fix, and which passes the test as expected:
# uname -r
4.5.0-0.rc3.27.el7.aarch64
# ./diotest4
PASS! Read beyond the file size
#