)]}'
{
  "commit": "78a3e8889b4b6b99775ed954696ff3e017f5d19b",
  "tree": "1b5ddff554111204ed1649f1d50922055d0f713b",
  "parents": [
    "a9cbf0b2195b695cbeeeecaa4e2770948c212e9a"
  ],
  "author": {
    "name": "Cyril Bur",
    "email": "cyrilbur@gmail.com",
    "time": "Tue Aug 23 10:46:17 2016 +1000"
  },
  "committer": {
    "name": "Benjamin Herrenschmidt",
    "email": "benh@kernel.crashing.org",
    "time": "Mon Aug 29 12:48:40 2016 +1000"
  },
  "message": "powerpc: signals: Discard transaction state from signal frames\n\nUserspace can begin and suspend a transaction within the signal\nhandler which means they might enter sys_rt_sigreturn() with the\nprocessor in suspended state.\n\nsys_rt_sigreturn() wants to restore process context (which may have\nbeen in a transaction before signal delivery). To do this it must\nrestore TM SPRS. To achieve this, any transaction initiated within the\nsignal frame must be discarded in order to be able to restore TM SPRs\nas TM SPRs can only be manipulated non-transactionally..\n\u003eFrom the PowerPC ISA:\n  TM Bad Thing Exception [Category: Transactional Memory]\n   An attempt is made to execute a mtspr targeting a TM register in\n   other than Non-transactional state.\n\nNot doing so results in a TM Bad Thing:\n[12045.221359] Kernel BUG at c000000000050a40 [verbose debug info unavailable]\n[12045.221470] Unexpected TM Bad Thing exception at c000000000050a40 (msr 0x201033)\n[12045.221540] Oops: Unrecoverable exception, sig: 6 [#1]\n[12045.221586] SMP NR_CPUS\u003d2048 NUMA PowerNV\n[12045.221634] Modules linked in: xt_CHECKSUM iptable_mangle ipt_MASQUERADE\n nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4\n xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 xt_tcpudp bridge stp llc ebtable_filter\n ebtables ip6table_filter ip6_tables iptable_filter ip_tables x_tables kvm_hv kvm\n uio_pdrv_genirq ipmi_powernv uio powernv_rng ipmi_msghandler autofs4 ses enclosure\n scsi_transport_sas bnx2x ipr mdio libcrc32c\n[12045.222167] CPU: 68 PID: 6178 Comm: sigreturnpanic Not tainted 4.7.0 #34\n[12045.222224] task: c0000000fce38600 ti: c0000000fceb4000 task.ti: c0000000fceb4000\n[12045.222293] NIP: c000000000050a40 LR: c0000000000163bc CTR: 0000000000000000\n[12045.222361] REGS: c0000000fceb7ac0 TRAP: 0700   Not tainted (4.7.0)\n[12045.222418] MSR: 9000000300201033 \u003cSF,HV,ME,IR,DR,RI,LE,TM[SE]\u003e CR: 28444280  XER: 20000000\n[12045.222625] CFAR: c0000000000163b8 SOFTE: 0 PACATMSCRATCH: 900000014280f033\nGPR00: 01100000b8000001 c0000000fceb7d40 c00000000139c100 c0000000fce390d0\nGPR04: 900000034280f033 0000000000000000 0000000000000000 0000000000000000\nGPR08: 0000000000000000 b000000000001033 0000000000000001 0000000000000000\nGPR12: 0000000000000000 c000000002926400 0000000000000000 0000000000000000\nGPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000\nGPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000\nGPR24: 0000000000000000 00003ffff98cadd0 00003ffff98cb470 0000000000000000\nGPR28: 900000034280f033 c0000000fceb7ea0 0000000000000001 c0000000fce390d0\n[12045.223535] NIP [c000000000050a40] tm_restore_sprs+0xc/0x1c\n[12045.223584] LR [c0000000000163bc] tm_recheckpoint+0x5c/0xa0\n[12045.223630] Call Trace:\n[12045.223655] [c0000000fceb7d80] [c000000000026e74] sys_rt_sigreturn+0x494/0x6c0\n[12045.223738] [c0000000fceb7e30] [c0000000000092e0] system_call+0x38/0x108\n[12045.223806] Instruction dump:\n[12045.223841] 7c800164 4e800020 7c0022a6 f80304a8 7c0222a6 f80304b0 7c0122a6 f80304b8\n[12045.223955] 4e800020 e80304a8 7c0023a6 e80304b0 \u003c7c0223a6\u003e e80304b8 7c0123a6 4e800020\n[12045.224074] ---[ end trace cb8002ee240bae76 ]---\n\nIt isn\u0027t clear exactly if there is really a use case for userspace\nreturning with a suspended transaction, however, doing so doesn\u0027t (on\nits own) constitute a bad frame. As such, this patch simply discards\nthe transactional state of the context calling the sigreturn and\ncontinues.\n\nReported-by: Laurent Dufour \u003cldufour@linux.vnet.ibm.com\u003e\nSigned-off-by: Cyril Bur \u003ccyrilbur@gmail.com\u003e\nTested-by: Laurent Dufour \u003cldufour@linux.vnet.ibm.com\u003e\nReviewed-by: Laurent Dufour \u003cldufour@linux.vnet.ibm.com\u003e\nAcked-by: Simon Guo \u003cwei.guo.simon@gmail.com\u003e\nSigned-off-by: Benjamin Herrenschmidt \u003cbenh@kernel.crashing.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ba0a2a4a54ba1ffcb484786381b91f5113a62ad6",
      "old_mode": 33188,
      "old_path": "Documentation/powerpc/transactional_memory.txt",
      "new_id": "e32fdbb4c9a7a284976d624037df1ff4c655958c",
      "new_mode": 33188,
      "new_path": "Documentation/powerpc/transactional_memory.txt"
    },
    {
      "type": "modify",
      "old_id": "b6aa378aff636800a668ac67e525827fefd1ae76",
      "old_mode": 33188,
      "old_path": "arch/powerpc/kernel/signal_32.c",
      "new_id": "a7daf749b97f272ba4819646b9f2515fb845c29a",
      "new_mode": 33188,
      "new_path": "arch/powerpc/kernel/signal_32.c"
    },
    {
      "type": "modify",
      "old_id": "7e49984d4331543de9a3d88f24d23a67b48e76df",
      "old_mode": 33188,
      "old_path": "arch/powerpc/kernel/signal_64.c",
      "new_id": "70409bb90a957f8d62a5f1b5c1be69aee12e6c91",
      "new_mode": 33188,
      "new_path": "arch/powerpc/kernel/signal_64.c"
    }
  ]
}
