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

From: Eric W. Biederman
Date: Wed Feb 07 2018 - 10:20:53 EST


Christian Brauner <christian.brauner@xxxxxxxxxxxxx> writes:

> On Wed, Feb 07, 2018 at 12:19:25PM +0100, Jiri Benc wrote:
>> On Tue, 6 Feb 2018 14:19:02 +0100, Christian Brauner wrote:
>> > +/* 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