)]}'
{
  "commit": "91c66c6893a3e2bb8a88a30cb76007d5d49d32c9",
  "tree": "1f37d40b668d46f305dd9088737c72ece4a91533",
  "parents": [
    "00fe1ae91e0d69e52e8212d23cd3ecc74a7259a0"
  ],
  "author": {
    "name": "Jesper Juhl",
    "email": "jj@chaosbits.net",
    "time": "Fri Jul 29 16:38:49 2011 +0200"
  },
  "committer": {
    "name": "Patrick McHardy",
    "email": "kaber@trash.net",
    "time": "Fri Jul 29 16:38:49 2011 +0200"
  },
  "message": "netfilter: ip_queue: Fix small leak in ipq_build_packet_message()\n\nipq_build_packet_message() in net/ipv4/netfilter/ip_queue.c and\nnet/ipv6/netfilter/ip6_queue.c contain a small potential mem leak as\nfar as I can tell.\n\nWe allocate memory for \u0027skb\u0027 with alloc_skb() annd then call\n nlh \u003d NLMSG_PUT(skb, 0, 0, IPQM_PACKET, size - sizeof(*nlh));\n\nNLMSG_PUT is a macro\n NLMSG_PUT(skb, pid, seq, type, len) \\\n  \t\tNLMSG_NEW(skb, pid, seq, type, len, 0)\n\nthat expands to NLMSG_NEW, which is also a macro which expands to:\n NLMSG_NEW(skb, pid, seq, type, len, flags) \\\n  \t({\tif (unlikely(skb_tailroom(skb) \u003c (int)NLMSG_SPACE(len))) \\\n  \t\t\tgoto nlmsg_failure; \\\n  \t\t__nlmsg_put(skb, pid, seq, type, len, flags); })\n\nIf we take the true branch of the \u0027if\u0027 statement and \u0027goto\nnlmsg_failure\u0027, then we\u0027ll, at that point, return from\nipq_build_packet_message() without having assigned \u0027skb\u0027 to anything\nand we\u0027ll leak the memory we allocated for it when it goes out of\nscope.\n\nFix this by placing a \u0027kfree(skb)\u0027 at \u0027nlmsg_failure\u0027.\n\nI admit that I do not know how likely this to actually happen or even\nif there\u0027s something that guarantees that it will never happen - I\u0027m\nnot that familiar with this code, but if that is so, I\u0027ve not been\nable to spot it.\n\nSigned-off-by: Jesper Juhl \u003cjj@chaosbits.net\u003e\nSigned-off-by: Patrick McHardy \u003ckaber@trash.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5c9b9d963918aa538086239d2351afea574324cb",
      "old_mode": 33188,
      "old_path": "net/ipv4/netfilter/ip_queue.c",
      "new_id": "48f7d5b4ff37adeb6687ade0649f7ed88aa7e688",
      "new_mode": 33188,
      "new_path": "net/ipv4/netfilter/ip_queue.c"
    },
    {
      "type": "modify",
      "old_id": "249394863284bcb2edcb3228183a953393df1a26",
      "old_mode": 33188,
      "old_path": "net/ipv6/netfilter/ip6_queue.c",
      "new_id": "87b243a25afa6688c09f16417bf697592071fac4",
      "new_mode": 33188,
      "new_path": "net/ipv6/netfilter/ip6_queue.c"
    }
  ]
}
