From: "wcohen at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug runtime/29076] user_string_quoted() doesn't properly generate strings in .rodata on x86_64 machines
Date: Wed, 20 Apr 2022 18:17:05 +0000 [thread overview]
Message-ID: <bug-29076-6586-o9Slx7xnrE@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29076-6586@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=29076
--- Comment #5 from William Cohen <wcohen at redhat dot com> ---
The mlockall allows the access to the string in the readonly section.
[wcohen@fedora x86_ro_string]$ cat acct6.c
#include <unistd.h>
#include <string.h>
#include <sys/mman.h>
char *a="foobar";
char buffer[32];
int main()
{
mlockall(MCL_CURRENT);
acct(a);
strcpy (&buffer[0], a);
acct(&buffer[0]);
acct((char *)-1);
return 0;
}
[wcohen@fedora x86_ro_string]$ gcc -o acct6 -O2 acct6.c
[wcohen@fedora x86_ro_string]$ sudo stap -c ./acct6 sys_acct.stp
kprobe.function("__x64_sys_acct")?("foobar")
kprobe.function("__x64_sys_acct")?("foobar")
kprobe.function("__x64_sys_acct")?(0xffffffffffffffff)
--
You are receiving this mail because:
You are the assignee for the bug.
next prev parent reply other threads:[~2022-04-20 18:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 14:45 [Bug runtime/29076] New: " wcohen at redhat dot com
2022-04-20 14:48 ` [Bug runtime/29076] " wcohen at redhat dot com
2022-04-20 14:48 ` wcohen at redhat dot com
2022-04-20 14:48 ` fche at redhat dot com
2022-04-20 17:37 ` wcohen at redhat dot com
2022-04-20 18:02 ` fche at redhat dot com
2022-04-20 18:17 ` wcohen at redhat dot com [this message]
2022-04-21 9:33 ` mcermak at redhat dot com
2022-04-21 12:33 ` mcermak at redhat dot com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-29076-6586-o9Slx7xnrE@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=systemtap@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).