Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v6 4/5] selinux: bpf: Add selinux check for eBPF syscall operations
From: Chenbo Feng @ 2017-10-16 19:11 UTC (permalink / raw)
  To: netdev, SELinux, linux-security-module
  Cc: Jeffrey Vander Stoep, Alexei Starovoitov, lorenzo,
	Daniel Borkmann, Stephen Smalley, James Morris, Paul Moore,
	Chenbo Feng
In-Reply-To: <20171016191135.8046-1-chenbofeng.kernel@gmail.com>

From: Chenbo Feng <fengc@google.com>

Implement the actual checks introduced to eBPF related syscalls. This
implementation use the security field inside bpf object to store a sid that
identify the bpf object. And when processes try to access the object,
selinux will check if processes have the right privileges. The creation
of eBPF object are also checked at the general bpf check hook and new
cmd introduced to eBPF domain can also be checked there.

Signed-off-by: Chenbo Feng <fengc@google.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
---
 security/selinux/hooks.c            | 111 ++++++++++++++++++++++++++++++++++++
 security/selinux/include/classmap.h |   2 +
 security/selinux/include/objsec.h   |   4 ++
 3 files changed, 117 insertions(+)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index f5d304736852..12cf7de8cbed 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -85,6 +85,7 @@
 #include <linux/export.h>
 #include <linux/msg.h>
 #include <linux/shm.h>
+#include <linux/bpf.h>
 
 #include "avc.h"
 #include "objsec.h"
@@ -6252,6 +6253,106 @@ static void selinux_ib_free_security(void *ib_sec)
 }
 #endif
 
+#ifdef CONFIG_BPF_SYSCALL
+static int selinux_bpf(int cmd, union bpf_attr *attr,
+				     unsigned int size)
+{
+	u32 sid = current_sid();
+	int ret;
+
+	switch (cmd) {
+	case BPF_MAP_CREATE:
+		ret = avc_has_perm(sid, sid, SECCLASS_BPF, BPF__MAP_CREATE,
+				   NULL);
+		break;
+	case BPF_PROG_LOAD:
+		ret = avc_has_perm(sid, sid, SECCLASS_BPF, BPF__PROG_LOAD,
+				   NULL);
+		break;
+	default:
+		ret = 0;
+		break;
+	}
+
+	return ret;
+}
+
+static u32 bpf_map_fmode_to_av(fmode_t fmode)
+{
+	u32 av = 0;
+
+	if (fmode & FMODE_READ)
+		av |= BPF__MAP_READ;
+	if (fmode & FMODE_WRITE)
+		av |= BPF__MAP_WRITE;
+	return av;
+}
+
+static int selinux_bpf_map(struct bpf_map *map, fmode_t fmode)
+{
+	u32 sid = current_sid();
+	struct bpf_security_struct *bpfsec;
+
+	bpfsec = map->security;
+	return avc_has_perm(sid, bpfsec->sid, SECCLASS_BPF,
+			    bpf_map_fmode_to_av(fmode), NULL);
+}
+
+static int selinux_bpf_prog(struct bpf_prog *prog)
+{
+	u32 sid = current_sid();
+	struct bpf_security_struct *bpfsec;
+
+	bpfsec = prog->aux->security;
+	return avc_has_perm(sid, bpfsec->sid, SECCLASS_BPF,
+			    BPF__PROG_RUN, NULL);
+}
+
+static int selinux_bpf_map_alloc(struct bpf_map *map)
+{
+	struct bpf_security_struct *bpfsec;
+
+	bpfsec = kzalloc(sizeof(*bpfsec), GFP_KERNEL);
+	if (!bpfsec)
+		return -ENOMEM;
+
+	bpfsec->sid = current_sid();
+	map->security = bpfsec;
+
+	return 0;
+}
+
+static void selinux_bpf_map_free(struct bpf_map *map)
+{
+	struct bpf_security_struct *bpfsec = map->security;
+
+	map->security = NULL;
+	kfree(bpfsec);
+}
+
+static int selinux_bpf_prog_alloc(struct bpf_prog_aux *aux)
+{
+	struct bpf_security_struct *bpfsec;
+
+	bpfsec = kzalloc(sizeof(*bpfsec), GFP_KERNEL);
+	if (!bpfsec)
+		return -ENOMEM;
+
+	bpfsec->sid = current_sid();
+	aux->security = bpfsec;
+
+	return 0;
+}
+
+static void selinux_bpf_prog_free(struct bpf_prog_aux *aux)
+{
+	struct bpf_security_struct *bpfsec = aux->security;
+
+	aux->security = NULL;
+	kfree(bpfsec);
+}
+#endif
+
 static struct security_hook_list selinux_hooks[] __lsm_ro_after_init = {
 	LSM_HOOK_INIT(binder_set_context_mgr, selinux_binder_set_context_mgr),
 	LSM_HOOK_INIT(binder_transaction, selinux_binder_transaction),
@@ -6471,6 +6572,16 @@ static struct security_hook_list selinux_hooks[] __lsm_ro_after_init = {
 	LSM_HOOK_INIT(audit_rule_match, selinux_audit_rule_match),
 	LSM_HOOK_INIT(audit_rule_free, selinux_audit_rule_free),
 #endif
+
+#ifdef CONFIG_BPF_SYSCALL
+	LSM_HOOK_INIT(bpf, selinux_bpf),
+	LSM_HOOK_INIT(bpf_map, selinux_bpf_map),
+	LSM_HOOK_INIT(bpf_prog, selinux_bpf_prog),
+	LSM_HOOK_INIT(bpf_map_alloc_security, selinux_bpf_map_alloc),
+	LSM_HOOK_INIT(bpf_prog_alloc_security, selinux_bpf_prog_alloc),
+	LSM_HOOK_INIT(bpf_map_free_security, selinux_bpf_map_free),
+	LSM_HOOK_INIT(bpf_prog_free_security, selinux_bpf_prog_free),
+#endif
 };
 
 static __init int selinux_init(void)
diff --git a/security/selinux/include/classmap.h b/security/selinux/include/classmap.h
index 35ffb29a69cb..0a7023b5f000 100644
--- a/security/selinux/include/classmap.h
+++ b/security/selinux/include/classmap.h
@@ -237,6 +237,8 @@ struct security_class_mapping secclass_map[] = {
 	  { "access", NULL } },
 	{ "infiniband_endport",
 	  { "manage_subnet", NULL } },
+	{ "bpf",
+	  {"map_create", "map_read", "map_write", "prog_load", "prog_run"} },
 	{ NULL }
   };
 
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h
index 1649cd18eb0b..3d54468ce334 100644
--- a/security/selinux/include/objsec.h
+++ b/security/selinux/include/objsec.h
@@ -150,6 +150,10 @@ struct pkey_security_struct {
 	u32	sid;	/* SID of pkey */
 };
 
+struct bpf_security_struct {
+	u32 sid;  /*SID of bpf obj creater*/
+};
+
 extern unsigned int selinux_checkreqprot;
 
 #endif /* _SELINUX_OBJSEC_H_ */
-- 
2.15.0.rc0.271.g36b669edcc-goog

^ permalink raw reply related

* [PATCH net-next v6 5/5] selinux: bpf: Add addtional check for bpf object file receive
From: Chenbo Feng @ 2017-10-16 19:11 UTC (permalink / raw)
  To: netdev, SELinux, linux-security-module
  Cc: Jeffrey Vander Stoep, Alexei Starovoitov, lorenzo,
	Daniel Borkmann, Stephen Smalley, James Morris, Paul Moore,
	Chenbo Feng
In-Reply-To: <20171016191135.8046-1-chenbofeng.kernel@gmail.com>

From: Chenbo Feng <fengc@google.com>

Introduce a bpf object related check when sending and receiving files
through unix domain socket as well as binder. It checks if the receiving
process have privilege to read/write the bpf map or use the bpf program.
This check is necessary because the bpf maps and programs are using a
anonymous inode as their shared inode so the normal way of checking the
files and sockets when passing between processes cannot work properly on
eBPF object. This check only works when the BPF_SYSCALL is configured.

Signed-off-by: Chenbo Feng <fengc@google.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
---
 include/linux/bpf.h      |  3 +++
 kernel/bpf/syscall.c     |  4 ++--
 security/selinux/hooks.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 1479442d5293..1ac507dc19a8 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -285,6 +285,9 @@ int bpf_prog_array_copy_to_user(struct bpf_prog_array __rcu *progs,
 #ifdef CONFIG_BPF_SYSCALL
 DECLARE_PER_CPU(int, bpf_prog_active);
 
+extern const struct file_operations bpf_map_fops;
+extern const struct file_operations bpf_prog_fops;
+
 #define BPF_PROG_TYPE(_id, _ops) \
 	extern const struct bpf_verifier_ops _ops;
 #define BPF_MAP_TYPE(_id, _ops) \
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index d3e152e282d8..8bdb98aa7f34 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -313,7 +313,7 @@ static ssize_t bpf_dummy_write(struct file *filp, const char __user *buf,
 	return -EINVAL;
 }
 
-static const struct file_operations bpf_map_fops = {
+const struct file_operations bpf_map_fops = {
 #ifdef CONFIG_PROC_FS
 	.show_fdinfo	= bpf_map_show_fdinfo,
 #endif
@@ -967,7 +967,7 @@ static void bpf_prog_show_fdinfo(struct seq_file *m, struct file *filp)
 }
 #endif
 
-static const struct file_operations bpf_prog_fops = {
+const struct file_operations bpf_prog_fops = {
 #ifdef CONFIG_PROC_FS
 	.show_fdinfo	= bpf_prog_show_fdinfo,
 #endif
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 12cf7de8cbed..2e3a627fc0b1 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1815,6 +1815,10 @@ static inline int file_path_has_perm(const struct cred *cred,
 	return inode_has_perm(cred, file_inode(file), av, &ad);
 }
 
+#ifdef CONFIG_BPF_SYSCALL
+static int bpf_fd_pass(struct file *file, u32 sid);
+#endif
+
 /* Check whether a task can use an open file descriptor to
    access an inode in a given way.  Check access to the
    descriptor itself, and then use dentry_has_perm to
@@ -1845,6 +1849,12 @@ static int file_has_perm(const struct cred *cred,
 			goto out;
 	}
 
+#ifdef CONFIG_BPF_SYSCALL
+	rc = bpf_fd_pass(file, cred_sid(cred));
+	if (rc)
+		return rc;
+#endif
+
 	/* av is zero if only checking access to the descriptor. */
 	rc = 0;
 	if (av)
@@ -2165,6 +2175,12 @@ static int selinux_binder_transfer_file(struct task_struct *from,
 			return rc;
 	}
 
+#ifdef CONFIG_BPF_SYSCALL
+	rc = bpf_fd_pass(file, sid);
+	if (rc)
+		return rc;
+#endif
+
 	if (unlikely(IS_PRIVATE(d_backing_inode(dentry))))
 		return 0;
 
@@ -6288,6 +6304,39 @@ static u32 bpf_map_fmode_to_av(fmode_t fmode)
 	return av;
 }
 
+/* This function will check the file pass through unix socket or binder to see
+ * if it is a bpf related object. And apply correspinding checks on the bpf
+ * object based on the type. The bpf maps and programs, not like other files and
+ * socket, are using a shared anonymous inode inside the kernel as their inode.
+ * So checking that inode cannot identify if the process have privilege to
+ * access the bpf object and that's why we have to add this additional check in
+ * selinux_file_receive and selinux_binder_transfer_files.
+ */
+static int bpf_fd_pass(struct file *file, u32 sid)
+{
+	struct bpf_security_struct *bpfsec;
+	struct bpf_prog *prog;
+	struct bpf_map *map;
+	int ret;
+
+	if (file->f_op == &bpf_map_fops) {
+		map = file->private_data;
+		bpfsec = map->security;
+		ret = avc_has_perm(sid, bpfsec->sid, SECCLASS_BPF,
+				   bpf_map_fmode_to_av(file->f_mode), NULL);
+		if (ret)
+			return ret;
+	} else if (file->f_op == &bpf_prog_fops) {
+		prog = file->private_data;
+		bpfsec = prog->aux->security;
+		ret = avc_has_perm(sid, bpfsec->sid, SECCLASS_BPF,
+				   BPF__PROG_RUN, NULL);
+		if (ret)
+			return ret;
+	}
+	return 0;
+}
+
 static int selinux_bpf_map(struct bpf_map *map, fmode_t fmode)
 {
 	u32 sid = current_sid();
-- 
2.15.0.rc0.271.g36b669edcc-goog

^ permalink raw reply related

* Re: [PATCH 2/3] bpf: Remove dead variable
From: Richard Weinberger @ 2017-10-16 19:22 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: netdev, linux-kernel, ast
In-Reply-To: <59E50473.7040609@iogearbox.net>

Am Montag, 16. Oktober 2017, 21:11:47 CEST schrieb Daniel Borkmann: 
> > I can squash it into 1/3, I kept it that way because
> > even without 1/3 this variable is unused.
> 
> Hmm, the helper looks like the below. In patch 1/3 you removed
> the 'if (unlikely(!task))' test where the variable was used before,
> so 2/3 without the 1/3 would result in a compile error.

Why a compile error? It emits a warning.

> BPF_CALL_0(bpf_get_current_uid_gid)
> {
> 	struct task_struct *task = current;
> 	kuid_t uid;
> 	kgid_t gid;
> 
> 	if (unlikely(!task))
> 		return -EINVAL;

Well, this is the only "user". Okay.

> 	current_uid_gid(&uid, &gid);

Here we use current. So, task was always in vain.

So, I can happily squash 2/3 into 1/3 and resent.
The series just represented the way I've worked on the code... 

Thanks,
//richard

^ permalink raw reply

* Re: [PATCH net 0/6] rtnetlink: a bunch of fixes for userspace notifications in changing dev properties
From: David Miller @ 2017-10-16 19:49 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, dsahern, hannes
In-Reply-To: <cover.1508062280.git.lucien.xin@gmail.com>

From: Xin Long <lucien.xin@gmail.com>
Date: Sun, 15 Oct 2017 18:13:40 +0800

> Whenever any property of a link, address, route, etc. changes by whatever way,
> kernel should notify the programs that listen for such events in userspace.
> 
> The patchet "rtnetlink: Cleanup user notifications for netdev events" tried to
> fix a redundant notifications issue, but it also introduced a side effect.
> 
> After that, user notifications could only be sent when changing dev properties
> via netlink api. As it removed some events process in rtnetlink_event where
> the notifications was sent to users.
> 
> It resulted in no notification generated when dev properties are changed via
> other ways, like ioctl, sysfs, etc. It may cause some user programs doesn't
> work as expected because of the missing notifications.
> 
> This patchset will fix it by bringing some of these netdev events back and
> also fix the old redundant notifications issue with a proper way.

Series applied, thank you.

^ permalink raw reply

* Re: [next-queue PATCH v8 0/6] TSN: Add qdisc based config interface for CBS
From: David Miller @ 2017-10-16 19:51 UTC (permalink / raw)
  To: vinicius.gomes
  Cc: netdev, intel-wired-lan, jhs, xiyou.wangcong, jiri, andre.guedes,
	ivan.briano, jesus.sanchez-palencia, boon.leong.ong,
	richardcochran, henrik, levipearson, rodney.cummings
In-Reply-To: <20171014002534.19896-1-vinicius.gomes@intel.com>


I'm fine with this patch set.  I see it's against Jeff's next-queue, so
where exactly do you want this to be merged?  My net-next tree?

Thank you.

^ permalink raw reply

* Re: [PATCH net v3] net: enable interface alias removal via rtnl
From: David Miller @ 2017-10-16 19:52 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: dsahern, netdev, oliver, stephen
In-Reply-To: <20171011142448.31707-1-nicolas.dichtel@6wind.com>

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Wed, 11 Oct 2017 16:24:48 +0200

> IFLA_IFALIAS is defined as NLA_STRING. It means that the minimal length of
> the attribute is 1 ("\0"). However, to remove an alias, the attribute
> length must be 0 (see dev_set_alias()).
> 
> Let's define the type to NLA_BINARY to allow 0-length string, so that the
> alias can be removed.
> 
> Example:
> $ ip l s dummy0 alias foo
> $ ip l l dev dummy0
> 5: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
>     link/ether ae:20:30:4f:a7:f3 brd ff:ff:ff:ff:ff:ff
>     alias foo
> 
> Before the patch:
> $ ip l s dummy0 alias ""
> RTNETLINK answers: Numerical result out of range
> 
> After the patch:
> $ ip l s dummy0 alias ""
> $ ip l l dev dummy0
> 5: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
>     link/ether ae:20:30:4f:a7:f3 brd ff:ff:ff:ff:ff:ff
> 
> CC: Oliver Hartkopp <oliver@hartkopp.net>
> CC: Stephen Hemminger <stephen@networkplumber.org>
> Fixes: 96ca4a2cc145 ("net: remove ifalias on empty given alias")
> Reported-by: Julien FLoret <julien.floret@6wind.com>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Applied, thank you.

^ permalink raw reply

* Re: [net-next PATCH] mqprio: Reserve last 32 classid values for HW traffic classes and misc IDs
From: David Miller @ 2017-10-16 19:54 UTC (permalink / raw)
  To: alexander.duyck
  Cc: jiri, amritha.nambiar, vinicius.gomes, netdev, jhs,
	jesus.sanchez-palencia
In-Reply-To: <20171012182658.14632.9010.stgit@localhost.localdomain>

From: Alexander Duyck <alexander.duyck@gmail.com>
Date: Thu, 12 Oct 2017 11:38:45 -0700

> From: Alexander Duyck <alexander.h.duyck@intel.com>
> 
> This patch makes a slight tweak to mqprio in order to bring the
> classid values used back in line with what is used for mq. The general idea
> is to reserve values :ffe0 - :ffef to identify hardware traffic classes
> normally reported via dev->num_tc. By doing this we can maintain a
> consistent behavior with mq for classid where :1 - :ffdf will represent a
> physical qdisc mapped onto a Tx queue represented by classid - 1, and the
> traffic classes will be mapped onto a known subset of classid values
> reserved for our virtual qdiscs.
> 
> Note I reserved the range from :fff0 - :ffff since this way we might be
> able to reuse these classid values with clsact and ingress which would mean
> that for mq, mqprio, ingress, and clsact we should be able to maintain a
> similar classid layout.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>

Applied, thanks Alexander.

^ permalink raw reply

* Re: [PATCH] tracing: bpf: Hide bpf trace events when they are not used
From: David Miller @ 2017-10-16 19:54 UTC (permalink / raw)
  To: rostedt; +Cc: linux-kernel, ast, daniel, netdev
In-Reply-To: <20171012184002.0661a867@gandalf.local.home>

From: Steven Rostedt <rostedt@goodmis.org>
Date: Thu, 12 Oct 2017 18:40:02 -0400

> From: Steven Rostedt (VMware) <rostedt@goodmis.org>
> 
> All the trace events defined in include/trace/events/bpf.h are only
> used when CONFIG_BPF_SYSCALL is defined. But this file gets included by
> include/linux/bpf_trace.h which is included by the networking code with
> CREATE_TRACE_POINTS defined.
> 
> If a trace event is created but not used it still has data structures
> and functions created for its use, even though nothing is using them.
> To not waste space, do not define the BPF trace events in bpf.h unless
> CONFIG_BPF_SYSCALL is defined.
> 
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

Steven, I lost track of how this patch is being handled.

Do you want me to merge it via my net-next tree?

^ permalink raw reply

* Re: [PATCH v3] net: ftgmac100: Request clock and set speed
From: David Miller @ 2017-10-16 19:59 UTC (permalink / raw)
  To: joel; +Cc: benh, netdev, linux-kernel, andrew
In-Reply-To: <20171013041638.30763-1-joel@jms.id.au>

From: Joel Stanley <joel@jms.id.au>
Date: Fri, 13 Oct 2017 12:16:38 +0800

> Andrew, can you please give this one a spin on hardware?

I'm waiting on this...

^ permalink raw reply

* Re: [patch net-next 0/9] net: sched: remove some tp->q usage
From: David Miller @ 2017-10-16 20:01 UTC (permalink / raw)
  To: jiri; +Cc: netdev, jhs, xiyou.wangcong, mlxsw
In-Reply-To: <20171013120105.23358-1-jiri@resnulli.us>

From: Jiri Pirko <jiri@resnulli.us>
Date: Fri, 13 Oct 2017 14:00:56 +0200

> From: Jiri Pirko <jiri@mellanox.com>
> 
> In order to prepare for block sharing, tcf_proto instances need to be
> independent on particular qdisc instances. This patchset takes care of
> removal of couple occurrences of tp->q usage.

Series applied, thanks Jiri.

^ permalink raw reply

* Re: [PATCH] tracing: bpf: Hide bpf trace events when they are not used
From: Steven Rostedt @ 2017-10-16 20:01 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel, ast, daniel, netdev
In-Reply-To: <20171016.205434.1066116631088582472.davem@davemloft.net>

On Mon, 16 Oct 2017 20:54:34 +0100 (WEST)
David Miller <davem@davemloft.net> wrote:

> Steven, I lost track of how this patch is being handled.
> 
> Do you want me to merge it via my net-next tree?

If you want. I could take it too if you give me an ack. It's not
dependent on any other changes so it doesn't matter which way it goes. I
know Alexei was thinking about doing the same for xdp but those appear
to be used even without BPF_SYSCALLS.

-- Steve

^ permalink raw reply

* Re: [Patch net] tun: call dev_get_valid_name() before register_netdevice()
From: David Miller @ 2017-10-16 20:04 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: netdev, avekceeb, jasowang, mst
In-Reply-To: <20171013185853.21353-1-xiyou.wangcong@gmail.com>

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Fri, 13 Oct 2017 11:58:53 -0700

> register_netdevice() could fail early when we have an invalid
> dev name, in which case ->ndo_uninit() is not called. For tun
> device, this is a problem because a timer etc. are already
> initialized and it expects ->ndo_uninit() to clean them up.
> 
> We could move these initializations into a ->ndo_init() so
> that register_netdevice() knows better, however this is still
> complicated due to the logic in tun_detach().
> 
> Therefore, I choose to just call dev_get_valid_name() before
> register_netdevice(), which is quicker and much easier to audit.
> And for this specific case, it is already enough.
> 
> Fixes: 96442e42429e ("tuntap: choose the txq based on rxq")
> Reported-by: Dmitry Alexeev <avekceeb@gmail.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Applied and queued up for -stable.

^ permalink raw reply

* Re: [PATCH net-next] ipv6: check fn before doing FIB6_SUBTREE(fn)
From: David Miller @ 2017-10-16 20:06 UTC (permalink / raw)
  To: weiwan; +Cc: netdev, edumazet, kafai
In-Reply-To: <20171013220108.88710-1-tracywwnj@gmail.com>

From: Wei Wang <weiwan@google.com>
Date: Fri, 13 Oct 2017 15:01:08 -0700

> From: Wei Wang <weiwan@google.com>
> 
> In fib6_locate(), we need to first make sure fn is not NULL before doing
> FIB6_SUBTREE(fn) to avoid crash.
> 
> This fixes the following static checker warning:
> net/ipv6/ip6_fib.c:1462 fib6_locate()
>          warn: variable dereferenced before check 'fn' (see line 1459)
> 
> net/ipv6/ip6_fib.c
>   1458          if (src_len) {
>   1459                  struct fib6_node *subtree = FIB6_SUBTREE(fn);
>                                                     ^^^^^^^^^^^^^^^^
> We shifted this dereference
> 
>   1460
>   1461                  WARN_ON(saddr == NULL);
>   1462                  if (fn && subtree)
>                             ^^
> before the check for NULL.
> 
>   1463                          fn = fib6_locate_1(subtree, saddr, src_len,
>   1464                                             offsetof(struct rt6_info, rt6i_src)
> 
> Fixes: 66f5d6ce53e6 ("ipv6: replace rwlock with rcu and spinlock in fib6_table")
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Wei Wang <weiwan@google.com>
> Acked-by: Eric Dumazet <edumazet@google.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] ipv6: only update __use and lastusetime once per jiffy at most
From: David Miller @ 2017-10-16 20:09 UTC (permalink / raw)
  To: weiwan; +Cc: netdev, edumazet, kafai, pabeni
In-Reply-To: <20171013220807.90366-1-tracywwnj@gmail.com>

From: Wei Wang <weiwan@google.com>
Date: Fri, 13 Oct 2017 15:08:07 -0700

> From: Wei Wang <weiwan@google.com>
> 
> In order to not dirty the cacheline too often, we try to only update
> dst->__use and dst->lastusetime at most once per jiffy.
> As dst->lastusetime is only used by ipv6 garbage collector, it should
> be good enough time resolution.
> And __use is only used in ipv6_route_seq_show() to show how many times a
> dst has been used. And as __use is not atomic_t right now, it does not
> show the precise number of usage times anyway. So we think it should be
> OK to only update it at most once per jiffy.
> 
> According to my latest syn flood test on a machine with intel Xeon 6th
> gen processor and 2 10G mlx nics bonded together, each with 8 rx queues
> on 2 NUMA nodes:
> With this patch, the packet process rate increases from ~3.49Mpps to
> ~3.75Mpps with a 7% increase rate.
> 
> Note: dst_use() is being renamed to dst_hold_and_use() to better specify
> the purpose of the function.
> 
> Signed-off-by: Wei Wang <weiwan@google.com>
> Acked-by: Eric Dumazet <edumazet@googl.com>

Also applied, thank you.

^ permalink raw reply

* Re: [PATCH] tracing: bpf: Hide bpf trace events when they are not used
From: David Miller @ 2017-10-16 20:11 UTC (permalink / raw)
  To: rostedt; +Cc: linux-kernel, ast, daniel, netdev
In-Reply-To: <20171016160125.2a927a83@gandalf.local.home>

From: Steven Rostedt <rostedt@goodmis.org>
Date: Mon, 16 Oct 2017 16:01:25 -0400

> On Mon, 16 Oct 2017 20:54:34 +0100 (WEST)
> David Miller <davem@davemloft.net> wrote:
> 
>> Steven, I lost track of how this patch is being handled.
>> 
>> Do you want me to merge it via my net-next tree?
> 
> If you want. I could take it too if you give me an ack. It's not
> dependent on any other changes so it doesn't matter which way it goes. I
> know Alexei was thinking about doing the same for xdp but those appear
> to be used even without BPF_SYSCALLS.

Ok, applied to my net-next tree and if you want to apply it to your's
too, here is the ACK:

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply

* [PATCH] decnet: af_decnet: mark expected switch fall-throughs
From: Gustavo A. R. Silva @ 2017-10-16 20:11 UTC (permalink / raw)
  To: David S. Miller
  Cc: linux-decnet-user, netdev, linux-kernel, Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
This code was tested by compilation only (GCC 7.2.0 was used).
Please, verify if the actual intention of the code is to fall through.

 net/decnet/af_decnet.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index 73a0399..5d52f0c 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -634,10 +634,12 @@ static void dn_destroy_sock(struct sock *sk)
 		goto disc_reject;
 	case DN_RUN:
 		scp->state = DN_DI;
+		/* fall through */
 	case DN_DI:
 	case DN_DR:
 disc_reject:
 		dn_nsp_send_disc(sk, NSP_DISCINIT, 0, sk->sk_allocation);
+		/* fall through */
 	case DN_NC:
 	case DN_NR:
 	case DN_RJ:
@@ -651,6 +653,7 @@ static void dn_destroy_sock(struct sock *sk)
 		break;
 	default:
 		printk(KERN_DEBUG "DECnet: dn_destroy_sock passed socket in invalid state\n");
+		/* fall through */
 	case DN_O:
 		dn_stop_slow_timer(sk);
 
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH v2] pch_gbe: Switch to new PCI IRQ allocation API
From: David Miller @ 2017-10-16 20:13 UTC (permalink / raw)
  To: andriy.shevchenko; +Cc: netdev
In-Reply-To: <20171014140440.21439-1-andriy.shevchenko@linux.intel.com>

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Sat, 14 Oct 2017 17:04:40 +0300

> This removes custom flag handling.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied to net-next, thanks.

^ permalink raw reply

* Re: [PATCH] ipv6: addrconf: Use normal debugging style
From: David Miller @ 2017-10-16 20:14 UTC (permalink / raw)
  To: joe; +Cc: kuznet, yoshfuji, dsahern, netdev, linux-kernel
In-Reply-To: <9b7a23d78aff76a0d1e9078715e9932c9ba57b43.1508085878.git.joe@perches.com>

From: Joe Perches <joe@perches.com>
Date: Sun, 15 Oct 2017 09:49:10 -0700

> Remove local ADBG macro and use netdev_dbg/pr_debug
> 
> Miscellanea:
> 
> o Remove unnecessary debug message after allocation failure as there
>   already is a dump_stack() on the failure paths
> o Leave the allocation failure message on snmp6_alloc_dev as there
>   is one code path that does not do a dump_stack()
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Joe please resubmit this when/if David's changes get applied.

^ permalink raw reply

* Re: [PATCH] net: dccp: mark expected switch fall-throughs
From: David Miller @ 2017-10-16 20:15 UTC (permalink / raw)
  To: garsilva; +Cc: gerrit, dccp, netdev, linux-kernel
In-Reply-To: <20171015182210.GA13849@embeddedor.com>

From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Date: Sun, 15 Oct 2017 13:22:10 -0500

> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Notice that for options.c file, I placed the "fall through" comment
> on its own line, which is what GCC is expecting to find.
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Applied to net-next.

^ permalink raw reply

* Re: [PATCH] inet: frags: Convert timers to use timer_setup()
From: Stefan Schmidt @ 2017-10-16 20:16 UTC (permalink / raw)
  To: Kees Cook, linux-kernel
  Cc: Alexander Aring, Stefan Schmidt, David S. Miller,
	Alexey Kuznetsov, Hideaki YOSHIFUJI, Pablo Neira Ayuso,
	Jozsef Kadlecsik, Florian Westphal, linux-wpan, netdev,
	netfilter-devel, coreteam, Thomas Gleixner
In-Reply-To: <20171005005233.GA23612@beast>

Hello.

On 05.10.2017 02:52, Kees Cook wrote:
> In preparation for unconditionally passing the struct timer_list pointer to
> all timer callbacks, switch to using the new timer_setup() and from_timer()
> to pass the timer pointer explicitly.
> 
> Cc: Alexander Aring <alex.aring@gmail.com>
> Cc: Stefan Schmidt <stefan@osg.samsung.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
> Cc: Pablo Neira Ayuso <pablo@netfilter.org>
> Cc: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
> Cc: Florian Westphal <fw@strlen.de>
> Cc: linux-wpan@vger.kernel.org
> Cc: netdev@vger.kernel.org
> Cc: netfilter-devel@vger.kernel.org
> Cc: coreteam@netfilter.org
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> This requires commit 686fef928bba ("timer: Prepare to change timer
> callback argument type") in v4.14-rc3, but should be otherwise
> stand-alone.
> ---
>  include/net/inet_frag.h                 | 2 +-
>  net/ieee802154/6lowpan/reassembly.c     | 5 +++--
>  net/ipv4/inet_fragment.c                | 4 ++--
>  net/ipv4/ip_fragment.c                  | 5 +++--
>  net/ipv6/netfilter/nf_conntrack_reasm.c | 5 +++--
>  net/ipv6/reassembly.c                   | 5 +++--
>  6 files changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
> index fc59e0775e00..c695807ca707 100644
> --- a/include/net/inet_frag.h
> +++ b/include/net/inet_frag.h
> @@ -95,7 +95,7 @@ struct inet_frags {
>  	void			(*constructor)(struct inet_frag_queue *q,
>  					       const void *arg);
>  	void			(*destructor)(struct inet_frag_queue *);
> -	void			(*frag_expire)(unsigned long data);
> +	void			(*frag_expire)(struct timer_list *t);
>  	struct kmem_cache	*frags_cachep;
>  	const char		*frags_cache_name;
>  };
> diff --git a/net/ieee802154/6lowpan/reassembly.c b/net/ieee802154/6lowpan/reassembly.c
> index f85b08baff16..85bf86ad6b18 100644
> --- a/net/ieee802154/6lowpan/reassembly.c
> +++ b/net/ieee802154/6lowpan/reassembly.c
> @@ -80,12 +80,13 @@ static void lowpan_frag_init(struct inet_frag_queue *q, const void *a)
>  	fq->daddr = *arg->dst;
>  }
>  
> -static void lowpan_frag_expire(unsigned long data)
> +static void lowpan_frag_expire(struct timer_list *t)
>  {
> +	struct inet_frag_queue *frag = from_timer(frag, t, timer);
>  	struct frag_queue *fq;
>  	struct net *net;
>  
> -	fq = container_of((struct inet_frag_queue *)data, struct frag_queue, q);
> +	fq = container_of(frag, struct frag_queue, q);
>  	net = container_of(fq->q.net, struct net, ieee802154_lowpan.frags);
>  
>  	spin_lock(&fq->q.lock);
> diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c
> index af74d0433453..7f3ef5c287a1 100644
> --- a/net/ipv4/inet_fragment.c
> +++ b/net/ipv4/inet_fragment.c
> @@ -147,7 +147,7 @@ inet_evict_bucket(struct inet_frags *f, struct inet_frag_bucket *hb)
>  	spin_unlock(&hb->chain_lock);
>  
>  	hlist_for_each_entry_safe(fq, n, &expired, list_evictor)
> -		f->frag_expire((unsigned long) fq);
> +		f->frag_expire(&fq->timer);
>  
>  	return evicted;
>  }
> @@ -366,7 +366,7 @@ static struct inet_frag_queue *inet_frag_alloc(struct netns_frags *nf,
>  	f->constructor(q, arg);
>  	add_frag_mem_limit(nf, f->qsize);
>  
> -	setup_timer(&q->timer, f->frag_expire, (unsigned long)q);
> +	timer_setup(&q->timer, f->frag_expire, 0);
>  	spin_lock_init(&q->lock);
>  	refcount_set(&q->refcnt, 1);
>  
> diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
> index 46408c220d9d..9215654a401f 100644
> --- a/net/ipv4/ip_fragment.c
> +++ b/net/ipv4/ip_fragment.c
> @@ -190,12 +190,13 @@ static bool frag_expire_skip_icmp(u32 user)
>  /*
>   * Oops, a fragment queue timed out.  Kill it and send an ICMP reply.
>   */
> -static void ip_expire(unsigned long arg)
> +static void ip_expire(struct timer_list *t)
>  {
> +	struct inet_frag_queue *frag = from_timer(frag, t, timer);
>  	struct ipq *qp;
>  	struct net *net;
>  
> -	qp = container_of((struct inet_frag_queue *) arg, struct ipq, q);
> +	qp = container_of(frag, struct ipq, q);
>  	net = container_of(qp->q.net, struct net, ipv4.frags);
>  
>  	rcu_read_lock();
> diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
> index b263bf3a19f7..977d8900cfd1 100644
> --- a/net/ipv6/netfilter/nf_conntrack_reasm.c
> +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
> @@ -169,12 +169,13 @@ static unsigned int nf_hashfn(const struct inet_frag_queue *q)
>  	return nf_hash_frag(nq->id, &nq->saddr, &nq->daddr);
>  }
>  
> -static void nf_ct_frag6_expire(unsigned long data)
> +static void nf_ct_frag6_expire(struct timer_list *t)
>  {
> +	struct inet_frag_queue *frag = from_timer(frag, t, timer);
>  	struct frag_queue *fq;
>  	struct net *net;
>  
> -	fq = container_of((struct inet_frag_queue *)data, struct frag_queue, q);
> +	fq = container_of(frag, struct frag_queue, q);
>  	net = container_of(fq->q.net, struct net, nf_frag.frags);
>  
>  	ip6_expire_frag_queue(net, fq, &nf_frags);
> diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
> index 846012eae526..afbc000ad4f2 100644
> --- a/net/ipv6/reassembly.c
> +++ b/net/ipv6/reassembly.c
> @@ -170,12 +170,13 @@ void ip6_expire_frag_queue(struct net *net, struct frag_queue *fq,
>  }
>  EXPORT_SYMBOL(ip6_expire_frag_queue);
>  
> -static void ip6_frag_expire(unsigned long data)
> +static void ip6_frag_expire(struct timer_list *t)
>  {
> +	struct inet_frag_queue *frag = from_timer(frag, t, timer);
>  	struct frag_queue *fq;
>  	struct net *net;
>  
> -	fq = container_of((struct inet_frag_queue *)data, struct frag_queue, q);
> +	fq = container_of(frag, struct frag_queue, q);
>  	net = container_of(fq->q.net, struct net, ipv6.frags);
>  
>  	ip6_expire_frag_queue(net, fq, &ip6_frags);
> 

For the ieee802154 part:

Acked-by: Stefan Schmidt <stefan@osg.samsung.com>

regards
Stefan Schmidt

^ permalink raw reply

* Re: [PATCH] hamradio: baycom_par: use new parport device model
From: David Miller @ 2017-10-16 20:17 UTC (permalink / raw)
  To: sudipm.mukherjee; +Cc: t.sailer, linux-kernel, linux-hams, netdev
In-Reply-To: <1508101252-14268-1-git-send-email-sudipm.mukherjee@gmail.com>

From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Date: Sun, 15 Oct 2017 22:00:52 +0100

> Modify baycom driver to use the new parallel port device model.
> 
> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH] xen-netfront, xen-netback: Use correct minimum MTU values
From: Boris Ostrovsky @ 2017-10-16 20:19 UTC (permalink / raw)
  To: Wei Liu, Mohammed Gamal
  Cc: netdev, xen-devel, paul.durrant, linux-kernel, vkuznets, otubo,
	cavery, cheshi, Juergen Gross
In-Reply-To: <20171016150522.nebui653rkjove7r@citrix.com>

On 10/16/2017 11:05 AM, Wei Liu wrote:
> On Mon, Oct 16, 2017 at 03:20:32PM +0200, Mohammed Gamal wrote:
>> RFC791 specifies the minimum MTU to be 68, while xen-net{front|back}
>> drivers use a minimum value of 0.
>>
>> When set MTU to 0~67 with xen_net{front|back} driver, the network
>> will become unreachable immediately, the guest can no longer be pinged.
>>
>> xen_net{front|back} should not allow the user to set this value which causes
>> network problems.
>>
>> Reported-by: Chen Shi <cheshi@redhat.com>
>> Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
> Acked-by: Wei Liu <wei.liu2@citrix.com>
>
> CC netfront maintainers


Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

I can take it via Xen tree unless there are objections.

-boris

^ permalink raw reply

* Re: [patch net-next 06/34] net: core: use dev->ingress_queue instead of tp->q
From: Daniel Borkmann @ 2017-10-16 20:20 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: netdev, davem, jhs, xiyou.wangcong, mlxsw, andrew, vivien.didelot,
	f.fainelli, michael.chan, ganeshgr, jeffrey.t.kirsher, saeedm,
	matanb, leonro, idosch, jakub.kicinski, ast, simon.horman,
	pieter.jansenvanvuuren, john.hurley, edumazet, dsahern,
	alexander.h.duyck, john.fastabend, willemb
In-Reply-To: <20171015064535.GA1970@nanopsycho.orion>

On 10/15/2017 08:45 AM, Jiri Pirko wrote:
> Sun, Oct 15, 2017 at 01:18:54AM CEST, daniel@iogearbox.net wrote:
>> On 10/13/2017 08:30 AM, Jiri Pirko wrote:
>>> Thu, Oct 12, 2017 at 11:45:43PM CEST, daniel@iogearbox.net wrote:
>>>> On 10/12/2017 07:17 PM, Jiri Pirko wrote:
>>>>> From: Jiri Pirko <jiri@mellanox.com>
>>>>>
>>>>> In sch_handle_egress and sch_handle_ingress, don't use tp->q and use
>>>>> dev->ingress_queue which stores the same pointer instead.
>>>>>
>>>>> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>>>>> ---
>>>>>     net/core/dev.c | 21 +++++++++++++++------
>>>>>     1 file changed, 15 insertions(+), 6 deletions(-)
>>>>>
>>>>> diff --git a/net/core/dev.c b/net/core/dev.c
>>>>> index fcddccb..cb9e5e5 100644
>>>>> --- a/net/core/dev.c
>>>>> +++ b/net/core/dev.c
>>>>> @@ -3273,14 +3273,18 @@ EXPORT_SYMBOL(dev_loopback_xmit);
>>>>>     static struct sk_buff *
>>>>>     sch_handle_egress(struct sk_buff *skb, int *ret, struct net_device *dev)
>>>>>     {
>>>>> +	struct netdev_queue *netdev_queue =
>>>>> +				rcu_dereference_bh(dev->ingress_queue);
>>>>>     	struct tcf_proto *cl = rcu_dereference_bh(dev->egress_cl_list);
>>>>>     	struct tcf_result cl_res;
>>>>> +	struct Qdisc *q;
>>>>>
>>>>> -	if (!cl)
>>>>> +	if (!cl || !netdev_queue)
>>>>>     		return skb;
>>>>> +	q = netdev_queue->qdisc;
>>>>
>>>> NAK, no additional overhead in the software fast-path of
>>>> sch_handle_{ingress,egress}() like this. There are users out there
>>>> that use tc in software only, so performance is critical here.
>>>
>>> Okay, how else do you suggest I can avoid the need to use tp->q?
>>> I was thinking about storing q directly to net_device, which would safe
>>> one dereference, resulting in the same amount as current cl->q.
>>
>> Sorry for late reply, mostly off for few days. netdev struct has different
>> cachelines which are hot on rx and tx (see also the location of the two
>> lists, ingress_cl_list and egress_cl_list), if you add only one qdisc
>> pointer there, then you'd at least penalize one of the two w/ potential
>> cache miss. Can we leave it in cl?
>
> Well that is the whole point of this excercise, to remove it from cl.
> The thing is, for the shared blocks, cls are shared between multiple
> qdisc instances, so cl->q makes no longer any sense.

I don't really mind if you want to remove cl->q, but lets do it without
adding any cost to the fast path. The primary motivation for this set
is hw offload, but it shouldn't be at the expense to make sw fast path
slower. cl->q is only used here for updating stats, one possible option
could be to take them out for the clsact case into dev at the expense
for two pointers (e.g. getting rid of ingress_queue would reduce it to
only one pointer), such that you have percpu {ingress,egress}_cl_stats
that control path can fetch instead when dumping qdiscs. Could be one,
but there are probably other options as well to explore.

Thanks,
Daniel

^ permalink raw reply

* Re: [PATCH net] net/sched: cls_flower: Set egress_dev mark when calling into the HW driver
From: David Miller @ 2017-10-16 20:20 UTC (permalink / raw)
  To: ogerlitz; +Cc: jiri, netdev, mlxsw, roid
In-Reply-To: <1508145588-29959-1-git-send-email-ogerlitz@mellanox.com>

From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Mon, 16 Oct 2017 12:19:48 +0300

> Commit 7091d8c '(net/sched: cls_flower: Add offload support using egress
> Hardware device') made sure (when fl_hw_replace_filter is called) to put
> the egress_dev mark on persisent structure instance. Hence, following calls
> into the HW driver for stats and deletion will note it and act accordingly.
> 
> With commit de4784ca030f this property is lost and hence when called,
> the HW driver failes to operate (stats, delete) on the offloaded flow.
> 
> Fix it by setting the egress_dev flag whenever the ingress device is
> different from the hw device since this is exactly the condition under
> which we're calling into the HW driver through the egress port net-device.
> 
> Fixes: de4784ca030f ('net: sched: get rid of struct tc_to_netdev')
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
> Signed-off-by: Roi Dayan <roid@mellanox.com>
> ---
> 
> Hi Dave, the bug was introduced in 4.14-rc1 but later the related
> code was changed in net-next, hence the fix must not go to net-next, Or.

Ok, applied to 'net' and I'll watch out for this next time I merge into
net-next.

Thanks.

^ permalink raw reply

* Re: [PATCH] [net-next] net: systemport: add NET_DSA dependency
From: David Miller @ 2017-10-16 20:21 UTC (permalink / raw)
  To: arnd
  Cc: f.fainelli, michael.chan, sathya.perla, nicolas.pitre, netdev,
	linux-kernel
In-Reply-To: <20171016113258.3735473-1-arnd@arndb.de>

From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 16 Oct 2017 13:32:36 +0200

> The notifier cause a link error when NET_DSA is a loadable
> module:
> 
> drivers/net/ethernet/broadcom/bcmsysport.o: In function `bcm_sysport_remove':
> bcmsysport.c:(.text+0x1582): undefined reference to `unregister_dsa_notifier'
> drivers/net/ethernet/broadcom/bcmsysport.o: In function `bcm_sysport_probe':
> bcmsysport.c:(.text+0x278d): undefined reference to `register_dsa_notifier'
> 
> This adds a dependency that forces the systemport driver to be
> a loadable module as well when that happens, but otherwise
> allows it to be built normally when DSA is either built-in or
> completely disabled.
> 
> Fixes: d156576362c0 ("net: systemport: Establish lower/upper queue mapping")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied, thank you.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox