Re: [PATCH] nfc: enforce CAP_NET_RAW for raw sockets When creating a raw AF_NFC socket, CAP_NET_RAW needs to be checked first.

2020-08-06 Thread Jakub Kicinski
On Thu, 6 Aug 2020 10:28:08 +0800 Qingyu Li wrote: Commit message is required. Perhaps shorten the subject and put more info here. > Signed-off-by: Qingyu Li > --- > net/nfc/rawsock.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/net/nfc/rawsock.c b/net/nfc/rawso

[PATCH] nfc: enforce CAP_NET_RAW for raw sockets When creating a raw AF_NFC socket, CAP_NET_RAW needs to be checked first.

2020-08-05 Thread Qingyu Li
Signed-off-by: Qingyu Li --- net/nfc/rawsock.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c index ba5ffd3badd3..c1302b689a98 100644 --- a/net/nfc/rawsock.c +++ b/net/nfc/rawsock.c @@ -332,8 +332,11 @@ static int rawsock_create(struc

[PATCH 4.9 035/129] appletalk: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 6cc03e8aa36c51f3b26a0d21a3c4ce2809c842ac ] When creating a raw AF_APPLETALK socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net

[PATCH 4.9 036/129] ax25: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 0614e2b73768b502fc32a75349823356d98aae2c ] When creating a raw AF_AX25 socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ax25

[PATCH 4.14 049/185] appletalk: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 6cc03e8aa36c51f3b26a0d21a3c4ce2809c842ac ] When creating a raw AF_APPLETALK socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net

[PATCH 4.14 050/185] ax25: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 0614e2b73768b502fc32a75349823356d98aae2c ] When creating a raw AF_AX25 socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ax25

[PATCH 4.14 048/185] mISDN: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit b91ee4aa2a2199ba4d4650706c272985a5a32d80 ] When creating a raw AF_ISDN socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/

[PATCH 4.19 020/211] ax25: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 0614e2b73768b502fc32a75349823356d98aae2c ] When creating a raw AF_AX25 socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ax25

[PATCH 4.19 019/211] appletalk: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 6cc03e8aa36c51f3b26a0d21a3c4ce2809c842ac ] When creating a raw AF_APPLETALK socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net

[PATCH 5.2 030/313] ax25: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 0614e2b73768b502fc32a75349823356d98aae2c ] When creating a raw AF_AX25 socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ax25

[PATCH 5.3 035/344] ax25: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 0614e2b73768b502fc32a75349823356d98aae2c ] When creating a raw AF_AX25 socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ax25

[PATCH 5.3 033/344] mISDN: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit b91ee4aa2a2199ba4d4650706c272985a5a32d80 ] When creating a raw AF_ISDN socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/

[PATCH 5.3 034/344] appletalk: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 6cc03e8aa36c51f3b26a0d21a3c4ce2809c842ac ] When creating a raw AF_APPLETALK socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net

[PATCH 5.3 036/344] ieee802154: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit e69dbd4619e7674c1679cba49afd9dd9ac347eef ] When creating a raw AF_IEEE802154 socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Acked-by: Stefan Schmidt Signed-off-by: David S. Miller Signed-off-by: G

[PATCH 5.3 037/344] nfc: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 3a359798b176183ef09efb7a3dc59abad1cc7104 ] When creating a raw AF_NFC socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/nfc/l

[PATCH 5.2 032/313] nfc: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 3a359798b176183ef09efb7a3dc59abad1cc7104 ] When creating a raw AF_NFC socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/nfc/l

[PATCH 5.2 029/313] appletalk: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 6cc03e8aa36c51f3b26a0d21a3c4ce2809c842ac ] When creating a raw AF_APPLETALK socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net

[PATCH 5.2 031/313] ieee802154: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit e69dbd4619e7674c1679cba49afd9dd9ac347eef ] When creating a raw AF_IEEE802154 socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Acked-by: Stefan Schmidt Signed-off-by: David S. Miller Signed-off-by: G

[PATCH 5.2 028/313] mISDN: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit b91ee4aa2a2199ba4d4650706c272985a5a32d80 ] When creating a raw AF_ISDN socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/

[PATCH 4.19 021/211] ieee802154: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit e69dbd4619e7674c1679cba49afd9dd9ac347eef ] When creating a raw AF_IEEE802154 socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Acked-by: Stefan Schmidt Signed-off-by: David S. Miller Signed-off-by: G

[PATCH 4.19 022/211] nfc: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 3a359798b176183ef09efb7a3dc59abad1cc7104 ] When creating a raw AF_NFC socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/nfc/l

[PATCH 4.19 018/211] mISDN: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit b91ee4aa2a2199ba4d4650706c272985a5a32d80 ] When creating a raw AF_ISDN socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/

[PATCH 4.14 052/185] nfc: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 3a359798b176183ef09efb7a3dc59abad1cc7104 ] When creating a raw AF_NFC socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/nfc/l

[PATCH 4.14 051/185] ieee802154: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit e69dbd4619e7674c1679cba49afd9dd9ac347eef ] When creating a raw AF_IEEE802154 socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Acked-by: Stefan Schmidt Signed-off-by: David S. Miller Signed-off-by: G

[PATCH 4.9 038/129] nfc: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 3a359798b176183ef09efb7a3dc59abad1cc7104 ] When creating a raw AF_NFC socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/nfc/l

[PATCH 4.9 037/129] ieee802154: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit e69dbd4619e7674c1679cba49afd9dd9ac347eef ] When creating a raw AF_IEEE802154 socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Acked-by: Stefan Schmidt Signed-off-by: David S. Miller Signed-off-by: G

[PATCH 4.9 034/129] mISDN: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit b91ee4aa2a2199ba4d4650706c272985a5a32d80 ] When creating a raw AF_ISDN socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/

[PATCH 4.4 32/99] nfc: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 3a359798b176183ef09efb7a3dc59abad1cc7104 ] When creating a raw AF_NFC socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/nfc/l

[PATCH 4.4 31/99] ieee802154: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit e69dbd4619e7674c1679cba49afd9dd9ac347eef ] When creating a raw AF_IEEE802154 socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Acked-by: Stefan Schmidt Signed-off-by: David S. Miller Signed-off-by: G

[PATCH 4.4 30/99] ax25: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 0614e2b73768b502fc32a75349823356d98aae2c ] When creating a raw AF_AX25 socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ax25

[PATCH 4.4 29/99] appletalk: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit 6cc03e8aa36c51f3b26a0d21a3c4ce2809c842ac ] When creating a raw AF_APPLETALK socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net

[PATCH 4.4 28/99] mISDN: enforce CAP_NET_RAW for raw sockets

2019-10-03 Thread Greg Kroah-Hartman
From: Ori Nimron [ Upstream commit b91ee4aa2a2199ba4d4650706c272985a5a32d80 ] When creating a raw AF_ISDN socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/

[PATCH 4.20 21/32] af_packet: fix raw sockets over 6in4 tunnel

2019-02-21 Thread Greg Kroah-Hartman
4.20-stable review patch. If anyone has any objections, please let me know. -- [ Upstream commit 88a8121dc1d3d0dbddd411b79ed236b6b6ea415c ] Since commit cb9f1b783850, scapy (which uses an AF_PACKET socket in SOCK_RAW mode) is unable to send a basic icmp packet over a sit tunnel:

[PATCH 4.19 01/30] af_packet: fix raw sockets over 6in4 tunnel

2019-02-21 Thread Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know. -- [ Upstream commit 88a8121dc1d3d0dbddd411b79ed236b6b6ea415c ] Since commit cb9f1b783850, scapy (which uses an AF_PACKET socket in SOCK_RAW mode) is unable to send a basic icmp packet over a sit tunnel:

[PATCH 4.4 05/70] ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF

2018-11-26 Thread Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know. -- From: David Ahern [ Upstream commit 7ddacfa564870cdd97275fd87decb6174abc6380 ] Preethi reported that PMTU discovery for UDP/raw applications is not working in the presence of VRF when the socket is n

[PATCH 4.14 04/21] ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF

2018-11-21 Thread Greg Kroah-Hartman
4.14-stable review patch. If anyone has any objections, please let me know. -- From: David Ahern [ Upstream commit 7ddacfa564870cdd97275fd87decb6174abc6380 ] Preethi reported that PMTU discovery for UDP/raw applications is not working in the presence of VRF when the socket is

[PATCH 4.9 09/59] ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF

2018-11-21 Thread Greg Kroah-Hartman
4.9-stable review patch. If anyone has any objections, please let me know. -- From: David Ahern [ Upstream commit 7ddacfa564870cdd97275fd87decb6174abc6380 ] Preethi reported that PMTU discovery for UDP/raw applications is not working in the presence of VRF when the socket is n

[PATCH 4.19 05/42] ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF

2018-11-21 Thread Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know. -- From: David Ahern [ Upstream commit 7ddacfa564870cdd97275fd87decb6174abc6380 ] Preethi reported that PMTU discovery for UDP/raw applications is not working in the presence of VRF when the socket is

Re: [PATCH v7] net: ip, diag -- Add diag interface for raw sockets

2016-10-23 Thread Cyrill Gorcunov
nix, tcp, udp[lite], packet, netlink it works as expected, > > the raw sockets do not have. Thus add it. > > Applied, thanks. Thanks to all for extensive comments and review!

Re: [PATCH v7] net: ip, diag -- Add diag interface for raw sockets

2016-10-22 Thread David Miller
From: Cyrill Gorcunov Date: Fri, 21 Oct 2016 13:03:44 +0300 > In criu we are actively using diag interface to collect sockets > present in the system when dumping applications. And while for > unix, tcp, udp[lite], packet, netlink it works as expected, > the raw sockets do not have.

[PATCH v7] net: ip, diag -- Add diag interface for raw sockets

2016-10-21 Thread Cyrill Gorcunov
In criu we are actively using diag interface to collect sockets present in the system when dumping applications. And while for unix, tcp, udp[lite], packet, netlink it works as expected, the raw sockets do not have. Thus add it. v2: - add missing sock_put calls in raw_diag_dump_one (by

Re: [PATCH v6] net: ip, diag -- Add diag interface for raw sockets

2016-10-13 Thread Cyrill Gorcunov
On Thu, Oct 13, 2016 at 09:43:57AM -0600, David Ahern wrote: > On 10/13/16 1:16 AM, Cyrill Gorcunov wrote: > > On Wed, Oct 12, 2016 at 07:55:04PM -0400, David Miller wrote: > >> From: Cyrill Gorcunov > >> Date: Wed, 12 Oct 2016 09:53:29 +0300 > >> > >>> I can't rename the field, neither a can use

Re: [PATCH v6] net: ip, diag -- Add diag interface for raw sockets

2016-10-13 Thread David Ahern
On 10/13/16 1:16 AM, Cyrill Gorcunov wrote: > On Wed, Oct 12, 2016 at 07:55:04PM -0400, David Miller wrote: >> From: Cyrill Gorcunov >> Date: Wed, 12 Oct 2016 09:53:29 +0300 >> >>> I can't rename the field, neither a can use union. >> >> Remind me again what is wrong with using an anonymous union?

Re: [PATCH v6] net: ip, diag -- Add diag interface for raw sockets

2016-10-13 Thread Cyrill Gorcunov
On Wed, Oct 12, 2016 at 07:55:04PM -0400, David Miller wrote: > From: Cyrill Gorcunov > Date: Wed, 12 Oct 2016 09:53:29 +0300 > > > I can't rename the field, neither a can use union. > > Remind me again what is wrong with using an anonymous union? Anon union would be a preferred but Eric pointe

Re: [PATCH v6] net: ip, diag -- Add diag interface for raw sockets

2016-10-12 Thread David Miller
From: Cyrill Gorcunov Date: Wed, 12 Oct 2016 09:53:29 +0300 > I can't rename the field, neither a can use union. Remind me again what is wrong with using an anonymous union?

Re: [PATCH v6] net: ip, diag -- Add diag interface for raw sockets

2016-10-11 Thread Cyrill Gorcunov
On Wed, Oct 12, 2016 at 01:50:22AM -0400, David Miller wrote: > > Macros that look like function calls and are also lvalues tend to be > troublesome. > > I know what you're trying to achieve, you want a named way to access > this so that the intent and semantics are clear. > > But I'd rather you

Re: [PATCH v6] net: ip, diag -- Add diag interface for raw sockets

2016-10-11 Thread David Miller
From: Cyrill Gorcunov Date: Thu, 6 Oct 2016 13:00:55 +0300 > v6: > - use sdiag_raw_protocol() helper which will access @pad >structure used for raw sockets protocol specification: >we can't simply rename this member without breaking uapi. Macros that look like funct

[PATCH v6] net: ip, diag -- Add diag interface for raw sockets

2016-10-06 Thread Cyrill Gorcunov
In criu we are actively using diag interface to collect sockets present in the system when dumping applications. And while for unix, tcp, udp[lite], packet, netlink it works as expected, the raw sockets do not have. Thus add it. v2: - add missing sock_put calls in raw_diag_dump_one (by

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Cyrill Gorcunov
On Wed, Sep 28, 2016 at 06:49:51AM -0700, Eric Dumazet wrote: > > > > 4.7 is pretty widespread, so I've to think... > > Sorry, 4.4.7 it was > > https://www.mail-archive.com/netdev@vger.kernel.org/msg128714.html Ah, thanks for info!

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Eric Dumazet
On Wed, 2016-09-28 at 16:43 +0300, Cyrill Gorcunov wrote: > On Wed, Sep 28, 2016 at 06:29:08AM -0700, Eric Dumazet wrote: > > > > > > Oh, crap :( I've been looking into uapi headers, found that we > > > use anonymous unions (for example include/uapi/linux/bcache.h) > > > and thought it will be saf

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Cyrill Gorcunov
On Wed, Sep 28, 2016 at 06:29:08AM -0700, Eric Dumazet wrote: > > > > Oh, crap :( I've been looking into uapi headers, found that we > > use anonymous unions (for example include/uapi/linux/bcache.h) > > and thought it will be safe (and my test builds didn't fail). > > Are you happen to know which

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Eric Dumazet
On Wed, 2016-09-28 at 16:03 +0300, Cyrill Gorcunov wrote: > On Wed, Sep 28, 2016 at 05:57:12AM -0700, Eric Dumazet wrote: > ... > > Note that some programs could fail to compile with the added union > > anyway. > > > > Some gcc versions are unable to compile a static init with an union > > > > st

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Cyrill Gorcunov
On Wed, Sep 28, 2016 at 06:02:11AM -0700, Eric Dumazet wrote: > > This is a bit different of course, since struct tc_fq_qd_stats is only > one way : Kernel produces the content and gives it to user space. > > User space should probably not need to initialize such a structure, but > who knows what

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Eric Dumazet
On Wed, 2016-09-28 at 05:57 -0700, Eric Dumazet wrote: > Note that some programs could fail to compile with the added union > anyway. > > Some gcc versions are unable to compile a static init with an union > > struct inet_diag_req_v2 foo = { .pad = 0, sdiag_family = AF_INET, }; > > When I cooke

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Cyrill Gorcunov
On Wed, Sep 28, 2016 at 05:57:12AM -0700, Eric Dumazet wrote: ... > Note that some programs could fail to compile with the added union > anyway. > > Some gcc versions are unable to compile a static init with an union > > struct inet_diag_req_v2 foo = { .pad = 0, sdiag_family = AF_INET, }; > > Wh

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Cyrill Gorcunov
On Wed, Sep 28, 2016 at 08:50:31AM -0400, Jamal Hadi Salim wrote: > > struct tcp_info. Yeah I see. As I said naming pads will be safe but to do so we will have to compile on every arch we support and make sure the implicit pad remains here. > Sorry - i didnt mean to drag this for long; but the m

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Eric Dumazet
On Wed, 2016-09-28 at 14:27 +0300, Cyrill Gorcunov wrote: > On Wed, Sep 28, 2016 at 07:06:26AM -0400, Jamal Hadi Salim wrote: > > > > > > This structure is uapi, so anyone has complete rights to reference > > > @pad in the userspace programs. Sure it would be more clear to remove > > > the @pad co

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Jamal Hadi Salim
On 16-09-28 08:45 AM, Cyrill Gorcunov wrote: Note: inet_diag somewhere has a netlink structure that has a hole. I pointed it out to Eric D. and he said we cant add it now because it would break ABI. Naming holes generated by a compiler for alignment sake should not break abi (because alignment

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Cyrill Gorcunov
On Wed, Sep 28, 2016 at 08:27:24AM -0400, Jamal Hadi Salim wrote: > > > > They must initialize it to zero. > > > > What if in the future actually meant to use 0 for > something?;-> For example in Cyrill's case it means PROTO_IP > Not sure if it useful to interpret or not but it is part of the >

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Jamal Hadi Salim
On 16-09-28 08:27 AM, Jamal Hadi Salim wrote: On 16-09-28 08:16 AM, David Miller wrote: From: Jamal Hadi Salim Date: Wed, 28 Sep 2016 08:09:28 -0400 On 16-09-28 08:07 AM, David Miller wrote: Right, it would be legal for an existing user to have code that explicitly initializes every member

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Jamal Hadi Salim
On 16-09-28 08:16 AM, David Miller wrote: From: Jamal Hadi Salim Date: Wed, 28 Sep 2016 08:09:28 -0400 On 16-09-28 08:07 AM, David Miller wrote: Right, it would be legal for an existing user to have code that explicitly initializes every member of the structure, including 'pad'. So we have t

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Cyrill Gorcunov
On Wed, Sep 28, 2016 at 08:06:51AM -0400, Jamal Hadi Salim wrote: > > I understood well your point;-> Maybe my response was not clear: > _nobody should be fscking fondling pad fields_ setting them or > otherwise. > Maybe let these programs fail. I asked if you knew any such app which > did anythin

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Cyrill Gorcunov
On Wed, Sep 28, 2016 at 08:07:01AM -0400, David Miller wrote: ... > > > > I think you miss the point what I'm trying to say: currently end-user > > may have reference to this member (for any reason) and his program > > will compile and run. If we change the name the compilation procedure > > fails

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread David Miller
From: Jamal Hadi Salim Date: Wed, 28 Sep 2016 08:09:28 -0400 > On 16-09-28 08:07 AM, David Miller wrote: > >> Right, it would be legal for an existing user to have code that >> explicitly initializes every member of the structure, including 'pad'. >> So we have to keep that member around, at a m

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread David Miller
From: Jamal Hadi Salim Date: Wed, 28 Sep 2016 08:06:51 -0400 > I understood well your point;-> Maybe my response was not clear: > _nobody should be fscking fondling pad fields_ setting them or > otherwise. Especially considering potential future uses of the field, existing users absolutely must

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Jamal Hadi Salim
On 16-09-28 08:07 AM, David Miller wrote: Right, it would be legal for an existing user to have code that explicitly initializes every member of the structure, including 'pad'. So we have to keep that member around, at a minimum, for their sake. I think we need to start labelling any new pad

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Jamal Hadi Salim
On 16-09-28 07:27 AM, Cyrill Gorcunov wrote: On Wed, Sep 28, 2016 at 07:06:26AM -0400, Jamal Hadi Salim wrote: This structure is uapi, so anyone has complete rights to reference @pad in the userspace programs. Sure it would be more clear to remove the @pad completely, but if we choose so I thin

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread David Miller
From: Cyrill Gorcunov Date: Wed, 28 Sep 2016 14:27:03 +0300 > On Wed, Sep 28, 2016 at 07:06:26AM -0400, Jamal Hadi Salim wrote: >> > >> > This structure is uapi, so anyone has complete rights to reference >> > @pad in the userspace programs. Sure it would be more clear to remove >> > the @pad co

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Cyrill Gorcunov
On Wed, Sep 28, 2016 at 07:06:26AM -0400, Jamal Hadi Salim wrote: > > > > This structure is uapi, so anyone has complete rights to reference > > @pad in the userspace programs. Sure it would be more clear to remove > > the @pad completely, but if we choose so I think it's better to do > > on top i

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Jamal Hadi Salim
On 16-09-28 06:51 AM, Cyrill Gorcunov wrote: On Wed, Sep 28, 2016 at 06:43:01AM -0400, Jamal Hadi Salim wrote: [..] I dont know how compilation will fail but you may be right with note: that is not how pads have been used in the past. They are supposed to cosmetic annotation which indicates "h

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Cyrill Gorcunov
On Wed, Sep 28, 2016 at 06:43:01AM -0400, Jamal Hadi Salim wrote: ... > > > > Someone may have set it to zero explicitly on source level, and the > > compilation will fail on new kernel then. So no, keeping the name > > is reasonable. > > > > I dont know how compilation will fail but you may be

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Jamal Hadi Salim
On 16-09-28 06:17 AM, Cyrill Gorcunov wrote: On Wed, Sep 28, 2016 at 06:08:00AM -0400, Jamal Hadi Salim wrote: ... @@ -38,7 +38,10 @@ struct inet_diag_req_v2 { __u8sdiag_family; __u8sdiag_protocol; __u8idiag_ext; - __u8pad; + union { +

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Cyrill Gorcunov
On Wed, Sep 28, 2016 at 06:08:00AM -0400, Jamal Hadi Salim wrote: ... > > @@ -38,7 +38,10 @@ struct inet_diag_req_v2 { > > __u8sdiag_family; > > __u8sdiag_protocol; > > __u8idiag_ext; > > - __u8pad; > > + union { > > + __u8pad; > > + __u8s

Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Jamal Hadi Salim
On 16-09-28 05:03 AM, Cyrill Gorcunov wrote: In criu we are actively using diag interface to collect sockets present in the system when dumping applications. And while for unix, tcp, udp[lite], packet, netlink it works as expected, the raw sockets do not have. Thus add it. v2: - add missing

[PATCH v5] net: ip, diag -- Add diag interface for raw sockets

2016-09-28 Thread Cyrill Gorcunov
In criu we are actively using diag interface to collect sockets present in the system when dumping applications. And while for unix, tcp, udp[lite], packet, netlink it works as expected, the raw sockets do not have. Thus add it. v2: - add missing sock_put calls in raw_diag_dump_one (by

Re: [PATCH v4] net: ip, diag -- Add diag interface for raw sockets

2016-09-27 Thread Cyrill Gorcunov
On Tue, Sep 27, 2016 at 08:39:59AM -0700, Eric Dumazet wrote: ... > > + } > > + if (sk && !atomic_inc_not_zero(&sk->sk_refcnt)) > > + sk = NULL; > > Minor detail, but note that raw sockets do not use rcu (yet) > > Since you have read_

Re: [PATCH v4] net: ip, diag -- Add diag interface for raw sockets

2016-09-27 Thread Eric Dumazet
sk = raw_lookup(net, s, r); > + if (sk) > + break; > + } > + } > + if (sk && !atomic_inc_not_zero(&sk->sk_refcnt)) > + sk = NULL; Minor detail, but note that raw sockets do not use rcu (yet) Since you

[PATCH v4] net: ip, diag -- Add diag interface for raw sockets

2016-09-27 Thread Cyrill Gorcunov
In criu we are actively using diag interface to collect sockets present in the system when dumping applications. And while for unix, tcp, udp[lite], packet, netlink it works as expected, the raw sockets do not have. Thus add it. v2: - add missing sock_put calls in raw_diag_dump_one (by

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-27 Thread Cyrill Gorcunov
On Mon, Sep 26, 2016 at 07:54:37PM -0600, David Ahern wrote: > On 9/26/16 4:38 PM, Cyrill Gorcunov wrote: > > Something like > > > > Index: linux-ml.git/include/uapi/linux/inet_diag.h > > === > > --- linux-ml.git.orig/include/uapi/lin

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-26 Thread David Ahern
On 9/26/16 4:38 PM, Cyrill Gorcunov wrote: > Something like > > Index: linux-ml.git/include/uapi/linux/inet_diag.h > === > --- linux-ml.git.orig/include/uapi/linux/inet_diag.h2016-09-11 > 20:56:18.191584145 +0300 > +++ linux-ml.g

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-26 Thread Cyrill Gorcunov
ial. > They described as ipproto-ip in net/ipv4/af_inet.c, so it matches any > protocol specified with the socket call. In turn inet-diag module handled > predefined protocols only, in particular IPPROTO_RAW in our case. Thus > to fecth some real protocol sitting in raw sockets hashes w

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-20 Thread Cyrill Gorcunov
ly). You know, it eventually become uneasy to implement handling for sock-raw because they are special. They described as ipproto-ip in net/ipv4/af_inet.c, so it matches any protocol specified with the socket call. In turn inet-diag module handled predefined protocols only, in particular IPPROTO_RAW in

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-16 Thread Cyrill Gorcunov
On Fri, Sep 16, 2016 at 01:55:42PM -0600, David Ahern wrote: > >> Since the display is showing sockets in addition to IPPROTO_RAW: > >> > >> $ ss -A raw > >> State Recv-Q Send-QLocal Address:Port > >> Peer Address:Port > >> UNCONN 0 0

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-16 Thread David Ahern
On 9/16/16 1:52 PM, Cyrill Gorcunov wrote: > On Fri, Sep 16, 2016 at 01:47:57PM -0600, David Ahern wrote: I'm guessing you passed IPPROTO_RAW (255) as the protocol to socket(). If you pass something else (IPPROTO_ICMP for example) it won't work. >>> >>> True. To support IPPROTO

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-16 Thread Cyrill Gorcunov
On Fri, Sep 16, 2016 at 01:47:57PM -0600, David Ahern wrote: > >> > >> I'm guessing you passed IPPROTO_RAW (255) as the protocol to socket(). If > >> you pass something > >> else (IPPROTO_ICMP for example) it won't work. > > > > True. To support IPPROTO_ICMP it need enhancement. I thought start w

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-16 Thread David Ahern
On 9/16/16 1:39 PM, Cyrill Gorcunov wrote: > On Fri, Sep 16, 2016 at 01:30:28PM -0600, David Ahern wrote: >>> [root@pcs7 iproute2]# misc/ss -A raw >>> State Recv-Q Send-QLocal Address:Port >>>Peer Address:Port

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-16 Thread Cyrill Gorcunov
On Fri, Sep 16, 2016 at 01:30:28PM -0600, David Ahern wrote: > > [root@pcs7 iproute2]# misc/ss -A raw > > State Recv-Q Send-QLocal Address:Port > >Peer Address:Port > > > > ESTAB 0 0

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-16 Thread David Ahern
On 9/16/16 1:00 PM, Cyrill Gorcunov wrote: > I created veth pair and bound raw socket into it. > > [root@pcs7 iproute2]# misc/ss -A raw > State Recv-Q Send-QLocal Address:Port > Peer Address:Port

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-16 Thread Cyrill Gorcunov
On Fri, Sep 16, 2016 at 10:06:23AM +0300, Cyrill Gorcunov wrote: > On Thu, Sep 15, 2016 at 05:45:02PM -0600, David Ahern wrote: > > > > > > Try to be selective in the -K , do not kill tcp sockets ? > > > > I am running > > ss -aKw 'dev == red&#

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-16 Thread Cyrill Gorcunov
On Thu, Sep 15, 2016 at 05:45:02PM -0600, David Ahern wrote: > > > > Try to be selective in the -K , do not kill tcp sockets ? > > I am running >ss -aKw 'dev == red' > > to kill raw sockets bound to device named 'red'. Thanks David, Eric!

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-15 Thread David Ahern
>> >> >> Maybe I do something wrong for testing? > > If you kill your shell, maybe /root/sock is killer as well, thus its raw > sockets are closed. > > Try to be selective in the -K , do not kill tcp sockets ? > > I am running ss -aKw 'dev == red' to kill raw sockets bound to device named 'red'.

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-15 Thread Eric Dumazet
> :::ipv6-icmp :::* > > UNCONN 0 0 > :::ipv6-icmp :::* > > > Maybe I do something wrong for testing? If you kill your shell, maybe /root/

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-15 Thread Cyrill Gorcunov
;& > +inet_show_netlink(f, NULL, IPPROTO_RAW) == 0) > +return 0; > + > if (f->families&(1< if ((fp = net_raw_open()) == NULL) > goto outerr; > Hmm. Weird. I'm running net-next kerne

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-15 Thread David Ahern
On 9/15/16 2:22 PM, Cyrill Gorcunov wrote: >> ss -K is not working. Socket lookup fails to find a match due to a protocol >> mismatch. >> >> haven't had time to track down why there is a mismatch since the kill uses >> the socket returned >> from the dump. Won't have time to come back to this unt

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-15 Thread Eric Dumazet
On Thu, 2016-09-15 at 14:25 -0600, David Ahern wrote: > On 9/15/16 2:22 PM, Cyrill Gorcunov wrote: > >> ss -K is not working. Socket lookup fails to find a match due to a > >> protocol mismatch. > >> > >> haven't had time to track down why there is a mismatch since the kill uses > >> the socket r

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-15 Thread David Ahern
On 9/15/16 2:36 PM, Eric Dumazet wrote: > On Thu, 2016-09-15 at 14:25 -0600, David Ahern wrote: >> On 9/15/16 2:22 PM, Cyrill Gorcunov wrote: ss -K is not working. Socket lookup fails to find a match due to a protocol mismatch. haven't had time to track down why there is a mism

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-15 Thread David Ahern
On 9/15/16 2:22 PM, Cyrill Gorcunov wrote: >> ss -K is not working. Socket lookup fails to find a match due to a protocol >> mismatch. >> >> haven't had time to track down why there is a mismatch since the kill uses >> the socket returned >> from the dump. Won't have time to come back to this unt

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-15 Thread Cyrill Gorcunov
, netlink it works as expected, > > the raw sockets do not have. Thus add it. > > > > v2: > > - add missing sock_put calls in raw_diag_dump_one (by eric.dumazet@) > > - implement @destroy for diag requests (by dsa@) > > > > v3: > > - add e

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-15 Thread David Ahern
On 9/13/16 11:19 AM, Cyrill Gorcunov wrote: > In criu we are actively using diag interface to collect sockets > present in the system when dumping applications. And while for > unix, tcp, udp[lite], packet, netlink it works as expected, > the raw sockets do not have. Thus add it. >

Re: [PATCH v3] net: ip, diag -- Add diag interface for raw sockets

2016-09-13 Thread Greg
On Tue, 2016-09-13 at 20:18 +, Rustad, Mark D wrote: > Greg wrote: > > > Someday Linux will be a modern OS that just includes IPV6 and forces a > > config option to NOT have it. > > > > That'll be great. All the IS_ENABLED_(CONFIG_IPV6) scattered everywhere > > is nuts. > > > > > > Better

  1   2   >