tech-kern archive

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

Re: mmap RW then mprotect RWX



On Mon, Jan 13, 2025 at 04:46:15PM +0000, Emmanuel Dreyfus wrote:
> main(void)
> {
>         void *p;
> 
>         p = mmap(NULL, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANON, -1, 0);
>         if (p == NULL)
>                 err(1, "mmap RWX failed");

You mean if (p == MAP_FAILED) here?

Martin


Home | Main Index | Thread Index | Old Index