)]}'
{
  "commit": "bb65a0da99bf4861dce01149ba64e875e47ae5a3",
  "tree": "998b134681498a060c030568a5e3af1376277650",
  "parents": [
    "38c7f3b1f51b5d7926be0caf674ad724779390be"
  ],
  "author": {
    "name": "Jianbo Liu",
    "email": "jianbol@nvidia.com",
    "time": "Wed Nov 25 04:08:35 2026 +0200"
  },
  "committer": {
    "name": "Steffen Klassert",
    "email": "steffen.klassert@secunet.com",
    "time": "Mon Nov 30 11:36:34 2026 +0100"
  },
  "message": "xfrm: Serialize offload stats updates with x-\u003elock\n\nxfrm_dev_state_update_stats() calls into the driver, which adds to\nx-\u003ecurlft and x-\u003estats what the device counted since the last call.\nCallers use different locks, so two of them can refresh the same\nstate at once and count the same packets twice, and a dump can copy\nthe counters while another caller updates them.\n\nSerialize all device stats refreshes with x-\u003elock and assert it in\nxfrm_dev_state_update_stats(). Build the SA message of a netlink\ndump, get or notification under the same lock.\n\nThe SA dump and xfrm_state_update_stats() walk the states under\nxfrm_state_lock, where x-\u003elock cannot be taken: the lock order is\nx-\u003elock, then xfrm_state_lock. Add xfrm_state_walk_batch(), which\ntakes references on at most 32 states per xfrm_state_lock hold, and\nhandle each state under x-\u003elock after the list lock is dropped.\nStates rejected by the dump filter count against the 32, so a filter\nthat matches few states cannot keep the list lock held over the whole\nlist. xfrm_state_walk() cannot give this bound: it calls back only\nfor states that pass the filter. Walk markers and states being\ndeleted do not count, so a call always covers 32 states or reaches\nthe end of the list.\n\nKeep the refresh right before each state is copied, so every part of\na multi-part dump still has current counters. When a state does not\nfit into the skb, put the walk marker back in front of it and drop\nthe references, so no state stays referenced between two dump calls.\nIf the state was unlinked meanwhile, skip it and go on.\n\ncopy_to_user_state() cannot take x-\u003elock itself: build_expire() calls\nit with the lock held. Move the refresh out of it and let each caller\nrefresh under x-\u003elock. PF_KEY never refreshed and does not change.\n\nFixes: c9fa320b00cf (\"xfrm: copy_to_user_state fetch offloaded SA packets/bytes statistics\")\nFixes: f9f221c98fd8 (\"xfrm: get global statistics from the offloaded device\")\nSigned-off-by: Jianbo Liu \u003cjianbol@nvidia.com\u003e\nReviewed-by: Carolina Jubran \u003ccjubran@nvidia.com\u003e\nSigned-off-by: Steffen Klassert \u003csteffen.klassert@secunet.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "cd37aa69c9ac993ea403e7eb2bba7a7afa6e595f",
      "old_mode": 33188,
      "old_path": "include/net/xfrm.h",
      "new_id": "47aae21ea1cb161d841ae27e2fcd673a9cdf2c80",
      "new_mode": 33188,
      "new_path": "include/net/xfrm.h"
    },
    {
      "type": "modify",
      "old_id": "d48c88f2df64f9baeae2d569725ac3dc8ba46ab5",
      "old_mode": 33188,
      "old_path": "net/xfrm/xfrm_state.c",
      "new_id": "d7b00be32203197ddb93e5321fce19ebbb91786c",
      "new_mode": 33188,
      "new_path": "net/xfrm/xfrm_state.c"
    },
    {
      "type": "modify",
      "old_id": "217f65faa2bd38b4306d4390602b2d9e55d9bb0d",
      "old_mode": 33188,
      "old_path": "net/xfrm/xfrm_user.c",
      "new_id": "94f73349d22d21978e26318178bcdad9ba329e64",
      "new_mode": 33188,
      "new_path": "net/xfrm/xfrm_user.c"
    }
  ]
}
