* Fwd: mmap 0-th page
[not found] <7cbde1da-c985-40f3-9368-c45146a9095e@volny.cz>
@ 2024-08-09 13:26 ` michal.hrachovec
2024-08-12 6:32 ` Jiri Slaby
0 siblings, 1 reply; 2+ messages in thread
From: michal.hrachovec @ 2024-08-09 13:26 UTC (permalink / raw)
To: Jiri Slaby, stable; +Cc: regressions
I am apologizing for sending again.
I have forgotten to add all recipients to previous e-mail.
...
-------- Forwarded Message --------
Subject: Re: mmap 0-th page
Date: Fri, 9 Aug 2024 12:45:01 +0200
From: michal.hrachovec@volny.cz <michal.hrachovec@volny.cz>
To: Jiri Slaby <jirislaby@kernel.org>
Good afternoon,
I finally have in Fedora Linux kernel version 6.10.3:
Linux fedora 6.10.3-100.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Aug 5
14:46:47 UTC 2024 x86_64 GNU/Linux
I have set this setting to zero:
cat /proc/sys/vm/mmap_min_addr
0
Then I compiled your program, where I only added the main and the return
statements:
int main(void)
{
char *zero = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE |
MAP_ANONYMOUS | MAP_FIXED, -1, 0);
*(char *)(NULL) = 'A';
printf("%c\n", *zero);
return 0;
}
I got error at running the compiled program:
Program received signal SIGSEGV, Segmentation fault (at line 2 of your
program)
Can you help again, please.
Thank you.
Michal Hrachovec
On 7/31/24 09:43, Jiri Slaby wrote:
> On 31. 07. 24, 9:39, Jiri Slaby wrote:
>> On 26. 07. 24, 12:36, michal.hrachovec@volny.cz wrote:
>>> I am trying to allocate the 0-th page with mmap function in my code.
>>> I am always getting this error with this error-code: mmap error ffffffff
>>> Then I was searching the internet for this topic and I have found
>>> the same topic at stackoverflow web pages.
>>
>>
>> char *zero = mmap(NULL, 4096, PROT_READ | PROT_WRITE,
>> MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
>> *(char *)(NULL) = 'A';
>> printf("%c\n", *zero);
>>
>> still yields 'A' here with 6.10.2 w/ vm.mmap_min_addr=0.
> Yeah and mind LSMs...
>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Fwd: mmap 0-th page
2024-08-09 13:26 ` Fwd: mmap 0-th page michal.hrachovec
@ 2024-08-12 6:32 ` Jiri Slaby
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Slaby @ 2024-08-12 6:32 UTC (permalink / raw)
To: michal.hrachovec@volny.cz, Jiri Slaby, stable; +Cc: regressions
On 09. 08. 24, 15:26, michal.hrachovec@volny.cz wrote:
> I got error at running the compiled program:
> Program received signal SIGSEGV, Segmentation fault (at line 2 of your
> program)
>
> Can you help again, please.
As I wrote, mind LSMs.
E.g.:
https://github.com/torvalds/linux/blob/0c3836482481200ead7b416ca80c68a29cfdaabd/security/selinux/hooks.c#L3807
--
js
suse labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-12 6:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <7cbde1da-c985-40f3-9368-c45146a9095e@volny.cz>
2024-08-09 13:26 ` Fwd: mmap 0-th page michal.hrachovec
2024-08-12 6:32 ` Jiri Slaby
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.