Commit 07af330
restore/pie: check return value of sys_rseq on unregister
The return value of sys_rseq was previously ignored during
unregistration, under the assumption that it would not fail if the rseq
structure was properly registered.
However, if sys_rseq fails, the kernel retains the registration. If the
memory containing the rseq structure is subsequently unmapped or reused,
kernel updates to the rseq area can cause the process to crash (e.g.,
via SIGSEGV).
Check the return value of sys_rseq. If it fails, log the error code and
abort the restoration process. This makes rseq unregistration failures
fatal and explicit, aiding in debugging and preventing later obscure
crashes.
Signed-off-by: liqiang2020 <liqiang64@huawei.com>1 parent fb59ae5 commit 07af330
1 file changed
+12
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1363 | 1363 | | |
1364 | 1364 | | |
1365 | 1365 | | |
1366 | | - | |
| 1366 | + | |
1367 | 1367 | | |
| 1368 | + | |
| 1369 | + | |
1368 | 1370 | | |
1369 | | - | |
| 1371 | + | |
1370 | 1372 | | |
1371 | | - | |
1372 | | - | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
1373 | 1379 | | |
1374 | 1380 | | |
1375 | 1381 | | |
| |||
1803 | 1809 | | |
1804 | 1810 | | |
1805 | 1811 | | |
1806 | | - | |
| 1812 | + | |
| 1813 | + | |
1807 | 1814 | | |
1808 | 1815 | | |
1809 | 1816 | | |
| |||
0 commit comments