Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1516406

Re: [PATCH net-next 1/5] net: l2tp: fix L2TP_ATTR_UDP_CSUM attribute type

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH net-next 1/5] net: l2tp: fix L2TP_ATTR_UDP_CSUM attribute type
Date 2016-11-07 19:10 +0100
Message-ID <sAWwN-6Ln-5@gated-at.bofh.it> (permalink)
References <szVCN-7Wf-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Asbjoern Sloth Toennesen <asbjorn@asbjorn.st>
Date: Fri,  4 Nov 2016 22:48:34 +0000

> L2TP_ATTR_UDP_CSUM is a flag, and gets read with
> nla_get_flag, but it is defined as NLA_U8 in
> the nla_policy.
> 
> It appears that this is only publicly used in
> iproute2, where it's broken, because it's used as
> a NLA_FLAG, and fails validation as a NLA_U8.
> 
> The only place it's used as a NLA_U8 is in
> l2tp_nl_tunnel_send(), but iproute2 again reads that
> as a flag, it's therefore always set. Fortunately
> it is never used for anything, just read.
> 
> CC: Miao Wang <shankerwangmiao@gmail.com>
> Signed-off-by: Asbjoern Sloth Toennesen <asbjorn@asbjorn.st>

This is definitely the wrong way to go about this.

The kernel is everywhere and updating iproute2 is infinitely
easier for users to do than updating the kernel.

And in any event, once exported we really should never change
the API of anything shown to userspace like this.  Just because
you can't find a user out there doesn't mean it doesn't exist.

Please instead fix iproute2 to use u8 attributes for this.

Thanks.

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 1/5] net: l2tp: fix L2TP_ATTR_UDP_CSUM attribute type Asbjoern Sloth Toennesen <asbjorn@asbjorn.st> - 2016-11-05 00:00 +0100
  [PATCH net-next 4/5] net: l2tp: cleanup: remove redundant condition Asbjoern Sloth Toennesen <asbjorn@asbjorn.st> - 2016-11-05 00:00 +0100
  [PATCH net-next 3/5] net: l2tp: netlink: l2tp_nl_tunnel_send: set UDP6 checksum flags Asbjoern Sloth Toennesen <asbjorn@asbjorn.st> - 2016-11-05 00:00 +0100
  Re: [PATCH net-next 1/5] net: l2tp: fix L2TP_ATTR_UDP_CSUM  attribute type David Miller <davem@davemloft.net> - 2016-11-07 19:10 +0100
    Re: [PATCH net-next 1/5] net: l2tp: fix L2TP_ATTR_UDP_CSUM  attribute type Asbjørn Sloth Tønnesen <asbjorn@asbjorn.st> - 2016-11-07 22:10 +0100

csiph-web