aboutsummaryrefslogtreecommitdiff
path: root/net/lapb/lapb_timer.c
diff options
context:
space:
mode:
authorDenys Vlasenko <[email protected]>2012-03-23 15:02:40 -0700
committerLinus Torvalds <[email protected]>2012-03-23 16:58:40 -0700
commit8c5cf9e5c50dc902713897e10201aa71f3546aa1 (patch)
tree9d5590690c0bf2b596697768972b8d42de2e8a28 /net/lapb/lapb_timer.c
parentb1845ff53f1a9eadba005ae53dfe60ab00dfe83b (diff)
ptrace: don't modify flags on PTRACE_SETOPTIONS failure
On ptrace(PTRACE_SETOPTIONS, pid, 0, <opts>), we used to set those option bits which are known, and then fail with -EINVAL if there are some unknown bits in <opts>. This is inconsistent with typical error handling, which does not change any state if input is invalid. This patch changes PTRACE_SETOPTIONS behavior so that in this case, we return -EINVAL and don't change any bits in task->ptrace. It's very unlikely that there is userspace code in the wild which will be affected by this change: it should have the form ptrace(PTRACE_SETOPTIONS, pid, 0, PTRACE_O_BOGUSOPT) where PTRACE_O_BOGUSOPT is a constant unknown to the kernel. But kernel headers, naturally, don't contain any PTRACE_O_BOGUSOPTs, thus the only way userspace can use one if it defines one itself. I can't see why anyone would do such a thing deliberately. Signed-off-by: Denys Vlasenko <[email protected]> Acked-by: Tejun Heo <[email protected]> Reviewed-by: Oleg Nesterov <[email protected]> Cc: Pedro Alves <[email protected]> Cc: Jan Kratochvil <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions