Commit f30a32e
authored
Make sure altstack_size_ is a multiple of the system page size (#1883)
Summary: This PR modifies the logic that sets the value of
`altstack_size_`. When deploying Pixie on a 7th gen AMI running bottle
rocket, the value of `altstack_size_` was set to `MINSIGSTKSZ`. This
value was 39616 and was not a multiple of the system page size.
In this [line of
code](https://github.com/pixie-io/pixie/blob/0888c38df2dc414a36cc84198c7b159c39eea0e0/src/common/signal/signal_action.cc#L149)
`mprotect` was then applied on a non page aligned region since its
address was set as `altstack_ + guard_size_ + altstack_size_` leading to
an error. This region in `altstack_` was also not the tailing
`guard_size_` area as
[mmap](https://github.com/pixie-io/pixie/blob/0888c38df2dc414a36cc84198c7b159c39eea0e0/src/common/signal/signal_action.cc#L145)
would have added extra bytes to `altstack_` in order to page align it.
As per the docs, the address passed to `mprotect` needs to be aligned to
a page boundary. The function in this PR makes sure that the value of
`altstack_size_` is a multiple of the page size so that the address
calculated/passed to `mprotect` is aligned to a page boundary and that
it protects the tailing `guard_size_` region of `altstack_`
Relevant Issues: Fixes #1882
Type of change: /kind bug
Test Plan: Skaffolded pixie on EKS clusters with m7i.large, r7i.large
instances and on a GKE cluster with e2-standard-4 nodes and saw the PEM
start up
---------
Signed-off-by: Kartik Pattaswamy <kpattaswamy@pixielabs.ai>1 parent c399d12 commit f30a32e
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
74 | 86 | | |
75 | 87 | | |
76 | 88 | | |
| |||
0 commit comments