[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#776999: broken 32-bit userland on 64-bit kernel



On Wed, Feb 04, 2015 at 06:04:00PM -0600, D. Jared Dominguez wrote:
> In other words, 32-bit efivar/efibootmgr on 64-bit kernel is going
> to get the same value from the kernel as 64-bit efivar/efibootmgr on
> 64-bit. With the x32 ABI, you're going to see the same value on a
> 64-bit kernel (through the x32 ABI) as you would see on a 32-bit
> kernel. So we need some way to determine not just whether the kernel
> 32-bit or 64-bit but if 64-bit, whether we're using the x32 ABI.

Time to RTFK then.

efivar_show_raw does:
        if (is_compat())
                DataSize is __u32 
        else
                DataSize is unsigned long       

is_compat() is:
        IS_ENABLED(CONFIG_COMPAT) && is_compat_task()  

Debian's kernel have CONFIG_COMPAT=y

is_compat_task() is:
        is_ia32_task() || is_x32_task()

Thus: on Debian's kernels, any i386 or x32 process will get a 32-bit field.
Ie, my version of the patch is needed.  On kernels compiled without
CONFIG_COMPAT, Peter Jones' version (reading uname -m) is correct.

So... how exactly can we divine the value of this define?


-- 
// If you believe in so-called "intellectual property", please immediately
// cease using counterfeit alphabets.  Instead, contact the nearest temple
// of Amon, whose priests will provide you with scribal services for all
// your writing needs, for Reasonable and Non-Discriminatory prices.


Reply to: