Actions
Bug #5930
closedfasttrap_pid_enable() panics when prfind() fails in forking process
Start date:
2015-05-15
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
Description
We saw a panic with the following stack trace:
fasttrap_pid_enable+0x143(ffffff5565883ab0, 151c4, ffffff57fbaeff18) dtrace_ecb_enable+0x68(ffffff87e5522230) dtrace_ecb_create_enable+0x4d(ffffff5676229980, ffffff436f4dc7c0) dtrace_match+0x111(ffffff01efd91950, e, 0, 1, fffffffff80bf680, ffffff436f4dc7c0) dtrace_probe_enable+0x81(ffffff4b2821a498, ffffff436f4dc7c0) dtrace_enabling_match+0x76(ffffff436f4dc7c0, 0) dtrace_enabling_matchall+0x4a() dtrace_register+0x315(ffffff01efd91b30, ffffff01efd91cc8, 1c, ffffff43eaa4a9c8, ffffffffc01192a0, ffffff5466033be8) fasttrap_provider_lookup+0x2f3(2dcc, ffffff43eb5a8bae, ffffff01efd91cc8) fasttrap_meta_provide+0x93(0, ffffff01efd91cc0, 2dcc) dtrace_helper_provide_one+0xf2(ffffff43ee186140, ffffff43eb5a80e0, 2dcc) dtrace_helper_provide+0x6f(ffffff43ee186140, 2dcc) dtrace_helper_provider_register+0x163(ffffff58cc298008, ffffff454aadf640, 0) dtrace_helpers_duplicate+0x1df(ffffff43757700b0, ffffff58cc298008) cfork+0x9e2(0, 1, 0) forksys+0x3c(0, 0) sys_syscall+0x17a()
The problem is that fasttrap_pid_enable() assumes that any failure to sprlock() a process from within a forking process must be because the target process is unborn – not that it is dead. As a result, we dereference the return value of prfind() – which is potentially NULL if the process is actually gone and we just happen to be within the context of a forking process. (Under this condition, we need to simply bail out.)
Updated by Electric Monk about 7 years ago
- Status changed from New to Closed
git commit 9df7e4e12eb093557252d3bec029b5c382613e36
commit 9df7e4e12eb093557252d3bec029b5c382613e36 Author: Bryan Cantrill <bryan@joyent.com> Date: 2015-05-19T00:21:27.000Z 5930 fasttrap_pid_enable() panics when prfind() fails in forking process Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: Gordon Ross <gordon.ross@nexenta.com> Approved by: Richard Lowe <richlowe@richlowe.net>
Actions