Bug 139701 - current->personality is not being set to PER_LINUX32
current->personality is not being set to PER_LINUX32
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: ia32el (Show other bugs)
ia64 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
: 139567 139698 (view as bug list)
Depends On:
Blocks: 140583
  Show dependency treegraph
Reported: 2004-11-17 11:43 EST by Joe Maionchi
Modified: 2007-11-30 17:07 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-11-22 17:54:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Joe Maionchi 2004-11-17 11:43:53 EST
Description of problem:

The new version of ia32-el does not set "current->personality" to 
PER_LINUX32.  Our 64-bit kernel modules rely on this to determine 
whether the calling process is 32-bit or 64-bit.  This was getting 
set in earlier RHEL4 drops.

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


How reproducible:


Steps to Reproduce:
1. build a 32-bit app that calls an ioctl into a 64-bit kernel module.
2. run the 32-bit app on IA64 using the ia32EL.
3. check inside the kernel that current->personality is not set to 
Actual results:

current->personality is not set.

Expected results:

current->personality = PER_LINUX32 for 32-bit calling processes.

Additional info:

Is this a bug, or an intended change.  If intended, what will be the 
new method for determining whether the calling process is 32-bit or 
64-bit?  Ideally, we'd like this to be the same across all 64-bit 
platforms (ie: on x86_64 we also check current->personality).
Comment 1 Jakub Jelinek 2004-11-17 14:07:04 EST
I doubt ia32el calling personality (PER_LINUX32) will make any difference
on RHEL4 - as the kernel is compiled without CONFIG_IA32_SUPPORT, that
personality is simply not registered, so likely the syscall will fail.

I believe the right solution would be to add an interface for external ioctl/syscall translation modules to ia32el and let say Veritas build/ship
an ia32el module that would do the translation.

How should Veritas test for 32-bit process is a question for the kernel team,
but testing PER_LINUX32 sounds wrong, one can change the personality.
On x86-64, the right way is IMHO test_thread_flag(TIF_IA32).
On IA-64 with ia32el, this is very questionable, as the process is really 64-bit,
not 32-bit.
Comment 2 Jakub Jelinek 2004-11-17 14:12:29 EST
*** Bug 139698 has been marked as a duplicate of this bug. ***
Comment 3 Jay Turner 2004-11-18 04:31:06 EST
*** Bug 139567 has been marked as a duplicate of this bug. ***
Comment 4 Tony Luck 2004-11-22 14:19:21 EST
I also expected that a "personality(PER_LINUX32)" call would fail on 
RHEL4 ... but I tried it and it works just fine.  So this does 
provide a simple and convenient way for ia32-el to leave a footprint 
that an in-kernel module can test to determine how to interpret the 
format of a binary structure passed between usermode and kernel.

Ia32-el can't make the conversion ... it has no idea what the 
structures look like.  A plug-in interface sounds complex/cumbersome  
(some sort of extra shared libraries that ia32-el would load if they 
are present, and then feed all ioctl's through??)
Comment 5 Jakub Jelinek 2004-11-22 17:54:05 EST
I was wrong, personality (PER_LINUX32) in ia32el-1.1-11 succeeds
(the difference from CONFIG_IA32_SUPPORT times is just that this call doesn't
change exec domain and therefore doesn't change e.g. altroot).
So I guess checking current->personality == PER_LINUX32 is something that
Veritas can use in their module.

Note You need to log in before you can comment on or make changes to this bug.