Re: [PATCH] (IA64) Fix ugly __[PS]* macros in <asm-ia64/pgtable.h>

From: Jamie Lokier (jamie_at_shareable.org)
Date: 04/15/04

  • Next message: markw_at_osdl.org: "Re: 2.6.5-mm5"
    Date:	Thu, 15 Apr 2004 16:26:00 +0100
    To: davidm@hpl.hp.com
    
    

    David Mosberger wrote:
    > >> No, Alpha Linux didn't map data without execute permission.
    >
    > Jamie> That was true from Linux 1.1.67 (when Alpha was introduced)
    > Jamie> to 1.1.84 (when __[PS]* was introduced). I'm not sure the
    > Jamie> Alpha target even worked during those versions. Since Linux
    > Jamie> 1.1.84, it has mapped pages on the Alpha without execute
    > Jamie> permission: the _PAGE_FOE (fault on exec) bit is set for
    > Jamie> mappings which don't have PROT_EXEC.
    >
    > $ uname -a
    > Linux hostname 2.2.20 #2 Wed Mar 20 19:57:28 EST 2002 alpha GNU/Linux
    > $ cat /proc/self/maps | grep cat
    > 0000000120000000-0000000120006000 r-xp 0000000000000000 08:01 309740 /bin/cat
    > 0000000120014000-0000000120016000 rwxp 0000000000004000 08:01 309740 /bin/cat
    >
    > As you can see, the data-segment is mapped with EXEC bit turned on.
    > Ditto for the stack segment, which I think is this one:
    >
    > 000000011fffe000-0000000120000000 rwxp 0000000000000000 00:00 0

    Lest we get more wires crossed, the "x" in /proc/self/maps indicates
    that userspace _requested_ executable mapping with PROT_EXEC.

    It is independent of whether the kernel and hardware can grant a
    non-executable mapping. On my Athlon:

    08048000-0804c000 r-xp 00000000 03:02 95153 /bin/cat
    0804c000-0804d000 rw-p 00003000 03:02 95153 /bin/cat
    bfffe000-c0000000 rwxp fffff000 00:00 0

    The stack is mapped executable, and the data segment is mapped
    non-executable, according to /proc/self/maps which reflects the
    PROT_EXEC request. But in fact because of hardware limitations,
    despite the "rw-p" my data segment is actually executable.

    If you map a segment without PROT_EXEC on Alpha, using a kernel newer
    than 1.1.84, you'll get a non-executable mapping. That's what I mean
    when I say the Alpha maps data without executable permission. The ELF
    loader appears to ask for exec permission anyway, which is another
    thing entirely.

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


  • Next message: markw_at_osdl.org: "Re: 2.6.5-mm5"

    Relevant Pages

    • Re: [PATCH] (IA64) Fix ugly __[PS]* macros in <asm-ia64/pgtable.h>
      ... Jamie> The stack is mapped executable, and the data segment is mapped ... Jamie> PROT_EXEC request. ... But in fact because of hardware limitations, ... but Alpha doesn't have this limitation. ...
      (Linux-Kernel)
    • Re: doubt in protected mode
      ... when i execute ... if the base address for code and data segment is zero and paging is ... Its protected mode address is addressed by the descriptor ... addressing is different between RM & PM. ...
      (comp.lang.asm.x86)
    • unwanted reinitialization of global variables
      ... I am having an issue with public global variables that appear to be ... Public alpha As String ... If I open the workbook and immediately run the Routine2 subroutine ... execute Routine2, the variable has been reset to null by the time the ...
      (microsoft.public.excel.programming)
    • Re: osf1 /alpha version of truss
      ... ksh: ./trussv5: cannot execute ... PA-Risc and Alpha are two entirely different platforms. ... why is the trussv5 then not executable on my system? ... Now I have no idea whether that version of truss would work on a V5.1 ...
      (comp.unix.tru64)
    • Mozilla Error: "No manager for initializing factory?"
      ... I have recently installed Mozilla's 1.5 alpha release, ... INTERNAL ERROR on Browser End: ... I can execute the command just fine. ... and I arrive at the same error with the user account. ...
      (comp.os.linux.misc)