[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 04:48:23PM -0600, D. Jared Dominguez wrote:
> On Tue, Feb 03, 2015 at 04:40:16PM -0600, Adam Borowski wrote:
> >Package: efivar
> >
> >I'm afraid the patch 07-num_bits.patch breaks the case of 32-bit userland
> >on a 64-bit kernel.  As far as I know, this is how i386 would get installed
> >on any non-ancient machine if d-i could get that far (it doesn't for me in
> >qemu-kvm.x86-64, though).
> >
> >The bad assumption is that an 64-bit kernel would give the same data to any
> >process.  This seems to be obvious, but it's not the case:
> >
> >Here's a set of sample dumps of
> >/sys/firmware/efi/vars/Boot0005-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var
> >-- all done on the same virtual machine, same kernel, same boot-up, all that
> >differs is the ABI of the cat process:
> >
> >cat is amd64:
> >00000410  76 00 00 00 00 00 00 00  01 00 00 00 62 00 64 00  |v...........b.d.|
> >          ^^^^^^^^^^^^^^^^^^^^^^^
> >cat is x32:
> >00000410  76 00 00 00 01 00 00 00  62 00 64 00 65 00 62 00  |v.......b.d.e.b.|
> >          ^^^^^^^^^^^
> >cat is i386:
> >00000410  76 00 00 00 01 00 00 00  62 00 64 00 65 00 62 00  |v.......b.d.e.b.|
> >          ^^^^^^^^^^^
> >
> >Note that, surprisingly, the kernel detects the ABI of the running process
> >and presents different contents of that file on the sys fs.  This means,
> >runtime detection is bad as any 32-bit process will get 32-bit fields
> >(actually, just one, the rest is arch-independent).
> >
> >Thus, to fix the issue, it seems you can drop 07-num_bits.patch and install
> >the patch I attached instead.  I'm afraid I can't test it save for qemu and
> >virtualbox at this time, though.
> 
> I'm not convinced that this doesn't break the use case in #773412
> [1] since you're looking to define the type at compile-time[2], and
> that's precisely why #773412 came about. We'll end up replacing a
> bug in an unofficial port for a bug in an official port.

If I read that correctly, #773412 fixed i386 on an i386 kernel.  As you can
see in the dumps above, i386 userland on an amd64 kernel receives a 32-bit
field rather than 64-bit that patch wants.

The current package as-is cuts "debian" to "bian" and "EFI Something" to "I
Something" on both i386 and x32 if running on an amd64 kernel.

-- 
// 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: