Thread (1 message) 1 message, 1 author, 2018-02-07

Re: [PATCH net 1/1 v3] rtnetlink: require unique netns identifier

From: Eric W. Biederman <hidden>
Date: 2018-02-07 15:20:50
Also in: lkml

Christian Brauner [off-list ref] writes:
On Wed, Feb 07, 2018 at 12:19:25PM +0100, Jiri Benc wrote:
quoted
On Tue,  6 Feb 2018 14:19:02 +0100, Christian Brauner wrote:
quoted
+/* Verify that rtnetlink requests supporting network namespace ids
+ * do not pass additional properties potentially referring to different
+ * network namespaces.
+ */
+static int rtnl_ensure_unique_netns(struct nlattr *tb[],
+				    struct netlink_ext_ack *extack)
+{
+	/* Requests without network namespace ids have been able to specify
+	 * multiple properties referring to different network namespaces so
+	 * don't regress them.
+	 */
+	if (!tb[IFLA_IF_NETNSID])
+		return 0;
I agree with Eric that we should enforce this also for the existing
pid/fd attributes.
Yes, I would prefer this too but in the Linux spirit of never regressing
userspace I was afraid that there might already be userspace
applications that stick a pid and an fd at the same time into an
rtnetlink request. If we are ok with potentially breaking them then we
should just go for it. It is definitely the cleaner solution.
Odds are low that anything does anything so silly.  If we accidentally
cause a regression then we fix it.  Unless you have reason to suspect
someone actually does something silly we should be good.

Eric
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help