Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Funchook install fail 1293 #1298

Merged
merged 7 commits into from Feb 7, 2023
Merged

Conversation

michalbiesek
Copy link
Contributor

@michalbiesek michalbiesek commented Jan 30, 2023

QA instructions:

Because of an AppScope bug, when you attached to a running Redis server process, the Redis server was restarting.

Here's how to verify that the bug is fixed.


# Install Redis
sudo apt install redis -y

# Running the above command should both install Redis and start Redis as a service. 
# To verify, run this command:

sudo systemctl status redis

# Verify that MemoryDenyWriteExecute is set to true - this was required to reproduce the bug.

grep MemoryDenyWriteExecute /lib/systemd/system/redis-server.service

# Set your terminal to display the Redis service PID once per second.
# That way we'll know if Redis restarts.
watch -n 1 pgrep redis

# In a new terminal, attach to the Redis server PID:
sudo scope attach redis

# At this point, the AppScope library should be loaded and the Redis server process should be scoped.
# To verify that this did not cause Redis to restart, connect to the Redis server via the Redis CLI.
redis-cli
set foo bar

# If the bug is NOT fixed, you should see that the PID in the first terminal has changed, and you should see a segfault like the following:
sudo journalctl -u redis-server.service
<user_name> systemd[1]: redis-server.service: Main process exited, code=dumped, status=11/SEGV
<user_name> systemd[1]: redis-server.service: Failed with result 'core-dump'.

@michalbiesek michalbiesek marked this pull request as draft January 30, 2023 17:43
@michalbiesek michalbiesek changed the base branch from master to release/1.3 January 30, 2023 17:43
@michalbiesek michalbiesek force-pushed the fix-1293-funchook-install-fail branch 5 times, most recently from 629ef3e to 8ab3f7f Compare January 31, 2023 13:42
@michalbiesek michalbiesek marked this pull request as ready for review January 31, 2023 14:09
@michalbiesek michalbiesek linked an issue Jan 31, 2023 that may be closed by this pull request
@michalbiesek michalbiesek force-pushed the fix-1293-funchook-install-fail branch 3 times, most recently from c112d7a to c032229 Compare February 2, 2023 09:12
src/wrap_go.c Show resolved Hide resolved
@seanvaleo seanvaleo changed the title Fix 1293 funchook install fail Funchook install fail 1293 Feb 2, 2023
michalbiesek and others added 7 commits February 3, 2023 23:10
- the funhook install can fail in scenario where
  systemd `MemoryDenyWriteExecute` setting is on
```
  ...Attempts to create memory mappings that are writable and executable
  at the same time, or
  to change existing memory mappings to become executable, or
  mapping shared memory segments as executable, are prohibited...
```
  Ref: https://www.freedesktop.org/software/systemd/man/systemd.exec.html

  Closes: #1293
- validate `osMemPermAllowWrite` and `osMemPermRestore`
@iapaddler iapaddler merged commit 753229a into release/1.3 Feb 7, 2023
@michalbiesek michalbiesek deleted the fix-1293-funchook-install-fail branch February 8, 2023 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Redis crashes after attaching scope when setting value.
2 participants