diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-06-15 11:10:19 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-06-15 11:10:19 +0000 |
commit | 9680a34c3c5c28dbaeb36067ad52529b14e36654 (patch) | |
tree | 3f66011329aba3904b72ecef05b4ccdc2c02d821 /lkm | |
parent | c22afdde6f8ae460fef0316c2a3587f9d9edc687 (diff) |
Avoid a dangerous race.
To avoid having a ptrace(2)d process from doing an exec of a suid binary
we strip off the suid bits from the executable if the process is traced.
Later we P_SUGID{,EXEC} in the process flags that stops further ptrace
attempts.
The problem is that between the stripping of suid bits and setting
P_SUGID{,EXEC} there is a pretty large window where the process can sleep
and other processes can attach to it with ptrace.
This is a quick fix for that. We set P_SUGID{,EXEC} early and take care to
remove them (we don't want the process to become tainted unnecessarily) if
exec fails.
XXX - exec needs a lot more work, but people are asking for a solution now.
Diffstat (limited to 'lkm')
0 files changed, 0 insertions, 0 deletions