Bug 559410

Summary: posix_fadvise() handles its arguments incorrectly in 32-bit compat mode.
Product: Red Hat Enterprise Linux 5 Reporter: Wade Mealing <wmealing>
Component: kernelAssignee: Wade Mealing <wmealing>
Status: CLOSED ERRATA QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: high Docs Contact:
Priority: high    
Version: 5.6CC: clalance, dhoward, emcnabb, john.haxby, jpirko, jwest, jwilson, plyons, tao, vfalico
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 07:28:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 554735    
Bug Blocks: 569595, 569596, 569597    
Attachments:
Description Flags
Implement the 32 bit syscalls in 64 bit systems.
none
reproducer from Issue Tracker none

Description Wade Mealing 2010-01-28 02:22:36 UTC
Description of problem:

A program doesn't run correctly on x86_64 if it calls posix_fadvise() and was compiled on x86.  This problem can be solved by calling sys32_fadvise64() instead of sys_fadvise64() in the kernel
when posix_fadvise() is called in the 32-bit compat mode.


Version-Release number of selected component (if applicable):

2.6.18-164.el5

How reproducible:

Every time


Steps to Reproduce:
1. Compile fadvise_test.c (gcc -m32 fadvise_test.c -o fadvise_test32)
2. Run strace against the fadvise_test32.
3. Note that the posix_fadvise() fails with EINVAL , even when args are valid.


Actual results:

System calls fail, apps dont work as they should if they use posix_fadvise.

Expected results:

These 32 bit syscalls on a 64 bit system should work as they would on a 32 bit system.

Additional info:

This is a backport of this patch from upstream:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=e412ac4971d27ea84f3d63ce425c6ab2d6a67f23

The customer has tested a kernel with the patch attached and verifies it works.

Patch to be attached, will mail to kernel-list when I have some time without a S1.

Comment 2 Wade Mealing 2010-01-28 04:39:30 UTC
Created attachment 387235 [details]
Implement the 32 bit syscalls in 64 bit systems.

Comment 12 Jarod Wilson 2010-03-03 15:44:31 UTC
in kernel-2.6.18-191.el5
You can download this test kernel from http://people.redhat.com/jwilson/el5

Please update the appropriate value in the Verified field
(cf_verified) to indicate this fix has been successfully
verified. Include a comment with verification details.

Comment 15 yanfu,wang 2010-03-04 07:13:29 UTC
Created attachment 397735 [details]
reproducer from Issue Tracker

Comment 16 john.haxby@oracle.com 2010-03-04 17:28:22 UTC
That patch, unlike the one in bug 554735 doesn't include support for Xen system calls.  I don't know if that is an issue for this.

Comment 17 john.haxby@oracle.com 2010-03-04 17:41:47 UTC
The patch in the -191 kernel is also broken: it won't fix the problem on xen kernels.   But it's nice to see it's otherwise identical to mine :-)

Comment 23 Chris Lalancette 2010-03-05 13:37:17 UTC
*** Bug 554735 has been marked as a duplicate of this bug. ***

Comment 24 Chris Lalancette 2010-03-05 13:38:41 UTC
I posted a patch to take care of the Xen side of this, so flipping back to POST.

Chris Lalancette

Comment 26 Jarod Wilson 2010-03-10 17:01:58 UTC
in kernel-2.6.18-192.el5
You can download this test kernel from http://people.redhat.com/jwilson/el5

Please update the appropriate value in the Verified field
(cf_verified) to indicate this fix has been successfully
verified. Include a comment with verification details.

Comment 31 errata-xmlrpc 2010-03-30 07:28:56 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2010-0178.html