Bug 139701 - current->personality is not being set to PER_LINUX32
Summary: current->personality is not being set to PER_LINUX32
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: ia32el
Version: 4.0
Hardware: ia64
OS: Linux
Target Milestone: ---
: ---
Assignee: Jakub Jelinek
QA Contact:
: 139567 139698 (view as bug list)
Depends On:
Blocks: 140583
TreeView+ depends on / blocked
Reported: 2004-11-17 16:43 UTC by Joe Maionchi
Modified: 2007-11-30 22:07 UTC (History)
8 users (show)

Clone Of:
Last Closed: 2004-11-22 22:54:05 UTC

Attachments (Terms of Use)

Description Joe Maionchi 2004-11-17 16:43:53 UTC
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 19:07:04 UTC
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 19:12:29 UTC
*** Bug 139698 has been marked as a duplicate of this bug. ***

Comment 3 Jay Turner 2004-11-18 09:31:06 UTC
*** Bug 139567 has been marked as a duplicate of this bug. ***

Comment 4 Tony Luck 2004-11-22 19:19:21 UTC
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 22:54:05 UTC
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.