diff options
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/ax25.h | 4 | ||||
| -rw-r--r-- | include/net/ipv6.h | 5 | ||||
| -rw-r--r-- | include/net/netlabel.h | 2 | ||||
| -rw-r--r-- | include/net/netns/ipv4.h | 3 | ||||
| -rw-r--r-- | include/net/sch_generic.h | 3 | ||||
| -rw-r--r-- | include/net/sock.h | 11 | ||||
| -rw-r--r-- | include/net/tcp.h | 3 | ||||
| -rw-r--r-- | include/net/xfrm.h | 23 | 
8 files changed, 35 insertions, 19 deletions
| diff --git a/include/net/ax25.h b/include/net/ax25.h index 5d2352154cf6..53539acbd81a 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -157,7 +157,7 @@ enum {  typedef struct ax25_uid_assoc {  	struct hlist_node	uid_node;  	atomic_t		refcount; -	uid_t			uid; +	kuid_t			uid;  	ax25_address		call;  } ax25_uid_assoc; @@ -434,7 +434,7 @@ extern unsigned long ax25_display_timer(struct timer_list *);  /* ax25_uid.c */  extern int  ax25_uid_policy; -extern ax25_uid_assoc *ax25_findbyuid(uid_t); +extern ax25_uid_assoc *ax25_findbyuid(kuid_t);  extern int __must_check ax25_uid_ioctl(int, struct sockaddr_ax25 *);  extern const struct file_operations ax25_uid_fops;  extern void ax25_uid_free(void); diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 01c34b363a34..c8a202436e01 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -222,7 +222,10 @@ struct ip6_flowlabel {  	struct ipv6_txoptions	*opt;  	unsigned long		linger;  	u8			share; -	u32			owner; +	union { +		struct pid *pid; +		kuid_t uid; +	} owner;  	unsigned long		lastuse;  	unsigned long		expires;  	struct net		*fl_net; diff --git a/include/net/netlabel.h b/include/net/netlabel.h index f67440970d7e..2c95d55f7914 100644 --- a/include/net/netlabel.h +++ b/include/net/netlabel.h @@ -110,7 +110,7 @@ struct cipso_v4_doi;  /* NetLabel audit information */  struct netlbl_audit {  	u32 secid; -	uid_t loginuid; +	kuid_t loginuid;  	u32 sessionid;  }; diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index eb24dbccd81e..69e50c789d96 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h @@ -5,6 +5,7 @@  #ifndef __NETNS_IPV4_H__  #define __NETNS_IPV4_H__ +#include <linux/uidgid.h>  #include <net/inet_frag.h>  struct tcpm_hash_bucket; @@ -62,7 +63,7 @@ struct netns_ipv4 {  	int sysctl_icmp_ratemask;  	int sysctl_icmp_errors_use_inbound_ifaddr; -	unsigned int sysctl_ping_group_range[2]; +	kgid_t sysctl_ping_group_range[2];  	long sysctl_tcp_mem[3];  	atomic_t dev_addr_genid; diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index d9611e032418..4616f468d599 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -188,7 +188,8 @@ struct tcf_proto_ops {  	unsigned long		(*get)(struct tcf_proto*, u32 handle);  	void			(*put)(struct tcf_proto*, unsigned long); -	int			(*change)(struct tcf_proto*, unsigned long, +	int			(*change)(struct sk_buff *, +					struct tcf_proto*, unsigned long,  					u32 handle, struct nlattr **,  					unsigned long *);  	int			(*delete)(struct tcf_proto*, unsigned long); diff --git a/include/net/sock.h b/include/net/sock.h index 6e6ec18fb6d0..0d7e9834d9be 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -606,6 +606,15 @@ static inline void sk_add_bind_node(struct sock *sk,  #define sk_for_each_bound(__sk, node, list) \  	hlist_for_each_entry(__sk, node, list, sk_bind_node) +static inline struct user_namespace *sk_user_ns(struct sock *sk) +{ +	/* Careful only use this in a context where these parameters +	 * can not change and must all be valid, such as recvmsg from +	 * userspace. +	 */ +	return sk->sk_socket->file->f_cred->user_ns; +} +  /* Sock flags */  enum sock_flags {  	SOCK_DEAD, @@ -1662,7 +1671,7 @@ static inline void sock_graft(struct sock *sk, struct socket *parent)  	write_unlock_bh(&sk->sk_callback_lock);  } -extern int sock_i_uid(struct sock *sk); +extern kuid_t sock_i_uid(struct sock *sk);  extern unsigned long sock_i_ino(struct sock *sk);  static inline struct dst_entry * diff --git a/include/net/tcp.h b/include/net/tcp.h index 1f000ffe7075..9a0021d16d91 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1510,7 +1510,8 @@ struct tcp_iter_state {  	sa_family_t		family;  	enum tcp_seq_states	state;  	struct sock		*syn_wait_sk; -	int			bucket, offset, sbucket, num, uid; +	int			bucket, offset, sbucket, num; +	kuid_t			uid;  	loff_t			last_pos;  }; diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 639dd1316d37..411d83c9821d 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -671,7 +671,7 @@ struct xfrm_spi_skb_cb {  /* Audit Information */  struct xfrm_audit {  	u32	secid; -	uid_t	loginuid; +	kuid_t	loginuid;  	u32	sessionid;  }; @@ -690,13 +690,14 @@ static inline struct audit_buffer *xfrm_audit_start(const char *op)  	return audit_buf;  } -static inline void xfrm_audit_helper_usrinfo(uid_t auid, u32 ses, u32 secid, +static inline void xfrm_audit_helper_usrinfo(kuid_t auid, u32 ses, u32 secid,  					     struct audit_buffer *audit_buf)  {  	char *secctx;  	u32 secctx_len; -	audit_log_format(audit_buf, " auid=%u ses=%u", auid, ses); +	audit_log_format(audit_buf, " auid=%u ses=%u", +			 from_kuid(&init_user_ns, auid), ses);  	if (secid != 0 &&  	    security_secid_to_secctx(secid, &secctx, &secctx_len) == 0) {  		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,  }  extern void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, -				  u32 auid, u32 ses, u32 secid); +				  kuid_t auid, u32 ses, u32 secid);  extern void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, -				  u32 auid, u32 ses, u32 secid); +				  kuid_t auid, u32 ses, u32 secid);  extern void xfrm_audit_state_add(struct xfrm_state *x, int result, -				 u32 auid, u32 ses, u32 secid); +				 kuid_t auid, u32 ses, u32 secid);  extern void xfrm_audit_state_delete(struct xfrm_state *x, int result, -				    u32 auid, u32 ses, u32 secid); +				    kuid_t auid, u32 ses, u32 secid);  extern void xfrm_audit_state_replay_overflow(struct xfrm_state *x,  					     struct sk_buff *skb);  extern void xfrm_audit_state_replay(struct xfrm_state *x, @@ -725,22 +726,22 @@ extern void xfrm_audit_state_icvfail(struct xfrm_state *x,  #else  static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, -				  u32 auid, u32 ses, u32 secid) +				  kuid_t auid, u32 ses, u32 secid)  {  }  static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, -				  u32 auid, u32 ses, u32 secid) +				  kuid_t auid, u32 ses, u32 secid)  {  }  static inline void xfrm_audit_state_add(struct xfrm_state *x, int result, -				 u32 auid, u32 ses, u32 secid) +				 kuid_t auid, u32 ses, u32 secid)  {  }  static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result, -				    u32 auid, u32 ses, u32 secid) +				    kuid_t auid, u32 ses, u32 secid)  {  } | 
