)]}'
{
  "commit": "6580807da14c423f0d0a708108e6df6ebc8bc83d",
  "tree": "553e2de8f2174f9bbb6ab9a2454b1306bb5eb4fa",
  "parents": [
    "c6a47cc2ccf9649ee09eeddd70a6d061bde69568"
  ],
  "author": {
    "name": "Oleg Nesterov",
    "email": "oleg@redhat.com",
    "time": "Tue Dec 15 16:47:16 2009 -0800"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Wed Dec 16 07:20:08 2009 -0800"
  },
  "message": "ptrace: copy_process() should disable stepping\n\nIf the tracee calls fork() after PTRACE_SINGLESTEP, the forked child\nstarts with TIF_SINGLESTEP/X86_EFLAGS_TF bits copied from ptraced parent.\nThis is not right, especially when the new child is not auto-attaced: in\nthis case it is killed by SIGTRAP.\n\nChange copy_process() to call user_disable_single_step(). Tested on x86.\n\nTest-case:\n\n\t#include \u003cstdio.h\u003e\n\t#include \u003cunistd.h\u003e\n\t#include \u003csignal.h\u003e\n\t#include \u003csys/ptrace.h\u003e\n\t#include \u003csys/wait.h\u003e\n\t#include \u003cassert.h\u003e\n\n\tint main(void)\n\t{\n\t\tint pid, status;\n\n\t\tif (!(pid \u003d fork())) {\n\t\t\tassert(ptrace(PTRACE_TRACEME) \u003d\u003d 0);\n\t\t\tkill(getpid(), SIGSTOP);\n\n\t\t\tif (!fork()) {\n\t\t\t\t/* kernel bug: this child will be killed by SIGTRAP */\n\t\t\t\tprintf(\"Hello world\\n\");\n\t\t\t\treturn 43;\n\t\t\t}\n\n\t\t\twait(\u0026status);\n\t\t\treturn WEXITSTATUS(status);\n\t\t}\n\n\t\tfor (;;) {\n\t\t\tassert(pid \u003d\u003d wait(\u0026status));\n\t\t\tif (WIFEXITED(status))\n\t\t\t\tbreak;\n\t\t\tassert(ptrace(PTRACE_SINGLESTEP, pid, 0,0) \u003d\u003d 0);\n\t\t}\n\n\t\tassert(WEXITSTATUS(status) \u003d\u003d 43);\n\t\treturn 0;\n\t}\n\nSigned-off-by: Oleg Nesterov \u003coleg@redhat.com\u003e\nAcked-by: Roland McGrath \u003croland@redhat.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b6cbd33dde807810981558c31236b3bb67fcae09",
      "old_mode": 33188,
      "old_path": "kernel/fork.c",
      "new_id": "202a0ba63d3c198a2c891536fc93b749abb955b2",
      "new_mode": 33188,
      "new_path": "kernel/fork.c"
    }
  ]
}
