)]}'
{
  "commit": "635cf99a80f4ebee59d70eb64bb85ce829e4591f",
  "tree": "6c204f34a959d62852812a85faefec5e5bd81b1f",
  "parents": [
    "db753bdfc24c31228996799d508ce3bf7cbe3b99"
  ],
  "author": {
    "name": "Chuck Ebbert",
    "email": "76306.1226@compuserve.com",
    "time": "Thu Mar 23 02:59:48 2006 -0800"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@g5.osdl.org",
    "time": "Thu Mar 23 07:38:05 2006 -0800"
  },
  "message": "[PATCH] i386: fix singlestep through an int80 syscall\n\nUsing PTRACE_SINGLESTEP on a child that does an int80 syscall misses the\nSIGTRAP that should be delivered upon syscall exit.  Fix that by setting\nTIF_SINGLESTEP when entering the kernel via int80 with TF set.\n\n/* Test whether singlestep through an int80 syscall works.\n */\n#define _GNU_SOURCE\n#include \u003cstdio.h\u003e\n#include \u003cunistd.h\u003e\n#include \u003cfcntl.h\u003e\n#include \u003csys/ptrace.h\u003e\n#include \u003csys/wait.h\u003e\n#include \u003csys/mman.h\u003e\n#include \u003casm/user.h\u003e\n\nstatic int child, status;\nstatic struct user_regs_struct regs;\n\nstatic void do_child()\n{\n\tptrace(PTRACE_TRACEME, 0, 0, 0);\n\tkill(getpid(), SIGUSR1);\n\tasm (\"int $0x80\" : : \"a\" (20)); /* getpid */\n}\n\nstatic void do_parent()\n{\n\tunsigned long eip, expected \u003d 0;\nagain:\n\twaitpid(child, \u0026status, 0);\n\tif (WIFEXITED(status) || WIFSIGNALED(status))\n\t\treturn;\n\n\tif (WIFSTOPPED(status)) {\n\t\tptrace(PTRACE_GETREGS, child, 0, \u0026regs);\n\t\teip \u003d regs.eip;\n\t\tif (expected)\n\t\t\tfprintf(stderr, \"child stop @ %08x, expected %08x %s\\n\",\n\t\t\t\t\teip, expected,\n\t\t\t\t\teip \u003d\u003d expected ? \"\" : \" \u003c\u003d\u003d ERROR\");\n\n\t\tif (*(unsigned short *)eip \u003d\u003d 0x80cd) {\n\t\t\tfprintf(stderr, \"int 0x80 at %08x\\n\", (unsigned int)eip);\n\t\t\texpected \u003d eip + 2;\n\t\t} else\n\t\t\texpected \u003d 0;\n\n\t\tptrace(PTRACE_SINGLESTEP, child, NULL, NULL);\n\t}\n\tgoto again;\n}\n\nint main(int argc, char * const argv[])\n{\n\tchild \u003d fork();\n\tif (child)\n\t\tdo_parent();\n\telse\n\t\tdo_child();\n\treturn 0;\n}\n\nSigned-off-by: Chuck Ebbert \u003c76306.1226@compuserve.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4d704724b2f5bfeb00f72e23735d0e8290893e8e",
      "old_mode": 33188,
      "old_path": "arch/i386/kernel/entry.S",
      "new_id": "cfc683f153b916b1d57e27769fd8f8de132bbb7f",
      "new_mode": 33188,
      "new_path": "arch/i386/kernel/entry.S"
    }
  ]
}
