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

ansible: Apply "execheap" SELinux policy hack #580

Merged
merged 1 commit into from
Mar 1, 2024
Merged

ansible: Apply "execheap" SELinux policy hack #580

merged 1 commit into from
Mar 1, 2024

Conversation

martinpitt
Copy link
Member

@martinpitt martinpitt commented Feb 29, 2024

With current Fedora 39, Chromium often runs into these crashes:

AVC avc:  denied  { execheap } for  pid=3725873 comm="ThreadPoolForeg" scontext=system_u:system_r:container_t:s0:c439,c758 tcontext=system_u:system_r:container_t:s0:c439,c758 tclass=process permissive=0
systemd-coredump[3725903]: [Process 3725873 (headless_shell) of user 1111 terminated abnormally without generating a coredump.

This causes the browser to hang, and the test force-killed after the timeout.

The general tone in past bug reports is that this is intended -- heap shouldn't be writable and executable at the same time. So Chromium is doing something dubious here.

This isn't something we can easily influence, so just poke a hole into the policy.

This was generated by collecting the full denial with ausearch -c 'ThreadPoolForeg' --raw, and feeding the result into audit2allow:

echo 'type=AVC msg=audit(1709124430.347:10808): avc:  denied  { execheap } for  pid=150495 comm="ThreadPoolForeg" scontext=system_u:system_r:container_t:s0:c114,c423 tcontext=system_u:system_r:container_t:s0:c114,c423 tclass=process permissive=1' | audit2allow -M cockpituous

Fixes #579


I rolled this out to our infra. Let's check tomorrow morning if it actually worked. Update: It did, and it's still necessary with Chromium 122.

@martinpitt martinpitt mentioned this pull request Feb 29, 2024
@martinpitt martinpitt removed the blocked label Mar 1, 2024
@martinpitt martinpitt marked this pull request as ready for review March 1, 2024 13:58
With current Fedora 39, Chromium often runs into these crashes:

```
AVC avc:  denied  { execheap } for  pid=3725873 comm="ThreadPoolForeg" scontext=system_u:system_r:container_t:s0:c439,c758 tcontext=system_u:system_r:container_t:s0:c439,c758 tclass=process permissive=0
systemd-coredump[3725903]: [Process 3725873 (headless_shell) of user 1111 terminated abnormally without generating a coredump.
```

This causes the browser to hang, and the test force-killed after the
timeout.

The general tone in past bug reports is that this is intended -- heap
shouldn't be writable and executable at the same time. So Chromium is
doing something dubious here.

This isn't something we can easily influence, so just poke a hole into
the policy.

This was generated by collecting the full denial with
`ausearch -c 'ThreadPoolForeg' --raw`, and feeding the result into
`audit2allow`:

```
echo 'type=AVC msg=audit(1709124430.347:10808): avc:  denied  { execheap } for  pid=150495 comm="ThreadPoolForeg" scontext=system_u:system_r:container_t:s0:c114,c423 tcontext=system_u:system_r:container_t:s0:c114,c423 tclass=process permissive=1' | audit2allow -M cockpituous
```

Fixes #579
@martinpitt martinpitt merged commit c118069 into main Mar 1, 2024
3 checks passed
@martinpitt martinpitt deleted the execheap branch March 1, 2024 14:26
@mvollmer
Copy link
Member

mvollmer commented Mar 1, 2024

So Chromium is doing something dubious here.

Just FTR: I am not so sure about dubious. Chromium's JIT has always needed executable memory, and that was always okay with SELinux. But something must have changed in the details.

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.

e2e browser crashes
2 participants