fs/exec.c and binfmt-xxx

Heinz-Ado Arnolds (Ado.Arnolds@dhm-systems.de)
Tue, 27 Jul 1999 16:17:24 +0200


I have a problem with the fs/exec.c-search_binary_handler().

Starting with linux-2.1.23 (and up to 2.2.10) there is used a
offset of 2 within a binary to load for determinating its type.
This leads to a request for loading a module which doesn't
exist. Additionally the request is now done with a hex number
but modprobe expects decimal numbers.

(I'm using linux-2.2.10 with modutils-2.1.121)

-------------------

e.g.:

% file bin/linux/open-files
bin/linux/open-files: Linux/i386 demand-paged executable (QMAGIC),
stripped

first 4 bytes of binary are: 0xcc, 0x00, 0x64, 0x00

Executing of this binray leads to a request of a module for
binfmt-0064 which is not found. I think the request should
be for binfmt-204 (hex 00CC) which ends in loading binfmt_aout
(modprobe -c: "alias binfmt-204 binfmt_aout").

e.g.:

% file bin/isc/nkey
bin/isc/nkey: 80386 COFF executable

first 4 bytes of binary are: 0x4c 0x01 0x04 0x00

requested is binfmt-0004 and not as expected binfmt-332
(hex 014C) which would load iBCS (modprobe -c:
"alias binfmt-332 iBCS").

-------------------

What was the reason for changing

sprintf(modname, "binfmt-%hd", *(short*)(&bprm->buf));
^^
to

sprintf(modname, "binfmt-%04x", *(unsigned short *)(&bprm->buf[2]));
^^^ ^^^

in 'fs/exec.c' or what am I doing wrong?

Thanks a lot for your help and many greetings from Cologne, Germany

Ado

-- 
------------------------------------------------------------------------
  Heinz-Ado Arnolds                           Ado.Arnolds@dhm-systems.de
  DHM GmbH & Co. KG                              +49 2234 18400  (voice)
  Max-Planck-Strasse 2, 50858 Koeln, Germany     +49 2234 184040 (fax)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/