)]}'
{
  "commit": "8a7f2bff2165e53595d1e91c160b340f978c0ab7",
  "tree": "6e262d82bedfd15931da17570ac2c044f59f9353",
  "parents": [
    "c169a2a5fd9cfdb2ae93cf6d86be4d2a5e3d813c"
  ],
  "author": {
    "name": "Woojin Ji",
    "email": "random6.xyz@gmail.com",
    "time": "Wed Jun 03 09:33:39 2026 +0900"
  },
  "committer": {
    "name": "Andrii Nakryiko",
    "email": "andrii@kernel.org",
    "time": "Wed Jun 03 15:30:23 2026 -0700"
  },
  "message": "bpftool: Use libbpf error code for flow dissector query\n\nbpf_prog_query() returns a negative errno on failure.\nquery_flow_dissector() currently closes the namespace fd and then reads\nerrno to decide whether -EINVAL means that the running kernel does not\nsupport flow dissector queries.\n\nThat errno check controls behavior, not just diagnostics: -EINVAL is\nhandled as a non-fatal old-kernel case, while any other error makes bpftool\nnet fail.\n\nThe namespace fd is opened read-only, so close() is not expected to\ncommonly fail in normal use. Still, the BPF_PROG_QUERY error is already\navailable in err, and reading errno after an intervening close() is\nfragile. If close() does change errno, the compatibility branch may be\nbased on close()\u0027s error instead of the BPF_PROG_QUERY result.\n\nThis was reproduced with an LD_PRELOAD fault injector that forced\nBPF_PROG_QUERY for BPF_FLOW_DISSECTOR to fail with EINVAL and then\nforced close() on the netns fd to fail with EIO. The unpatched bpftool\nreported \"can\u0027t query prog: Input/output error\". With this change, the\nsame injected failure is handled as the intended non-fatal EINVAL\ncompatibility case.\n\nUse the libbpf-returned error code instead. Keep the existing errno reset\nin the non-fatal path to preserve batch mode behavior. The success path\nis unchanged.\n\nFixes: 7f0c57fec80f (\"bpftool: show flow_dissector attachment status\")\nSigned-off-by: Woojin Ji \u003crandom6.xyz@gmail.com\u003e\nSigned-off-by: Andrii Nakryiko \u003candrii@kernel.org\u003e\nAcked-by: Leon Hwang \u003cleon.hwang@linux.dev\u003e\nAcked-by: Yonghong Song \u003cyonghong.song@linux.dev\u003e\nAcked-by: Quentin Monnet \u003cqmo@kernel.org\u003e\nLink: https://lore.kernel.org/bpf/20260603003339.33791-1-random6.xyz@gmail.com\n\nAssisted-by: ChatGPT:gpt-5.5\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "974189da8a916a3f2119953abf8cf355588cb017",
      "old_mode": 33188,
      "old_path": "tools/bpf/bpftool/net.c",
      "new_id": "dba28755d2849066987beec4886e361ed9431804",
      "new_mode": 33188,
      "new_path": "tools/bpf/bpftool/net.c"
    }
  ]
}
