Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7981707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:27:25+00:00 2026-06-04T10:27:25+00:00

I am studying for exam tomorrow and I ran across this question: After we

  • 0

I am studying for exam tomorrow and I ran across this question:

After we run an executable with strace the following syscalls result regarding standard C lib:

  • open(“/lib/libc.so.6”, “O_RDONLY”) = 3
  • mmap(NULL, 36803630, PROT_READ | PROT_EXEC, MAP_PRIVATE | MAP_DENYWRITE, 3, 0) =
    0x7f312ab35000
  • mmap(0x7f312aeae000, 20480, PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x179000) = 0x7f312aeae000

The question is why does the first syscall of mmap uses PROT_READ|PROT_EXEC and the second one PROT_READ|PROT_WRITE.

Please explain me what happens after each mmap call in detail. I don’t understand why a process would need to modify libc (write access).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:27:28+00:00Added an answer on June 4, 2026 at 10:27 am

    The maps are private (MAP_PRIVATE), so nothing is modifying libc.so; instead, it’s modifying a private (to the process) copy of pages mapped from libc.so. This will include the data segment (global variables in libc) as well as the Global Offset Table (GOT) and perhaps other structures involved in relocating the library to a particular address at runtime.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While studying for a Functional Programming exam, I came across the following question from
While studying for the SCJP 6 exam, I ran into this question in a
So been studying for my past exam and come across this question which asks
I came across this question while studying for the Microsoft Web-Application Developer exam, You
I am studying for an exam and came across this question that seems a
While studying for a Functional Programming exam, I came across the following questions from
While studying for the Zend PHP Exam I came across the following contradicting information:
I'm studying for an exam, and a previous exam had this question: 1. void
This is an example question for an exam I'm studying for - the question
This is a question that came up in an exam paper I'm studying for.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.