aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/cls_cgroup.h27
-rw-r--r--include/net/irda/ircomm_tty.h17
-rw-r--r--include/net/netlabel.h2
-rw-r--r--include/net/netprio_cgroup.h30
-rw-r--r--include/net/sock.h8
-rw-r--r--include/net/xfrm.h23
6 files changed, 39 insertions, 68 deletions
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index a4dc5b027bd..b6a6eeb3905 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -17,14 +17,16 @@
17#include <linux/hardirq.h> 17#include <linux/hardirq.h>
18#include <linux/rcupdate.h> 18#include <linux/rcupdate.h>
19 19
20#ifdef CONFIG_CGROUPS 20#if IS_ENABLED(CONFIG_NET_CLS_CGROUP)
21struct cgroup_cls_state 21struct cgroup_cls_state
22{ 22{
23 struct cgroup_subsys_state css; 23 struct cgroup_subsys_state css;
24 u32 classid; 24 u32 classid;
25}; 25};
26 26
27#ifdef CONFIG_NET_CLS_CGROUP 27extern void sock_update_classid(struct sock *sk);
28
29#if IS_BUILTIN(CONFIG_NET_CLS_CGROUP)
28static inline u32 task_cls_classid(struct task_struct *p) 30static inline u32 task_cls_classid(struct task_struct *p)
29{ 31{
30 int classid; 32 int classid;
@@ -39,32 +41,33 @@ static inline u32 task_cls_classid(struct task_struct *p)
39 41
40 return classid; 42 return classid;
41} 43}
42#else 44#elif IS_MODULE(CONFIG_NET_CLS_CGROUP)
43extern int net_cls_subsys_id;
44
45static inline u32 task_cls_classid(struct task_struct *p) 45static inline u32 task_cls_classid(struct task_struct *p)
46{ 46{
47 int id; 47 struct cgroup_subsys_state *css;
48 u32 classid = 0; 48 u32 classid = 0;
49 49
50 if (in_interrupt()) 50 if (in_interrupt())
51 return 0; 51 return 0;
52 52
53 rcu_read_lock(); 53 rcu_read_lock();
54 id = rcu_dereference_index_check(net_cls_subsys_id, 54 css = task_subsys_state(p, net_cls_subsys_id);
55 rcu_read_lock_held()); 55 if (css)
56 if (id >= 0) 56 classid = container_of(css,
57 classid = container_of(task_subsys_state(p, id),
58 struct cgroup_cls_state, css)->classid; 57 struct cgroup_cls_state, css)->classid;
59 rcu_read_unlock(); 58 rcu_read_unlock();
60 59
61 return classid; 60 return classid;
62} 61}
63#endif 62#endif
64#else 63#else /* !CGROUP_NET_CLS_CGROUP */
64static inline void sock_update_classid(struct sock *sk)
65{
66}
67
65static inline u32 task_cls_classid(struct task_struct *p) 68static inline u32 task_cls_classid(struct task_struct *p)
66{ 69{
67 return 0; 70 return 0;
68} 71}
69#endif 72#endif /* CGROUP_NET_CLS_CGROUP */
70#endif /* _NET_CLS_CGROUP_H */ 73#endif /* _NET_CLS_CGROUP_H */
diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h
index 59ba38bc400..80ffde3bb16 100644
--- a/include/net/irda/ircomm_tty.h
+++ b/include/net/irda/ircomm_tty.h
@@ -52,21 +52,16 @@
52/* Same for payload size. See qos.c for the smallest max data size */ 52/* Same for payload size. See qos.c for the smallest max data size */
53#define IRCOMM_TTY_DATA_UNINITIALISED (64 - IRCOMM_TTY_HDR_UNINITIALISED) 53#define IRCOMM_TTY_DATA_UNINITIALISED (64 - IRCOMM_TTY_HDR_UNINITIALISED)
54 54
55/* Those are really defined in include/linux/serial.h - Jean II */
56#define ASYNC_B_INITIALIZED 31 /* Serial port was initialized */
57#define ASYNC_B_NORMAL_ACTIVE 29 /* Normal device is active */
58#define ASYNC_B_CLOSING 27 /* Serial port is closing */
59
60/* 55/*
61 * IrCOMM TTY driver state 56 * IrCOMM TTY driver state
62 */ 57 */
63struct ircomm_tty_cb { 58struct ircomm_tty_cb {
64 irda_queue_t queue; /* Must be first */ 59 irda_queue_t queue; /* Must be first */
60 struct tty_port port;
65 magic_t magic; 61 magic_t magic;
66 62
67 int state; /* Connect state */ 63 int state; /* Connect state */
68 64
69 struct tty_struct *tty;
70 struct ircomm_cb *ircomm; /* IrCOMM layer instance */ 65 struct ircomm_cb *ircomm; /* IrCOMM layer instance */
71 66
72 struct sk_buff *tx_skb; /* Transmit buffer */ 67 struct sk_buff *tx_skb; /* Transmit buffer */
@@ -80,7 +75,6 @@ struct ircomm_tty_cb {
80 LOCAL_FLOW flow; /* IrTTP flow status */ 75 LOCAL_FLOW flow; /* IrTTP flow status */
81 76
82 int line; 77 int line;
83 unsigned long flags;
84 78
85 __u8 dlsap_sel; 79 __u8 dlsap_sel;
86 __u8 slsap_sel; 80 __u8 slsap_sel;
@@ -97,19 +91,10 @@ struct ircomm_tty_cb {
97 void *skey; 91 void *skey;
98 void *ckey; 92 void *ckey;
99 93
100 wait_queue_head_t open_wait;
101 wait_queue_head_t close_wait;
102 struct timer_list watchdog_timer; 94 struct timer_list watchdog_timer;
103 struct work_struct tqueue; 95 struct work_struct tqueue;
104 96
105 unsigned short close_delay;
106 unsigned short closing_wait; /* time to wait before closing */
107
108 int open_count;
109 int blocked_open; /* # of blocked opens */
110
111 /* Protect concurent access to : 97 /* Protect concurent access to :
112 * o self->open_count
113 * o self->ctrl_skb 98 * o self->ctrl_skb
114 * o self->tx_skb 99 * o self->tx_skb
115 * Maybe other things may gain to be protected as well... 100 * Maybe other things may gain to be protected as well...
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index f67440970d7..2c95d55f791 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -110,7 +110,7 @@ struct cipso_v4_doi;
110/* NetLabel audit information */ 110/* NetLabel audit information */
111struct netlbl_audit { 111struct netlbl_audit {
112 u32 secid; 112 u32 secid;
113 uid_t loginuid; 113 kuid_t loginuid;
114 u32 sessionid; 114 u32 sessionid;
115}; 115};
116 116
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h
index 2719dec6b5a..2760f4f4ae9 100644
--- a/include/net/netprio_cgroup.h
+++ b/include/net/netprio_cgroup.h
@@ -18,23 +18,18 @@
18#include <linux/rcupdate.h> 18#include <linux/rcupdate.h>
19 19
20 20
21#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
21struct netprio_map { 22struct netprio_map {
22 struct rcu_head rcu; 23 struct rcu_head rcu;
23 u32 priomap_len; 24 u32 priomap_len;
24 u32 priomap[]; 25 u32 priomap[];
25}; 26};
26 27
27#ifdef CONFIG_CGROUPS
28
29struct cgroup_netprio_state { 28struct cgroup_netprio_state {
30 struct cgroup_subsys_state css; 29 struct cgroup_subsys_state css;
31 u32 prioidx; 30 u32 prioidx;
32}; 31};
33 32
34#ifndef CONFIG_NETPRIO_CGROUP
35extern int net_prio_subsys_id;
36#endif
37
38extern void sock_update_netprioidx(struct sock *sk, struct task_struct *task); 33extern void sock_update_netprioidx(struct sock *sk, struct task_struct *task);
39 34
40#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP) 35#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP)
@@ -56,33 +51,28 @@ static inline u32 task_netprioidx(struct task_struct *p)
56 51
57static inline u32 task_netprioidx(struct task_struct *p) 52static inline u32 task_netprioidx(struct task_struct *p)
58{ 53{
59 struct cgroup_netprio_state *state; 54 struct cgroup_subsys_state *css;
60 int subsys_id;
61 u32 idx = 0; 55 u32 idx = 0;
62 56
63 rcu_read_lock(); 57 rcu_read_lock();
64 subsys_id = rcu_dereference_index_check(net_prio_subsys_id, 58 css = task_subsys_state(p, net_prio_subsys_id);
65 rcu_read_lock_held()); 59 if (css)
66 if (subsys_id >= 0) { 60 idx = container_of(css,
67 state = container_of(task_subsys_state(p, subsys_id), 61 struct cgroup_netprio_state, css)->prioidx;
68 struct cgroup_netprio_state, css);
69 idx = state->prioidx;
70 }
71 rcu_read_unlock(); 62 rcu_read_unlock();
72 return idx; 63 return idx;
73} 64}
65#endif
74 66
75#else 67#else /* !CONFIG_NETPRIO_CGROUP */
76 68
77static inline u32 task_netprioidx(struct task_struct *p) 69static inline u32 task_netprioidx(struct task_struct *p)
78{ 70{
79 return 0; 71 return 0;
80} 72}
81 73
82#endif /* CONFIG_NETPRIO_CGROUP */
83
84#else
85#define sock_update_netprioidx(sk, task) 74#define sock_update_netprioidx(sk, task)
86#endif 75
76#endif /* CONFIG_NETPRIO_CGROUP */
87 77
88#endif /* _NET_CLS_CGROUP_H */ 78#endif /* _NET_CLS_CGROUP_H */
diff --git a/include/net/sock.h b/include/net/sock.h
index c9175562039..c945fba4f54 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1493,14 +1493,6 @@ extern void *sock_kmalloc(struct sock *sk, int size,
1493extern void sock_kfree_s(struct sock *sk, void *mem, int size); 1493extern void sock_kfree_s(struct sock *sk, void *mem, int size);
1494extern void sk_send_sigurg(struct sock *sk); 1494extern void sk_send_sigurg(struct sock *sk);
1495 1495
1496#ifdef CONFIG_CGROUPS
1497extern void sock_update_classid(struct sock *sk);
1498#else
1499static inline void sock_update_classid(struct sock *sk)
1500{
1501}
1502#endif
1503
1504/* 1496/*
1505 * Functions to fill in entries in struct proto_ops when a protocol 1497 * Functions to fill in entries in struct proto_ops when a protocol
1506 * does not implement a particular function. 1498 * does not implement a particular function.
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index a3083bf209d..6f0ba01afe7 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -671,7 +671,7 @@ struct xfrm_spi_skb_cb {
671/* Audit Information */ 671/* Audit Information */
672struct xfrm_audit { 672struct xfrm_audit {
673 u32 secid; 673 u32 secid;
674 uid_t loginuid; 674 kuid_t loginuid;
675 u32 sessionid; 675 u32 sessionid;
676}; 676};
677 677
@@ -690,13 +690,14 @@ static inline struct audit_buffer *xfrm_audit_start(const char *op)
690 return audit_buf; 690 return audit_buf;
691} 691}
692 692
693static inline void xfrm_audit_helper_usrinfo(uid_t auid, u32 ses, u32 secid, 693static inline void xfrm_audit_helper_usrinfo(kuid_t auid, u32 ses, u32 secid,
694 struct audit_buffer *audit_buf) 694 struct audit_buffer *audit_buf)
695{ 695{
696 char *secctx; 696 char *secctx;
697 u32 secctx_len; 697 u32 secctx_len;
698 698
699 audit_log_format(audit_buf, " auid=%u ses=%u", auid, ses); 699 audit_log_format(audit_buf, " auid=%u ses=%u",
700 from_kuid(&init_user_ns, auid), ses);
700 if (secid != 0 && 701 if (secid != 0 &&
701 security_secid_to_secctx(secid, &secctx, &secctx_len) == 0) { 702 security_secid_to_secctx(secid, &secctx, &secctx_len) == 0) {
702 audit_log_format(audit_buf, " subj=%s", secctx); 703 audit_log_format(audit_buf, " subj=%s", secctx);
@@ -706,13 +707,13 @@ static inline void xfrm_audit_helper_usrinfo(uid_t auid, u32 ses, u32 secid,
706} 707}
707 708
708extern void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, 709extern void xfrm_audit_policy_add(struct xfrm_policy *xp, int result,
709 u32 auid, u32 ses, u32 secid); 710 kuid_t auid, u32 ses, u32 secid);
710extern void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, 711extern void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result,
711 u32 auid, u32 ses, u32 secid); 712 kuid_t auid, u32 ses, u32 secid);
712extern void xfrm_audit_state_add(struct xfrm_state *x, int result, 713extern void xfrm_audit_state_add(struct xfrm_state *x, int result,
713 u32 auid, u32 ses, u32 secid); 714 kuid_t auid, u32 ses, u32 secid);
714extern void xfrm_audit_state_delete(struct xfrm_state *x, int result, 715extern void xfrm_audit_state_delete(struct xfrm_state *x, int result,
715 u32 auid, u32 ses, u32 secid); 716 kuid_t auid, u32 ses, u32 secid);
716extern void xfrm_audit_state_replay_overflow(struct xfrm_state *x, 717extern void xfrm_audit_state_replay_overflow(struct xfrm_state *x,
717 struct sk_buff *skb); 718 struct sk_buff *skb);
718extern void xfrm_audit_state_replay(struct xfrm_state *x, 719extern void xfrm_audit_state_replay(struct xfrm_state *x,
@@ -725,22 +726,22 @@ extern void xfrm_audit_state_icvfail(struct xfrm_state *x,
725#else 726#else
726 727
727static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, 728static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result,
728 u32 auid, u32 ses, u32 secid) 729 kuid_t auid, u32 ses, u32 secid)
729{ 730{
730} 731}
731 732
732static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, 733static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result,
733 u32 auid, u32 ses, u32 secid) 734 kuid_t auid, u32 ses, u32 secid)
734{ 735{
735} 736}
736 737
737static inline void xfrm_audit_state_add(struct xfrm_state *x, int result, 738static inline void xfrm_audit_state_add(struct xfrm_state *x, int result,
738 u32 auid, u32 ses, u32 secid) 739 kuid_t auid, u32 ses, u32 secid)
739{ 740{
740} 741}
741 742
742static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result, 743static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result,
743 u32 auid, u32 ses, u32 secid) 744 kuid_t auid, u32 ses, u32 secid)
744{ 745{
745} 746}
746 747