Hi Lorenzo, [auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Lorenzo-Colitti/net-inet-diag-expose-the-socket-mark-to-privileged-processes/20160907-181944 config: x86_64-randconfig-s2-09071905 (attached as .config) compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All warnings (new ones prefixed by >>): In file included from include/uapi/linux/stddef.h:1:0, from include/linux/stddef.h:4, from include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/list.h:4, from include/linux/module.h:9, from net/sctp/sctp_diag.c:1: net/sctp/sctp_diag.c: In function 'inet_sctp_diag_fill': net/sctp/sctp_diag.c:136:6: error: too few arguments to function 'inet_diag_msg_attrs_fill' if (inet_diag_msg_attrs_fill(sk, skb, r, ext, user_ns)) ^ include/linux/compiler.h:149:30: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^~~~ >> net/sctp/sctp_diag.c:136:2: note: in expansion of macro 'if' if (inet_diag_msg_attrs_fill(sk, skb, r, ext, user_ns)) ^~ In file included from net/sctp/sctp_diag.c:2:0: include/linux/inet_diag.h:57:5: note: declared here int inet_diag_msg_attrs_fill(struct sock *sk, struct sk_buff *skb, ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from include/uapi/linux/stddef.h:1:0, from include/linux/stddef.h:4, from include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/list.h:4, from include/linux/module.h:9, from net/sctp/sctp_diag.c:1: net/sctp/sctp_diag.c:136:6: error: too few arguments to function 'inet_diag_msg_attrs_fill' if (inet_diag_msg_attrs_fill(sk, skb, r, ext, user_ns)) ^ include/linux/compiler.h:149:42: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^~~~ >> net/sctp/sctp_diag.c:136:2: note: in expansion of macro 'if' if (inet_diag_msg_attrs_fill(sk, skb, r, ext, user_ns)) ^~ In file included from net/sctp/sctp_diag.c:2:0: include/linux/inet_diag.h:57:5: note: declared here int inet_diag_msg_attrs_fill(struct sock *sk, struct sk_buff *skb, ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from include/uapi/linux/stddef.h:1:0, from include/linux/stddef.h:4, from include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/list.h:4, from include/linux/module.h:9, from net/sctp/sctp_diag.c:1: net/sctp/sctp_diag.c:136:6: error: too few arguments to function 'inet_diag_msg_attrs_fill' if (inet_diag_msg_attrs_fill(sk, skb, r, ext, user_ns)) ^ include/linux/compiler.h:160:16: note: in definition of macro '__trace_if' ______r = !!(cond); \ ^~~~ >> net/sctp/sctp_diag.c:136:2: note: in expansion of macro 'if' if (inet_diag_msg_attrs_fill(sk, skb, r, ext, user_ns)) ^~ In file included from net/sctp/sctp_diag.c:2:0: include/linux/inet_diag.h:57:5: note: declared here int inet_diag_msg_attrs_fill(struct sock *sk, struct sk_buff *skb, ^~~~~~~~~~~~~~~~~~~~~~~~ vim +/if +136 net/sctp/sctp_diag.c 8f840e47 Xin Long 2016-04-14 @1 #include <linux/module.h> 8f840e47 Xin Long 2016-04-14 2 #include <linux/inet_diag.h> 8f840e47 Xin Long 2016-04-14 3 #include <linux/sock_diag.h> 8f840e47 Xin Long 2016-04-14 4 #include <net/sctp/sctp.h> 8f840e47 Xin Long 2016-04-14 5 8f840e47 Xin Long 2016-04-14 6 static void sctp_diag_get_info(struct sock *sk, struct inet_diag_msg *r, 8f840e47 Xin Long 2016-04-14 7 void *info); 8f840e47 Xin Long 2016-04-14 8 8f840e47 Xin Long 2016-04-14 9 /* define some functions to make asoc/ep fill look clean */ 8f840e47 Xin Long 2016-04-14 10 static void inet_diag_msg_sctpasoc_fill(struct inet_diag_msg *r, 8f840e47 Xin Long 2016-04-14 11 struct sock *sk, 8f840e47 Xin Long 2016-04-14 12 struct sctp_association *asoc) 8f840e47 Xin Long 2016-04-14 13 { 8f840e47 Xin Long 2016-04-14 14 union sctp_addr laddr, paddr; 8f840e47 Xin Long 2016-04-14 15 struct dst_entry *dst; 12474e8e Phil Sutter 2016-08-04 16 struct timer_list *t3_rtx = &asoc->peer.primary_path->T3_rtx_timer; 8f840e47 Xin Long 2016-04-14 17 8f840e47 Xin Long 2016-04-14 18 laddr = list_entry(asoc->base.bind_addr.address_list.next, 8f840e47 Xin Long 2016-04-14 19 struct sctp_sockaddr_entry, list)->a; 8f840e47 Xin Long 2016-04-14 20 paddr = asoc->peer.primary_path->ipaddr; 8f840e47 Xin Long 2016-04-14 21 dst = asoc->peer.primary_path->dst; 8f840e47 Xin Long 2016-04-14 22 8f840e47 Xin Long 2016-04-14 23 r->idiag_family = sk->sk_family; 8f840e47 Xin Long 2016-04-14 24 r->id.idiag_sport = htons(asoc->base.bind_addr.port); 8f840e47 Xin Long 2016-04-14 25 r->id.idiag_dport = htons(asoc->peer.port); 8f840e47 Xin Long 2016-04-14 26 r->id.idiag_if = dst ? dst->dev->ifindex : 0; 8f840e47 Xin Long 2016-04-14 27 sock_diag_save_cookie(sk, r->id.idiag_cookie); 8f840e47 Xin Long 2016-04-14 28 8f840e47 Xin Long 2016-04-14 29 #if IS_ENABLED(CONFIG_IPV6) 8f840e47 Xin Long 2016-04-14 30 if (sk->sk_family == AF_INET6) { 8f840e47 Xin Long 2016-04-14 31 *(struct in6_addr *)r->id.idiag_src = laddr.v6.sin6_addr; 8f840e47 Xin Long 2016-04-14 32 *(struct in6_addr *)r->id.idiag_dst = paddr.v6.sin6_addr; 8f840e47 Xin Long 2016-04-14 33 } else 8f840e47 Xin Long 2016-04-14 34 #endif 8f840e47 Xin Long 2016-04-14 35 { 8f840e47 Xin Long 2016-04-14 36 memset(&r->id.idiag_src, 0, sizeof(r->id.idiag_src)); 8f840e47 Xin Long 2016-04-14 37 memset(&r->id.idiag_dst, 0, sizeof(r->id.idiag_dst)); 8f840e47 Xin Long 2016-04-14 38 8f840e47 Xin Long 2016-04-14 39 r->id.idiag_src[0] = laddr.v4.sin_addr.s_addr; 8f840e47 Xin Long 2016-04-14 40 r->id.idiag_dst[0] = paddr.v4.sin_addr.s_addr; 8f840e47 Xin Long 2016-04-14 41 } 8f840e47 Xin Long 2016-04-14 42 8f840e47 Xin Long 2016-04-14 43 r->idiag_state = asoc->state; 12474e8e Phil Sutter 2016-08-04 44 if (timer_pending(t3_rtx)) { 8f840e47 Xin Long 2016-04-14 45 r->idiag_timer = SCTP_EVENT_TIMEOUT_T3_RTX; 8f840e47 Xin Long 2016-04-14 46 r->idiag_retrans = asoc->rtx_data_chunks; 12474e8e Phil Sutter 2016-08-04 47 r->idiag_expires = jiffies_to_msecs(t3_rtx->expires - jiffies); 12474e8e Phil Sutter 2016-08-04 48 } else { 12474e8e Phil Sutter 2016-08-04 49 r->idiag_timer = 0; 12474e8e Phil Sutter 2016-08-04 50 r->idiag_retrans = 0; 12474e8e Phil Sutter 2016-08-04 51 r->idiag_expires = 0; 12474e8e Phil Sutter 2016-08-04 52 } 8f840e47 Xin Long 2016-04-14 53 } 8f840e47 Xin Long 2016-04-14 54 8f840e47 Xin Long 2016-04-14 55 static int inet_diag_msg_sctpladdrs_fill(struct sk_buff *skb, 8f840e47 Xin Long 2016-04-14 56 struct list_head *address_list) 8f840e47 Xin Long 2016-04-14 57 { 8f840e47 Xin Long 2016-04-14 58 struct sctp_sockaddr_entry *laddr; 8f840e47 Xin Long 2016-04-14 59 int addrlen = sizeof(struct sockaddr_storage); 8f840e47 Xin Long 2016-04-14 60 int addrcnt = 0; 8f840e47 Xin Long 2016-04-14 61 struct nlattr *attr; 8f840e47 Xin Long 2016-04-14 62 void *info = NULL; 8f840e47 Xin Long 2016-04-14 63 8f840e47 Xin Long 2016-04-14 64 list_for_each_entry_rcu(laddr, address_list, list) 8f840e47 Xin Long 2016-04-14 65 addrcnt++; 8f840e47 Xin Long 2016-04-14 66 8f840e47 Xin Long 2016-04-14 67 attr = nla_reserve(skb, INET_DIAG_LOCALS, addrlen * addrcnt); 8f840e47 Xin Long 2016-04-14 68 if (!attr) 8f840e47 Xin Long 2016-04-14 69 return -EMSGSIZE; 8f840e47 Xin Long 2016-04-14 70 8f840e47 Xin Long 2016-04-14 71 info = nla_data(attr); 8f840e47 Xin Long 2016-04-14 72 list_for_each_entry_rcu(laddr, address_list, list) { 8f840e47 Xin Long 2016-04-14 73 memcpy(info, &laddr->a, addrlen); 8f840e47 Xin Long 2016-04-14 74 info += addrlen; 8f840e47 Xin Long 2016-04-14 75 } 8f840e47 Xin Long 2016-04-14 76 8f840e47 Xin Long 2016-04-14 77 return 0; 8f840e47 Xin Long 2016-04-14 78 } 8f840e47 Xin Long 2016-04-14 79 8f840e47 Xin Long 2016-04-14 80 static int inet_diag_msg_sctpaddrs_fill(struct sk_buff *skb, 8f840e47 Xin Long 2016-04-14 81 struct sctp_association *asoc) 8f840e47 Xin Long 2016-04-14 82 { 8f840e47 Xin Long 2016-04-14 83 int addrlen = sizeof(struct sockaddr_storage); 8f840e47 Xin Long 2016-04-14 84 struct sctp_transport *from; 8f840e47 Xin Long 2016-04-14 85 struct nlattr *attr; 8f840e47 Xin Long 2016-04-14 86 void *info = NULL; 8f840e47 Xin Long 2016-04-14 87 8f840e47 Xin Long 2016-04-14 88 attr = nla_reserve(skb, INET_DIAG_PEERS, 8f840e47 Xin Long 2016-04-14 89 addrlen * asoc->peer.transport_count); 8f840e47 Xin Long 2016-04-14 90 if (!attr) 8f840e47 Xin Long 2016-04-14 91 return -EMSGSIZE; 8f840e47 Xin Long 2016-04-14 92 8f840e47 Xin Long 2016-04-14 93 info = nla_data(attr); 8f840e47 Xin Long 2016-04-14 94 list_for_each_entry(from, &asoc->peer.transport_addr_list, 8f840e47 Xin Long 2016-04-14 95 transports) { 8f840e47 Xin Long 2016-04-14 96 memcpy(info, &from->ipaddr, addrlen); 8f840e47 Xin Long 2016-04-14 97 info += addrlen; 8f840e47 Xin Long 2016-04-14 98 } 8f840e47 Xin Long 2016-04-14 99 8f840e47 Xin Long 2016-04-14 100 return 0; 8f840e47 Xin Long 2016-04-14 101 } 8f840e47 Xin Long 2016-04-14 102 8f840e47 Xin Long 2016-04-14 103 /* sctp asoc/ep fill*/ 8f840e47 Xin Long 2016-04-14 104 static int inet_sctp_diag_fill(struct sock *sk, struct sctp_association *asoc, 8f840e47 Xin Long 2016-04-14 105 struct sk_buff *skb, 8f840e47 Xin Long 2016-04-14 106 const struct inet_diag_req_v2 *req, 8f840e47 Xin Long 2016-04-14 107 struct user_namespace *user_ns, 8f840e47 Xin Long 2016-04-14 108 int portid, u32 seq, u16 nlmsg_flags, 8f840e47 Xin Long 2016-04-14 109 const struct nlmsghdr *unlh) 8f840e47 Xin Long 2016-04-14 110 { 8f840e47 Xin Long 2016-04-14 111 struct sctp_endpoint *ep = sctp_sk(sk)->ep; 8f840e47 Xin Long 2016-04-14 112 struct list_head *addr_list; 8f840e47 Xin Long 2016-04-14 113 struct inet_diag_msg *r; 8f840e47 Xin Long 2016-04-14 114 struct nlmsghdr *nlh; 8f840e47 Xin Long 2016-04-14 115 int ext = req->idiag_ext; 8f840e47 Xin Long 2016-04-14 116 struct sctp_infox infox; 8f840e47 Xin Long 2016-04-14 117 void *info = NULL; 8f840e47 Xin Long 2016-04-14 118 8f840e47 Xin Long 2016-04-14 119 nlh = nlmsg_put(skb, portid, seq, unlh->nlmsg_type, sizeof(*r), 8f840e47 Xin Long 2016-04-14 120 nlmsg_flags); 8f840e47 Xin Long 2016-04-14 121 if (!nlh) 8f840e47 Xin Long 2016-04-14 122 return -EMSGSIZE; 8f840e47 Xin Long 2016-04-14 123 8f840e47 Xin Long 2016-04-14 124 r = nlmsg_data(nlh); 8f840e47 Xin Long 2016-04-14 125 BUG_ON(!sk_fullsock(sk)); 8f840e47 Xin Long 2016-04-14 126 8f840e47 Xin Long 2016-04-14 127 if (asoc) { 8f840e47 Xin Long 2016-04-14 128 inet_diag_msg_sctpasoc_fill(r, sk, asoc); 8f840e47 Xin Long 2016-04-14 129 } else { 8f840e47 Xin Long 2016-04-14 130 inet_diag_msg_common_fill(r, sk); 8f840e47 Xin Long 2016-04-14 131 r->idiag_state = sk->sk_state; 8f840e47 Xin Long 2016-04-14 132 r->idiag_timer = 0; 8f840e47 Xin Long 2016-04-14 133 r->idiag_retrans = 0; 8f840e47 Xin Long 2016-04-14 134 } 8f840e47 Xin Long 2016-04-14 135 8f840e47 Xin Long 2016-04-14 @136 if (inet_diag_msg_attrs_fill(sk, skb, r, ext, user_ns)) 8f840e47 Xin Long 2016-04-14 137 goto errout; 8f840e47 Xin Long 2016-04-14 138 8f840e47 Xin Long 2016-04-14 139 if (ext & (1 << (INET_DIAG_SKMEMINFO - 1))) { :::::: The code at line 136 was first introduced by commit :::::: 8f840e47f190cbe61a96945c13e9551048d42cef sctp: add the sctp_diag.c file :::::: TO: Xin Long <lucien....@gmail.com> :::::: CC: David S. Miller <da...@davemloft.net> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
.config.gz
Description: Binary data