mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
Pablo Neira Ayuso says: ==================== netfilter/IPVS updates for net-next The following patchset contains Netfilter updates for your net-next tree, they are: * Add full port randomization support. Some crazy researchers found a way to reconstruct the secure ephemeral ports that are allocated in random mode by sending off-path bursts of UDP packets to overrun the socket buffer of the DNS resolver to trigger retransmissions, then if the timing for the DNS resolution done by a client is larger than usual, then they conclude that the port that received the burst of UDP packets is the one that was opened. It seems a bit aggressive method to me but it seems to work for them. As a result, Daniel Borkmann and Hannes Frederic Sowa came up with a new NAT mode to fully randomize ports using prandom. * Add a new classifier to x_tables based on the socket net_cls set via cgroups. These includes two patches to prepare the field as requested by Zefan Li. Also from Daniel Borkmann. * Use prandom instead of get_random_bytes in several locations of the netfilter code, from Florian Westphal. * Allow to use the CTA_MARK_MASK in ctnetlink when mangling the conntrack mark, also from Florian Westphal. * Fix compilation warning due to unused variable in IPVS, from Geert Uytterhoeven. * Add support for UID/GID via nfnetlink_queue, from Valentina Giusti. * Add IPComp extension to x_tables, from Fan Du. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -6,6 +6,8 @@ tag network packets with a class identifier (classid).
|
||||
|
||||
The Traffic Controller (tc) can be used to assign
|
||||
different priorities to packets from different cgroups.
|
||||
Also, Netfilter (iptables) can use this tag to perform
|
||||
actions on such packets.
|
||||
|
||||
Creating a net_cls cgroups instance creates a net_cls.classid file.
|
||||
This net_cls.classid value is initialized to 0.
|
||||
@@ -32,3 +34,6 @@ tc class add dev eth0 parent 10: classid 10:1 htb rate 40mbit
|
||||
- creating traffic class 10:1
|
||||
|
||||
tc filter add dev eth0 parent 10: protocol ip prio 10 handle 1: cgroup
|
||||
|
||||
configuring iptables, basic example:
|
||||
iptables -A OUTPUT -m cgroup ! --cgroup 0x100001 -j DROP
|
||||
|
||||
@@ -31,7 +31,7 @@ SUBSYS(devices)
|
||||
SUBSYS(freezer)
|
||||
#endif
|
||||
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_NET_CLS_CGROUP)
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_NET_CLASSID)
|
||||
SUBSYS(net_cls)
|
||||
#endif
|
||||
|
||||
@@ -43,7 +43,7 @@ SUBSYS(blkio)
|
||||
SUBSYS(perf)
|
||||
#endif
|
||||
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_NETPRIO_CGROUP)
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_NET_PRIO)
|
||||
SUBSYS(net_prio)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1444,7 +1444,7 @@ struct net_device {
|
||||
/* max exchange id for FCoE LRO by ddp */
|
||||
unsigned int fcoe_ddp_xid;
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
|
||||
#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
|
||||
struct netprio_map __rcu *priomap;
|
||||
#endif
|
||||
/* phy device may attach itself for hardware timestamping */
|
||||
|
||||
@@ -331,7 +331,6 @@ extern ip_set_id_t ip_set_get_byname(struct net *net,
|
||||
const char *name, struct ip_set **set);
|
||||
extern void ip_set_put_byindex(struct net *net, ip_set_id_t index);
|
||||
extern const char *ip_set_name_byindex(struct net *net, ip_set_id_t index);
|
||||
extern ip_set_id_t ip_set_nfnl_get(struct net *net, const char *name);
|
||||
extern ip_set_id_t ip_set_nfnl_get_byindex(struct net *net, ip_set_id_t index);
|
||||
extern void ip_set_nfnl_put(struct net *net, ip_set_id_t index);
|
||||
|
||||
|
||||
@@ -16,17 +16,16 @@
|
||||
#include <linux/cgroup.h>
|
||||
#include <linux/hardirq.h>
|
||||
#include <linux/rcupdate.h>
|
||||
#include <net/sock.h>
|
||||
|
||||
#if IS_ENABLED(CONFIG_NET_CLS_CGROUP)
|
||||
struct cgroup_cls_state
|
||||
{
|
||||
#ifdef CONFIG_CGROUP_NET_CLASSID
|
||||
struct cgroup_cls_state {
|
||||
struct cgroup_subsys_state css;
|
||||
u32 classid;
|
||||
};
|
||||
|
||||
void sock_update_classid(struct sock *sk);
|
||||
struct cgroup_cls_state *task_cls_state(struct task_struct *p);
|
||||
|
||||
#if IS_BUILTIN(CONFIG_NET_CLS_CGROUP)
|
||||
static inline u32 task_cls_classid(struct task_struct *p)
|
||||
{
|
||||
u32 classid;
|
||||
@@ -41,33 +40,18 @@ static inline u32 task_cls_classid(struct task_struct *p)
|
||||
|
||||
return classid;
|
||||
}
|
||||
#elif IS_MODULE(CONFIG_NET_CLS_CGROUP)
|
||||
static inline u32 task_cls_classid(struct task_struct *p)
|
||||
|
||||
static inline void sock_update_classid(struct sock *sk)
|
||||
{
|
||||
struct cgroup_subsys_state *css;
|
||||
u32 classid = 0;
|
||||
u32 classid;
|
||||
|
||||
if (in_interrupt())
|
||||
return 0;
|
||||
|
||||
rcu_read_lock();
|
||||
css = task_css(p, net_cls_subsys_id);
|
||||
if (css)
|
||||
classid = container_of(css,
|
||||
struct cgroup_cls_state, css)->classid;
|
||||
rcu_read_unlock();
|
||||
|
||||
return classid;
|
||||
classid = task_cls_classid(current);
|
||||
if (classid != sk->sk_classid)
|
||||
sk->sk_classid = classid;
|
||||
}
|
||||
#endif
|
||||
#else /* !CGROUP_NET_CLS_CGROUP */
|
||||
#else /* !CONFIG_CGROUP_NET_CLASSID */
|
||||
static inline void sock_update_classid(struct sock *sk)
|
||||
{
|
||||
}
|
||||
|
||||
static inline u32 task_cls_classid(struct task_struct *p)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CGROUP_NET_CLS_CGROUP */
|
||||
#endif /* CONFIG_CGROUP_NET_CLASSID */
|
||||
#endif /* _NET_CLS_CGROUP_H */
|
||||
|
||||
@@ -19,6 +19,4 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp;
|
||||
int nf_conntrack_ipv4_compat_init(void);
|
||||
void nf_conntrack_ipv4_compat_fini(void);
|
||||
|
||||
void need_ipv4_conntrack(void);
|
||||
|
||||
#endif /*_NF_CONNTRACK_IPV4_H*/
|
||||
|
||||
@@ -87,7 +87,6 @@ int nf_ct_l3proto_register(struct nf_conntrack_l3proto *proto);
|
||||
void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto);
|
||||
|
||||
struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto);
|
||||
void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p);
|
||||
|
||||
/* Existing built-in protocols */
|
||||
extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic;
|
||||
|
||||
@@ -65,6 +65,23 @@ struct nf_ip_net {
|
||||
struct netns_ct {
|
||||
atomic_t count;
|
||||
unsigned int expect_count;
|
||||
#ifdef CONFIG_SYSCTL
|
||||
struct ctl_table_header *sysctl_header;
|
||||
struct ctl_table_header *acct_sysctl_header;
|
||||
struct ctl_table_header *tstamp_sysctl_header;
|
||||
struct ctl_table_header *event_sysctl_header;
|
||||
struct ctl_table_header *helper_sysctl_header;
|
||||
#endif
|
||||
char *slabname;
|
||||
unsigned int sysctl_log_invalid; /* Log invalid packets */
|
||||
unsigned int sysctl_events_retry_timeout;
|
||||
int sysctl_events;
|
||||
int sysctl_acct;
|
||||
int sysctl_auto_assign_helper;
|
||||
bool auto_assign_helper_warned;
|
||||
int sysctl_tstamp;
|
||||
int sysctl_checksum;
|
||||
|
||||
unsigned int htable_size;
|
||||
struct kmem_cache *nf_conntrack_cachep;
|
||||
struct hlist_nulls_head *hash;
|
||||
@@ -75,14 +92,6 @@ struct netns_ct {
|
||||
struct ip_conntrack_stat __percpu *stat;
|
||||
struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb;
|
||||
struct nf_exp_event_notifier __rcu *nf_expect_event_cb;
|
||||
int sysctl_events;
|
||||
unsigned int sysctl_events_retry_timeout;
|
||||
int sysctl_acct;
|
||||
int sysctl_tstamp;
|
||||
int sysctl_checksum;
|
||||
unsigned int sysctl_log_invalid; /* Log invalid packets */
|
||||
int sysctl_auto_assign_helper;
|
||||
bool auto_assign_helper_warned;
|
||||
struct nf_ip_net nf_ct_proto;
|
||||
#if defined(CONFIG_NF_CONNTRACK_LABELS)
|
||||
unsigned int labels_used;
|
||||
@@ -92,13 +101,5 @@ struct netns_ct {
|
||||
struct hlist_head *nat_bysource;
|
||||
unsigned int nat_htable_size;
|
||||
#endif
|
||||
#ifdef CONFIG_SYSCTL
|
||||
struct ctl_table_header *sysctl_header;
|
||||
struct ctl_table_header *acct_sysctl_header;
|
||||
struct ctl_table_header *tstamp_sysctl_header;
|
||||
struct ctl_table_header *event_sysctl_header;
|
||||
struct ctl_table_header *helper_sysctl_header;
|
||||
#endif
|
||||
char *slabname;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
|
||||
#ifndef _NETPRIO_CGROUP_H
|
||||
#define _NETPRIO_CGROUP_H
|
||||
|
||||
#include <linux/cgroup.h>
|
||||
#include <linux/hardirq.h>
|
||||
#include <linux/rcupdate.h>
|
||||
|
||||
|
||||
#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
|
||||
#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
|
||||
struct netprio_map {
|
||||
struct rcu_head rcu;
|
||||
u32 priomap_len;
|
||||
@@ -27,8 +27,7 @@ struct netprio_map {
|
||||
|
||||
void sock_update_netprioidx(struct sock *sk);
|
||||
|
||||
#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP)
|
||||
|
||||
#if IS_BUILTIN(CONFIG_CGROUP_NET_PRIO)
|
||||
static inline u32 task_netprioidx(struct task_struct *p)
|
||||
{
|
||||
struct cgroup_subsys_state *css;
|
||||
@@ -40,9 +39,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
|
||||
rcu_read_unlock();
|
||||
return idx;
|
||||
}
|
||||
|
||||
#elif IS_MODULE(CONFIG_NETPRIO_CGROUP)
|
||||
|
||||
#elif IS_MODULE(CONFIG_CGROUP_NET_PRIO)
|
||||
static inline u32 task_netprioidx(struct task_struct *p)
|
||||
{
|
||||
struct cgroup_subsys_state *css;
|
||||
@@ -56,9 +53,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
|
||||
return idx;
|
||||
}
|
||||
#endif
|
||||
|
||||
#else /* !CONFIG_NETPRIO_CGROUP */
|
||||
|
||||
#else /* !CONFIG_CGROUP_NET_PRIO */
|
||||
static inline u32 task_netprioidx(struct task_struct *p)
|
||||
{
|
||||
return 0;
|
||||
@@ -66,6 +61,5 @@ static inline u32 task_netprioidx(struct task_struct *p)
|
||||
|
||||
#define sock_update_netprioidx(sk)
|
||||
|
||||
#endif /* CONFIG_NETPRIO_CGROUP */
|
||||
|
||||
#endif /* CONFIG_CGROUP_NET_PRIO */
|
||||
#endif /* _NET_CLS_CGROUP_H */
|
||||
|
||||
@@ -395,7 +395,7 @@ struct sock {
|
||||
unsigned short sk_ack_backlog;
|
||||
unsigned short sk_max_ack_backlog;
|
||||
__u32 sk_priority;
|
||||
#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
|
||||
#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
|
||||
__u32 sk_cgrp_prioidx;
|
||||
#endif
|
||||
struct pid *sk_peer_pid;
|
||||
|
||||
@@ -39,6 +39,7 @@ header-y += xt_TEE.h
|
||||
header-y += xt_TPROXY.h
|
||||
header-y += xt_addrtype.h
|
||||
header-y += xt_bpf.h
|
||||
header-y += xt_cgroup.h
|
||||
header-y += xt_cluster.h
|
||||
header-y += xt_comment.h
|
||||
header-y += xt_connbytes.h
|
||||
@@ -54,6 +55,7 @@ header-y += xt_ecn.h
|
||||
header-y += xt_esp.h
|
||||
header-y += xt_hashlimit.h
|
||||
header-y += xt_helper.h
|
||||
header-y += xt_ipcomp.h
|
||||
header-y += xt_iprange.h
|
||||
header-y += xt_ipvs.h
|
||||
header-y += xt_length.h
|
||||
|
||||
@@ -4,10 +4,14 @@
|
||||
#include <linux/netfilter.h>
|
||||
#include <linux/netfilter/nf_conntrack_tuple_common.h>
|
||||
|
||||
#define NF_NAT_RANGE_MAP_IPS 1
|
||||
#define NF_NAT_RANGE_PROTO_SPECIFIED 2
|
||||
#define NF_NAT_RANGE_PROTO_RANDOM 4
|
||||
#define NF_NAT_RANGE_PERSISTENT 8
|
||||
#define NF_NAT_RANGE_MAP_IPS (1 << 0)
|
||||
#define NF_NAT_RANGE_PROTO_SPECIFIED (1 << 1)
|
||||
#define NF_NAT_RANGE_PROTO_RANDOM (1 << 2)
|
||||
#define NF_NAT_RANGE_PERSISTENT (1 << 3)
|
||||
#define NF_NAT_RANGE_PROTO_RANDOM_FULLY (1 << 4)
|
||||
|
||||
#define NF_NAT_RANGE_PROTO_RANDOM_ALL \
|
||||
(NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PROTO_RANDOM_FULLY)
|
||||
|
||||
struct nf_nat_ipv4_range {
|
||||
unsigned int flags;
|
||||
|
||||
@@ -47,6 +47,8 @@ enum nfqnl_attr_type {
|
||||
NFQA_CAP_LEN, /* __u32 length of captured packet */
|
||||
NFQA_SKB_INFO, /* __u32 skb meta information */
|
||||
NFQA_EXP, /* nf_conntrack_netlink.h */
|
||||
NFQA_UID, /* __u32 sk uid */
|
||||
NFQA_GID, /* __u32 sk gid */
|
||||
|
||||
__NFQA_MAX
|
||||
};
|
||||
@@ -99,7 +101,8 @@ enum nfqnl_attr_config {
|
||||
#define NFQA_CFG_F_FAIL_OPEN (1 << 0)
|
||||
#define NFQA_CFG_F_CONNTRACK (1 << 1)
|
||||
#define NFQA_CFG_F_GSO (1 << 2)
|
||||
#define NFQA_CFG_F_MAX (1 << 3)
|
||||
#define NFQA_CFG_F_UID_GID (1 << 3)
|
||||
#define NFQA_CFG_F_MAX (1 << 4)
|
||||
|
||||
/* flags for NFQA_SKB_INFO */
|
||||
/* packet appears to have wrong checksums, but they are ok */
|
||||
|
||||
11
include/uapi/linux/netfilter/xt_cgroup.h
Normal file
11
include/uapi/linux/netfilter/xt_cgroup.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef _UAPI_XT_CGROUP_H
|
||||
#define _UAPI_XT_CGROUP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct xt_cgroup_info {
|
||||
__u32 id;
|
||||
__u32 invert;
|
||||
};
|
||||
|
||||
#endif /* _UAPI_XT_CGROUP_H */
|
||||
16
include/uapi/linux/netfilter/xt_ipcomp.h
Normal file
16
include/uapi/linux/netfilter/xt_ipcomp.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef _XT_IPCOMP_H
|
||||
#define _XT_IPCOMP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct xt_ipcomp {
|
||||
__u32 spis[2]; /* Security Parameter Index */
|
||||
__u8 invflags; /* Inverse flags */
|
||||
__u8 hdrres; /* Test of the Reserved Filed */
|
||||
};
|
||||
|
||||
/* Values for "invflags" field in struct xt_ipcomp. */
|
||||
#define XT_IPCOMP_INV_SPI 0x01 /* Invert the sense of spi. */
|
||||
#define XT_IPCOMP_INV_MASK 0x01 /* All possible flags. */
|
||||
|
||||
#endif /*_XT_IPCOMP_H*/
|
||||
11
net/Kconfig
11
net/Kconfig
@@ -238,12 +238,19 @@ config XPS
|
||||
depends on SMP
|
||||
default y
|
||||
|
||||
config NETPRIO_CGROUP
|
||||
config CGROUP_NET_PRIO
|
||||
tristate "Network priority cgroup"
|
||||
depends on CGROUPS
|
||||
---help---
|
||||
Cgroup subsystem for use in assigning processes to network priorities on
|
||||
a per-interface basis
|
||||
a per-interface basis.
|
||||
|
||||
config CGROUP_NET_CLASSID
|
||||
boolean "Network classid cgroup"
|
||||
depends on CGROUPS
|
||||
---help---
|
||||
Cgroup subsystem for use as general purpose socket classid marker that is
|
||||
being used in cls_cgroup and for netfilter matching.
|
||||
|
||||
config NET_RX_BUSY_POLL
|
||||
boolean
|
||||
|
||||
@@ -21,4 +21,5 @@ obj-$(CONFIG_FIB_RULES) += fib_rules.o
|
||||
obj-$(CONFIG_TRACEPOINTS) += net-traces.o
|
||||
obj-$(CONFIG_NET_DROP_MONITOR) += drop_monitor.o
|
||||
obj-$(CONFIG_NETWORK_PHY_TIMESTAMPING) += timestamping.o
|
||||
obj-$(CONFIG_NETPRIO_CGROUP) += netprio_cgroup.o
|
||||
obj-$(CONFIG_CGROUP_NET_PRIO) += netprio_cgroup.o
|
||||
obj-$(CONFIG_CGROUP_NET_CLASSID) += netclassid_cgroup.o
|
||||
|
||||
@@ -2741,7 +2741,7 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
|
||||
return rc;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
|
||||
#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
|
||||
static void skb_update_prio(struct sk_buff *skb)
|
||||
{
|
||||
struct netprio_map *map = rcu_dereference_bh(skb->dev->priomap);
|
||||
|
||||
120
net/core/netclassid_cgroup.c
Normal file
120
net/core/netclassid_cgroup.c
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* net/core/netclassid_cgroup.c Classid Cgroupfs Handling
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* Authors: Thomas Graf <tgraf@suug.ch>
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/cgroup.h>
|
||||
#include <linux/fdtable.h>
|
||||
#include <net/cls_cgroup.h>
|
||||
#include <net/sock.h>
|
||||
|
||||
static inline struct cgroup_cls_state *css_cls_state(struct cgroup_subsys_state *css)
|
||||
{
|
||||
return css ? container_of(css, struct cgroup_cls_state, css) : NULL;
|
||||
}
|
||||
|
||||
struct cgroup_cls_state *task_cls_state(struct task_struct *p)
|
||||
{
|
||||
return css_cls_state(task_css(p, net_cls_subsys_id));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(task_cls_state);
|
||||
|
||||
static struct cgroup_subsys_state *
|
||||
cgrp_css_alloc(struct cgroup_subsys_state *parent_css)
|
||||
{
|
||||
struct cgroup_cls_state *cs;
|
||||
|
||||
cs = kzalloc(sizeof(*cs), GFP_KERNEL);
|
||||
if (!cs)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
return &cs->css;
|
||||
}
|
||||
|
||||
static int cgrp_css_online(struct cgroup_subsys_state *css)
|
||||
{
|
||||
struct cgroup_cls_state *cs = css_cls_state(css);
|
||||
struct cgroup_cls_state *parent = css_cls_state(css_parent(css));
|
||||
|
||||
if (parent)
|
||||
cs->classid = parent->classid;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void cgrp_css_free(struct cgroup_subsys_state *css)
|
||||
{
|
||||
kfree(css_cls_state(css));
|
||||
}
|
||||
|
||||
static int update_classid(const void *v, struct file *file, unsigned n)
|
||||
{
|
||||
int err;
|
||||
struct socket *sock = sock_from_file(file, &err);
|
||||
|
||||
if (sock)
|
||||
sock->sk->sk_classid = (u32)(unsigned long)v;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void cgrp_attach(struct cgroup_subsys_state *css,
|
||||
struct cgroup_taskset *tset)
|
||||
{
|
||||
struct cgroup_cls_state *cs = css_cls_state(css);
|
||||
void *v = (void *)(unsigned long)cs->classid;
|
||||
struct task_struct *p;
|
||||
|
||||
cgroup_taskset_for_each(p, css, tset) {
|
||||
task_lock(p);
|
||||
iterate_fd(p->files, 0, update_classid, v);
|
||||
task_unlock(p);
|
||||
}
|
||||
}
|
||||
|
||||
static u64 read_classid(struct cgroup_subsys_state *css, struct cftype *cft)
|
||||
{
|
||||
return css_cls_state(css)->classid;
|
||||
}
|
||||
|
||||
static int write_classid(struct cgroup_subsys_state *css, struct cftype *cft,
|
||||
u64 value)
|
||||
{
|
||||
css_cls_state(css)->classid = (u32) value;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct cftype ss_files[] = {
|
||||
{
|
||||
.name = "classid",
|
||||
.read_u64 = read_classid,
|
||||
.write_u64 = write_classid,
|
||||
},
|
||||
{ } /* terminate */
|
||||
};
|
||||
|
||||
struct cgroup_subsys net_cls_subsys = {
|
||||
.name = "net_cls",
|
||||
.css_alloc = cgrp_css_alloc,
|
||||
.css_online = cgrp_css_online,
|
||||
.css_free = cgrp_css_free,
|
||||
.attach = cgrp_attach,
|
||||
.subsys_id = net_cls_subsys_id,
|
||||
.base_cftypes = ss_files,
|
||||
.module = THIS_MODULE,
|
||||
};
|
||||
|
||||
static int __init init_netclassid_cgroup(void)
|
||||
{
|
||||
return cgroup_load_subsys(&net_cls_subsys);
|
||||
}
|
||||
__initcall(init_netclassid_cgroup);
|
||||
@@ -1307,19 +1307,7 @@ static void sk_prot_free(struct proto *prot, struct sock *sk)
|
||||
module_put(owner);
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_NET_CLS_CGROUP)
|
||||
void sock_update_classid(struct sock *sk)
|
||||
{
|
||||
u32 classid;
|
||||
|
||||
classid = task_cls_classid(current);
|
||||
if (classid != sk->sk_classid)
|
||||
sk->sk_classid = classid;
|
||||
}
|
||||
EXPORT_SYMBOL(sock_update_classid);
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
|
||||
#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
|
||||
void sock_update_netprioidx(struct sock *sk)
|
||||
{
|
||||
if (in_interrupt())
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user