)]}'
{
  "commit": "f65846a1800ef8c48d1ae1973c30dae4c356a800",
  "tree": "87bd07485309f57d4002a5cd634636e9a2ce3025",
  "parents": [
    "f6161aa153581da4a3867a2d1a7caf4be19b6ec9"
  ],
  "author": {
    "name": "Paul E. McKenney",
    "email": "paulmck@linux.vnet.ibm.com",
    "time": "Sat Mar 09 07:38:41 2013 -0800"
  },
  "committer": {
    "name": "Paul E. McKenney",
    "email": "paulmck@linux.vnet.ibm.com",
    "time": "Thu Mar 14 13:18:30 2013 -0700"
  },
  "message": "list: Fix double fetch of pointer in hlist_entry_safe()\n\nThe current version of hlist_entry_safe() fetches the pointer twice,\nonce to test for NULL and the other to compute the offset back to the\nenclosing structure.  This is OK for normal lock-based use because in\nthat case, the pointer cannot change.  However, when the pointer is\nprotected by RCU (as in \"rcu_dereference(p)\"), then the pointer can\nchange at any time.  This use case can result in the following sequence\nof events:\n\n1.\tCPU 0 invokes hlist_entry_safe(), fetches the RCU-protected\n\tpointer as sees that it is non-NULL.\n\n2.\tCPU 1 invokes hlist_del_rcu(), deleting the entry that CPU 0\n\tjust fetched a pointer to.  Because this is the last entry\n\tin the list, the pointer fetched by CPU 0 is now NULL.\n\n3.\tCPU 0 refetches the pointer, obtains NULL, and then gets a\n\tNULL-pointer crash.\n\nThis commit therefore applies gcc\u0027s \"({ })\" statement expression to\ncreate a temporary variable so that the specified pointer is fetched\nonly once, avoiding the above sequence of events.  Please note that\nit is the caller\u0027s responsibility to use rcu_dereference() as needed.\nThis allows RCU-protected uses to work correctly without imposing\nany additional overhead on the non-RCU case.\n\nMany thanks to Eric Dumazet for spotting root cause!\n\nReported-by: CAI Qian \u003ccaiqian@redhat.com\u003e\nReported-by: Eric Dumazet \u003ceric.dumazet@gmail.com\u003e\nSigned-off-by: Paul E. McKenney \u003cpaulmck@linux.vnet.ibm.com\u003e\nTested-by: Li Zefan \u003clizefan@huawei.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d991cc147c98f81fbca56ca0cbdf6a6b62aa6c3e",
      "old_mode": 33188,
      "old_path": "include/linux/list.h",
      "new_id": "6a1f8df9144bcfd5c1af3e9cbad600fe61749c29",
      "new_mode": 33188,
      "new_path": "include/linux/list.h"
    }
  ]
}
