)]}'
{
  "commit": "bf2ae2e4bf9360e07c0cdfa166bcdc0afd92f4ce",
  "tree": "2f0c209f6a4056f3b51ecfdceee2a549875e9ece",
  "parents": [
    "9e5fb7207024e53700bdac23f53d1e44d530a7f6"
  ],
  "author": {
    "name": "Xin Long",
    "email": "lucien.xin@gmail.com",
    "time": "Sat Mar 10 18:57:50 2018 +0800"
  },
  "committer": {
    "name": "David S. Miller",
    "email": "davem@davemloft.net",
    "time": "Mon Mar 12 11:03:42 2018 -0400"
  },
  "message": "sock_diag: request _diag module only when the family or proto has been registered\n\nNow when using \u0027ss\u0027 in iproute, kernel would try to load all _diag\nmodules, which also causes corresponding family and proto modules\nto be loaded as well due to module dependencies.\n\nLike after running \u0027ss\u0027, sctp, dccp, af_packet (if it works as a module)\nwould be loaded.\n\nFor example:\n\n  $ lsmod|grep sctp\n  $ ss\n  $ lsmod|grep sctp\n  sctp_diag              16384  0\n  sctp                  323584  5 sctp_diag\n  inet_diag              24576  4 raw_diag,tcp_diag,sctp_diag,udp_diag\n  libcrc32c              16384  3 nf_conntrack,nf_nat,sctp\n\nAs these family and proto modules are loaded unintentionally, it\ncould cause some problems, like:\n\n- Some debug tools use \u0027ss\u0027 to collect the socket info, which loads all\n  those diag and family and protocol modules. It\u0027s noisy for identifying\n  issues.\n\n- Users usually expect to drop sctp init packet silently when they\n  have no sense of sctp protocol instead of sending abort back.\n\n- It wastes resources (especially with multiple netns), and SCTP module\n  can\u0027t be unloaded once it\u0027s loaded.\n\n...\n\nIn short, it\u0027s really inappropriate to have these family and proto\nmodules loaded unexpectedly when just doing debugging with inet_diag.\n\nThis patch is to introduce sock_load_diag_module() where it loads\nthe _diag module only when it\u0027s corresponding family or proto has\nbeen already registered.\n\nNote that we can\u0027t just load _diag module without the family or\nproto loaded, as some symbols used in _diag module are from the\nfamily or proto module.\n\nv1-\u003ev2:\n  - move inet proto check to inet_diag to avoid a compiling err.\nv2-\u003ev3:\n  - define sock_load_diag_module in sock.c and export one symbol\n    only.\n  - improve the changelog.\n\nReported-by: Sabrina Dubroca \u003csd@queasysnail.net\u003e\nAcked-by: Marcelo Ricardo Leitner \u003cmarcelo.leitner@gmail.com\u003e\nAcked-by: Phil Sutter \u003cphil@nwl.cc\u003e\nAcked-by: Sabrina Dubroca \u003csd@queasysnail.net\u003e\nSigned-off-by: Xin Long \u003clucien.xin@gmail.com\u003e\nSigned-off-by: David S. Miller \u003cdavem@davemloft.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "91216b16feb78e0a19b2129aa5c390fd0cd7eaff",
      "old_mode": 33188,
      "old_path": "include/linux/net.h",
      "new_id": "2a0391eea05c3612b2ef560ed4852811fd16dfff",
      "new_mode": 33188,
      "new_path": "include/linux/net.h"
    },
    {
      "type": "modify",
      "old_id": "169c92afcafa3d548f8238e91606b87c187559f4",
      "old_mode": 33188,
      "old_path": "include/net/sock.h",
      "new_id": "ae23f3b389cac6bcf7f270a4cd2ae3498b2d5ad5",
      "new_mode": 33188,
      "new_path": "include/net/sock.h"
    },
    {
      "type": "modify",
      "old_id": "c501499a04fe973e80e18655b306d762d348ff44",
      "old_mode": 33188,
      "old_path": "net/core/sock.c",
      "new_id": "85b0b64e7f9dd565b5e85579ce43b78ddb65dc86",
      "new_mode": 33188,
      "new_path": "net/core/sock.c"
    },
    {
      "type": "modify",
      "old_id": "146b50e30659daca3bdc4413d800890ef482f521",
      "old_mode": 33188,
      "old_path": "net/core/sock_diag.c",
      "new_id": "c37b5be7c5e4f0b4b91267b34c5ba867e90cbc69",
      "new_mode": 33188,
      "new_path": "net/core/sock_diag.c"
    },
    {
      "type": "modify",
      "old_id": "a383f299ce246bd84b28bad1909bae600ad699c0",
      "old_mode": 33188,
      "old_path": "net/ipv4/inet_diag.c",
      "new_id": "4e5bc4b2f14e6786ceb7d63e5902f8fc17819dfa",
      "new_mode": 33188,
      "new_path": "net/ipv4/inet_diag.c"
    },
    {
      "type": "modify",
      "old_id": "a93c99b518cab69b67d53a71298d15ce17c4d06b",
      "old_mode": 33188,
      "old_path": "net/socket.c",
      "new_id": "08847c3b8c39f708a0d11fb35184852b22a40835",
      "new_mode": 33188,
      "new_path": "net/socket.c"
    }
  ]
}
