forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3b00fdb
committed
Check that MyProcPid == getpid() in backend signal handlers.
In commit97550c0, we added a similar check to the SIGTERMhandler for the startup process. This commit adds this check tobackend signal handlers installed with pqsignal(). This is done byusing a wrapper function that performs the check before calling theactual handler.The hope is that this will offer more general protection againstchild processes of Postgres backends inadvertently modifying sharedmemory due to inherited signal handlers. Another potentialfollow-up improvement is to use this wrapper handler function torestore errno instead of relying on each individual handlerfunction to do so.This commit makes the changes in commit97550c0 obsolete butleaves reverting it for a follow-up commit.Reviewed-by: Andres Freund, Noah MischDiscussion:https://postgr.es/m/20231121212008.GA3742740%40nathanxps131 parent8d8afd4 commit3b00fdb
1 file changed
+84
-2
lines changedLines changed: 84 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 |
| |
50 | 53 |
| |
51 | 54 |
| |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
52 | 102 |
| |
53 | 103 |
| |
| 104 | + | |
| 105 | + | |
| 106 | + | |
54 | 107 |
| |
55 | 108 |
| |
56 | 109 |
| |
57 | 110 |
| |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
58 | 121 |
| |
59 | 122 |
| |
60 | 123 |
| |
61 | 124 |
| |
| 125 | + | |
62 | 126 |
| |
63 | 127 |
| |
64 | 128 |
| |
| 129 | + | |
| 130 | + | |
| 131 | + | |
65 | 132 |
| |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
66 | 142 |
| |
67 | 143 |
| |
68 | 144 |
| |
| |||
72 | 148 |
| |
73 | 149 |
| |
74 | 150 |
| |
75 |
| - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
76 | 155 |
| |
77 | 156 |
| |
78 |
| - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
79 | 161 |
| |
80 | 162 |
|
0 commit comments
Comments
(0)