[PATCH net-next] macvlan: fix memory hole in macvlan_dev

2017-12-08 Thread Girish Moodalbail
Move 'macaddr_count' from after 'netpoll' to after 'nest_level' to pack and reduce a memory hole. Fixes: 88ca59d1aaf28c25 (macvlan: remove unused fields in struct macvlan_dev) Signed-off-by: Girish Moodalbail --- include/linux/if_macvlan.h | 2 +- 1 file chang

[PATCH net v2 0/1] NULL pointer dereference in ipvlan_port_destroy

2017-11-16 Thread Girish Moodalbail
ipvlan test case. Girish Moodalbail (1): ipvlan: NULL pointer dereference panic in ipvlan_port_destroy drivers/net/ipvlan/ipvlan_main.c | 104 +-- 1 file changed, 55 insertions(+), 49 deletions(-) -- 1.8.3.1

[PATCH net v2 1/1] ipvlan: NULL pointer dereference panic in ipvlan_port_destroy

2017-11-16 Thread Girish Moodalbail
. Fix the issue by making ipvlan_init() and ipvlan_uninit() call symmetric. The ipvlan port will now be created inside ipvlan_init() and will be destroyed in ipvlan_uninit(). Fixes: 2ad7bf363841 (ipvlan: Initial check-in of the IPVLAN driver) Signed-off-by: Girish Moodalbail --- v1 -> v2: - t

Re: [PATCH net v2] ipv6: set all.accept_dad to 0 by default

2017-11-14 Thread Girish Moodalbail
On 11/14/17 11:10 AM, Stefano Brivio wrote: On Tue, 14 Nov 2017 10:30:33 -0800 Girish Moodalbail wrote: On 11/14/17 5:21 AM, Nicolas Dichtel wrote: With commits 35e015e1f577 and a2d3f3e33853, the global 'accept_dad' flag is also taken into account (default value is 1). If either

Re: [PATCH net v2] ipv6: set all.accept_dad to 0 by default

2017-11-14 Thread Girish Moodalbail
On 11/14/17 5:21 AM, Nicolas Dichtel wrote: With commits 35e015e1f577 and a2d3f3e33853, the global 'accept_dad' flag is also taken into account (default value is 1). If either global or per-interface flag is non-zero, DAD will be enabled on a given interface. This is not backward compatible: bef

Re: KASAN: use-after-free Read in rds_tcp_dev_event

2017-11-14 Thread Girish Moodalbail
On 11/14/17 5:22 AM, Sowmini Varadhan wrote: A few questions. - First off, why am I not seeing the original mail in this thread even when I search the mail archives, e.g., https://lkml.org/lkml/2017/11/13/954 - Girish Moodalbail writes: The issue here is that we are trying to

Re: KASAN: use-after-free Read in rds_tcp_dev_event

2017-11-13 Thread Girish Moodalbail
On 11/7/17 12:28 PM, syzbot wrote: Hello, syzkaller hit the following crash on 287683d027a3ff83feb6c7044430c79881664ecf git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master compiler: gcc (GCC) 7.1.1 20170620 .config is attached Raw console output is attached. =

Re: [Patch net] vlan: fix a use-after-free in vlan_device_event()

2017-11-09 Thread Girish Moodalbail
r_each_dev() right following this vlan_vid_del(). Fix it by moving vlan_vid_del() before setting grp. This is also symmetric to the vlan_vid_add() we call in vlan_device_event(). Reported-by: Fengguang Wu Fixes: efc73f4bbc23 ("net: Fix memory leak - vlan_info struct") Cc: Alexander Duyck Cc: Li

Re: [vlan_device_event] BUG: unable to handle kernel paging request at 6b6b6ccf

2017-11-09 Thread Girish Moodalbail
On 11/8/17 10:34 PM, Cong Wang wrote: On Wed, Nov 8, 2017 at 7:12 PM, Fengguang Wu wrote: Hi Alex, So looking over the trace the panic seems to be happening after a decnet interface is getting deleted. Is there any chance we could try compiling the kernel without decnet support to see if that

[PATCH net] net: fix incorrect comment with regard to VLAN packet handling

2017-11-07 Thread Girish Moodalbail
The commit bcc6d4790361 ("net: vlan: make non-hw-accel rx path similar to hw-accel") unified accel and non-accel path for VLAN RX. With that fix we do not register any packet_type handler for VLANs anymore, so fix the incorrect comment. Signed-off-by: Girish Moodalbail --- inc

Re: [PATCH net 0/2] NULL pointer dereference in {ipvlan|macvlan}_port_destroy

2017-11-03 Thread Girish Moodalbail
On 11/2/17 10:05 PM, David Miller wrote: From: Girish Moodalbail Date: Tue, 31 Oct 2017 09:39:45 -0700 When call to register_netdevice() (called from ipvlan_link_new()) fails, inside that function we call ipvlan_uninit() (through ndo_uninit()) to destroy the ipvlan port. Upon returning

[PATCH net 1/2] ipvlan: NULL pointer dereference panic in ipvlan_port_destroy

2017-10-31 Thread Girish Moodalbail
. Fix it. Signed-off-by: Girish Moodalbail --- drivers/net/ipvlan/ipvlan_main.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index c74893c..00a62a1 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan

[PATCH net 0/2] NULL pointer dereference in {ipvlan|macvlan}_port_destroy

2017-10-31 Thread Girish Moodalbail
eference at 0820 IP: ipvlan_port_destroy+0x2a/0xf0 [ipvlan] Similar issue exists in macvlan_port_destroy(). The following two patches fixes ipvlan and macvlan module. ----- Girish Moodalbail (2): ipvlan: NULL pointer dereference panic in ipvlan_port_destroy macvlan: NULL pointer

[PATCH net 2/2] macvlan: NULL pointer dereference panic in macvlan_port_destroy

2017-10-31 Thread Girish Moodalbail
dereference panic. Fix it. Signed-off-by: Girish Moodalbail --- drivers/net/macvlan.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index d2aea96..2520de8 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -1189,6

[PATCH] tap: reference to KVA of an unloaded module causes kernel panic

2017-10-27 Thread Girish Moodalbail
v.c) on char device holds and releases the module through cdev_get() and cdev_put() and will not allow the module to unload prematurely. Fixes: 9a393b5d5988ea4e (tap: tap as an independent module) Signed-off-by: Girish Moodalbail --- drivers/net/ipvlan/ipvtap.c | 4 ++-- drivers/net/macvtap.c

[PATCH net-next] macvlan: remove unused fields in struct macvlan_dev

2017-10-25 Thread Girish Moodalbail
he comment for MAX_TAP_QUEUES to the right place. Fixes: 635b8c8ecdd27142 (tap: Renaming tap related APIs, data structures, macros) Signed-off-by: Girish Moodalbail --- include/linux/if_macvlan.h | 15 --- include/linux/if_tap.h | 4 2 files changed, 4 insertions(+), 15

[PATCH v2] tap: double-free in error path in tap_open()

2017-10-25 Thread Girish Moodalbail
: 362899b8725b35e3 (macvtap: switch to use skb array) Signed-off-by: Girish Moodalbail --- v1 -> v2: - took care of an another issue in failure path of skb_array_init --- drivers/net/tap.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/tap.c b/drivers/

Re: [PATCH] tap: double-free in error path in tap_open()

2017-10-24 Thread Girish Moodalbail
On 10/24/17 6:55 PM, Jason Wang wrote: On 2017年10月25日 05:41, Girish Moodalbail wrote: Double free of skb_array in tap module is causing kernel panic. When tap_set_queue() fails we free skb_array right away by calling skb_array_cleanup(). However, later on skb_array_cleanup() is called again

[PATCH] tap: double-free in error path in tap_open()

2017-10-24 Thread Girish Moodalbail
: 362899b8725b35e3 (macvtap: switch to use skb array) Signed-off-by: Girish Moodalbail --- drivers/net/tap.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/tap.c b/drivers/net/tap.c index 21b71ae..878520b 100644 --- a/drivers/net/tap.c +++ b/drivers/net/tap.c

[RFC] ip: introduce IFA_F_DHCP flag

2017-10-18 Thread Girish Moodalbail
ed on whether they are DHCP or not. Signed-off-by: Girish Moodalbail --- include/uapi/linux/if_addr.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/if_addr.h b/include/uapi/linux/if_addr.h index 4318ab1..61aa8f8 100644 --- a/include/uapi/linux/if_addr.h +++ b/include/uapi

Re: [RFC] Support for UNARP (RFC 1868)

2017-10-13 Thread Girish Moodalbail
On 10/12/17 5:53 PM, Mahesh Bandewar (महेश बंडेवार) wrote: On Thu, Oct 12, 2017 at 4:06 PM, Girish Moodalbail wrote: Hello Eric, The basic idea is to mark the ARP entry either FAILED or STALE as soon as we can so that the subsequent packets that depend on that ARP entry will take the slow

Re: [RFC] Support for UNARP (RFC 1868)

2017-10-12 Thread Girish Moodalbail
Hello Eric, The basic idea is to mark the ARP entry either FAILED or STALE as soon as we can so that the subsequent packets that depend on that ARP entry will take the slow path (neigh_resolve_output()). Say, if base_reachable_time is 30 seconds, then an ARP entry will be in reachable state

[RFC] Support for UNARP (RFC 1868)

2017-10-11 Thread Girish Moodalbail
s are in the kernel, arping(8) program can be updated to send UNARP packets. Any Thoughts/Comments? Signed-off-by: Girish Moodalbail --- Compile-tested only. net/ipv4/arp.c | 46 +++--- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/net

Re: [PATCH] ipv6: gso: fix payload length when gso_size is zero

2017-10-05 Thread Girish Moodalbail
skb->head - (unsigned char *)(ipv6h + 1); Reviewed-by: Girish Moodalbail

[PATCH net-next v3] vxlan: change vxlan_[config_]validate() to use netlink_ext_ack for error reporting

2017-08-11 Thread Girish Moodalbail
The kernel log is not where users expect error messages for netlink requests; as we have extended acks now, we can replace pr_debug() with NL_SET_ERR_MSG_ATTR(). Signed-off-by: Matthias Schiffer Signed-off-by: Girish Moodalbail --- v2 -> v1: - improved messages based on the comments f

Re: [PATCH net-next v2] vxlan: change vxlan_[config_]validate() to use netlink_ext_ack for error reporting

2017-08-11 Thread Girish Moodalbail
[snip] @@ -2933,6 +2945,8 @@ static int vxlan_config_validate(struct net *src_net, struct vxlan_config *conf, */ if ((conf->flags & ~VXLAN_F_ALLOWED_GPE) || !(conf->flags & VXLAN_F_COLLECT_METADATA)) { + NL_SET_ERR_MS

[PATCH net-next v2] vxlan: change vxlan_[config_]validate() to use netlink_ext_ack for error reporting

2017-08-10 Thread Girish Moodalbail
The kernel log is not where users expect error messages for netlink requests; as we have extended acks now, we can replace pr_debug() with NL_SET_ERR_MSG_ATTR(). Signed-off-by: Matthias Schiffer Signed-off-by: Girish Moodalbail --- v1 -> v2: - addressed, error messages rewording, comme

Re: [PATCH net] geneve: maximum value of VNI cannot be used

2017-08-10 Thread Girish Moodalbail
On 8/9/17 10:41 PM, David Miller wrote: From: Girish Moodalbail Date: Tue, 8 Aug 2017 17:26:24 -0700 Geneve's Virtual Network Identifier (VNI) is 24 bit long, so the range of values for it would be from 0 to 16777215 (2^24 -1). However, one cannot create a geneve device with VNI s

[PATCH net-next] geneve: use netlink_ext_ack for error reporting in rtnl operations

2017-08-09 Thread Girish Moodalbail
request have been removed. Signed-off-by: Girish Moodalbail --- drivers/net/geneve.c | 128 --- 1 file changed, 92 insertions(+), 36 deletions(-) diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index 745d57ae..977dbcc 100644 --- a/drivers

Re: [PATCH v2 iproute2] lib: Dump ext-ack string by default

2017-08-09 Thread Girish Moodalbail
On 8/8/17 7:30 AM, David Ahern wrote: In time, errfn can be implemented for link, route, etc commands to give a much more detailed response (e.g., point to the attribute that failed). Doing so is much more complicated to process the message and convert attribute ids to names. In any case the err

[PATCH net] geneve: maximum value of VNI cannot be used

2017-08-08 Thread Girish Moodalbail
Geneve's Virtual Network Identifier (VNI) is 24 bit long, so the range of values for it would be from 0 to 16777215 (2^24 -1). However, one cannot create a geneve device with VNI set to 16777215. This patch fixes this issue. Signed-off-by: Girish Moodalbail --- drivers/net/geneve.c | 2

[PATCH iproute2] geneve: support for modifying geneve device

2017-07-25 Thread Girish Moodalbail
currently fails with 'operation not supported' error. This patch adds support for it. Signed-off-by: Girish Moodalbail --- ip/iplink_geneve.c | 82 +++--- 1 file changed, 60 insertions(+), 22 deletions(-) diff --git a/ip/iplink_genev

[PATCH net-next v3 1/1] geneve: add rtnl changelink support

2017-07-20 Thread Girish Moodalbail
, tos, and remote tunnel endpoint IP address (within the same address family)): - return -EOPNOTSUPP for attributes that cannot be changed for now. Incremental patches can make the non-supported one available in the future if needed. Signed-off-by: Girish Moodalbail --- v2 ->

Re: [PATCH net-next v2 1/1] geneve: add rtnl changelink support

2017-07-20 Thread Girish Moodalbail
Hello Pravin, +/* Quiesces the geneve device data path for both TX and RX. */ +static inline void geneve_quiesce(struct geneve_dev *geneve, + struct geneve_sock **gs4, + struct geneve_sock **gs6) +{ + *gs4 = rtnl_dereference(g

Re: [PATCH net-next v2 1/1] geneve: add rtnl changelink support

2017-07-19 Thread Girish Moodalbail
On 7/19/17 4:51 PM, David Miller wrote: From: Girish Moodalbail Date: Tue, 18 Jul 2017 16:33:06 -0700 +static inline bool geneve_dst_addr_equal(struct ip_tunnel_info *a, ... +static inline void geneve_quiesce(struct geneve_dev *geneve, ... +static inline void geneve_unquiesce(struct

[PATCH net-next v2 1/1] geneve: add rtnl changelink support

2017-07-18 Thread Girish Moodalbail
, and remote tunnel endpoint IP address (within the same address family)): - return -EOPNOTSUPP for attributes that cannot be changed for now. Incremental patches can make the non-supported one available in the future if needed. Signed-off-by: Girish Moodalbail --- v0 ->

Re: [PATCH net 0/4] macvlan: Fix some issues with changing mac addresses

2017-06-16 Thread Girish Moodalbail
x passthru macvlan mac address inheritance macvlan: convert port passthru to flags. Above 3 patches looks good to me, so Reviewed-by: Girish Moodalbail macvlan: Let passthru macvlan correctly restore lower mac address However, I have few questions/comments on the above patch. thank

Re: [PATCH net 4/4] macvlan: Let passthru macvlan correctly restore lower mac address

2017-06-16 Thread Girish Moodalbail
Sorry, it took sometime to wrap around this patch series since they all change one file and at times the same function :). On 6/16/17 6:36 AM, Vladislav Yasevich wrote: Passthru macvlans directly change the mac address of the lower level device. That's OK, but after the macvlan is deleted, th

[PATCH net-next v2] geneve: add missing rx stats accounting

2017-06-08 Thread Girish Moodalbail
There are few places on the receive path where packet drops and packet errors were not accounted for. This patch fixes that issue. Signed-off-by: Girish Moodalbail --- v0 -> v1: -modified to use canonical post-increment "x++" --- drivers/net/

[PATCH] geneve: add missing rx stats accounting

2017-06-08 Thread Girish Moodalbail
There are few places on the receive path where packet drops and packet errors were not accounted for. This patch fixes that issue. Signed-off-by: Girish Moodalbail --- drivers/net/geneve.c | 36 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a

[PATCH net-next] macsec: double accounting of dropped rx/tx packets

2017-05-19 Thread Girish Moodalbail
nk is retrieved, the packets dropped in netdev framework will be included in dev_get_stats() after calling macsec.c`macsec_get_stats64() Signed-off-by: Girish Moodalbail --- drivers/net/macsec.c | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/net/macse

Re: [PATCH net-next] geneve: add rtnl changelink support

2017-05-18 Thread Girish Moodalbail
comments.. Signed-off-by: Girish Moodalbail --- drivers/net/geneve.c | 149 --- 1 file changed, 117 insertions(+), 32 deletions(-) ... @@ -1169,45 +1181,58 @@ static void init_tnl_info(struct ip_tunnel_info *info, __u16 dst_port) info

Re: [PATCH net-next] geneve: add rtnl changelink support

2017-05-16 Thread Girish Moodalbail
On 5/16/17 12:31 PM, David Miller wrote: From: Girish Moodalbail Date: Mon, 15 May 2017 10:47:04 -0700 if (data[IFLA_GENEVE_REMOTE]) { - info.key.u.ipv4.dst = + info->key.u.ipv4.dst = nla_get_in_addr(data[IFLA_GENEVE_REM

[PATCH net-next] geneve: add rtnl changelink support

2017-05-15 Thread Girish Moodalbail
updates. - Allow changing only a few attributes: - return -EOPNOTSUPP for attributes that cannot be changed for now. Incremental patches can make the non-supported one available in the future if needed. Signed-off-by: Girish Moodalbail --- drivers/net/geneve.c | 149

Re: [PATCH iproute2 v2 1/1] vxlan: Add support for modifying vxlan device attributes

2017-05-10 Thread Girish Moodalbail
On 5/7/17 7:40 AM, Roman Mashak wrote: Girish Moodalbail writes: [...] ip/iplink_vxlan.c | 251 +++--- 1 file changed, 143 insertions(+), 108 deletions(-) diff --git a/ip/iplink_vxlan.c b/ip/iplink_vxlan.c index b4ebb13..2bd619d 100644 --- a

Re: [PATCH] drivers: net: wimax: i2400m: i2400m-usb: Use time_after for time comparison

2017-05-08 Thread Girish Moodalbail
On 5/8/17 2:26 PM, David Miller wrote: From: Karim Eshapa Date: Mon, 8 May 2017 18:58:02 +0200 diff --git a/drivers/net/wimax/i2400m/i2400m-usb.h b/drivers/net/wimax/i2400m/i2400m-usb.h index 649ecad..6fc941c 100644 --- a/drivers/net/wimax/i2400m/i2400m-usb.h +++ b/drivers/net/wimax/i2400m/i

[PATCH net-next] geneve: add rtnl changelink support

2017-05-08 Thread Girish Moodalbail
updates. - Allow changing only a few attributes: - return -EOPNOTSUPP for attributes that cannot be changed for now. Incremental patches can make the non-supported one available in the future if needed. Signed-off-by: Girish Moodalbail --- drivers/net/geneve.c | 149

[PATCH iproute2 v2 0/1] vxlan: support for modifying vxlan device

2017-05-06 Thread Girish Moodalbail
--- v1->v2 - refactored vxlan_parse_opt() to not to use a bunch of foo_set variables Girish Moodalbail (1): vxlan: Add support for modifying vxlan device attributes ip/iplink_vxlan.c | 251 +++--- 1 file changed, 143 insertions(+),

[PATCH iproute2 v2 1/1] vxlan: Add support for modifying vxlan device attributes

2017-05-06 Thread Girish Moodalbail
;. For the 'add' case, we pass down default values for those attributes that were not provided as CLI options. However, for the 'set' case we should be only passing down the explicitly provided attributes and not any other (default) attributes. Signed-off-by: Girish Moodalbail --- i

Re: [PATCH iproute2] vxlan: Add support for modifying vxlan device attributes

2017-05-04 Thread Girish Moodalbail
On 5/4/17 5:07 PM, Stephen Hemminger wrote: On Thu, 4 May 2017 14:46:34 -0700 Girish Moodalbail wrote: Ability to change vxlan device attributes was added to kernel through commit 8bcdc4f3a20b ("vxlan: add changelink support"), however one cannot do the same through ip(8) command.

[PATCH iproute2] vxlan: Add support for modifying vxlan device attributes

2017-05-04 Thread Girish Moodalbail
;. For the 'add' case, we pass down default values for those attributes that were not provided as CLI options. However, for the 'set' case we should be only passing down the explicitly provided attributes and not any other (default) attributes. Signed-off-by: Girish Moodalbail --- i

Re: struct ip vs struct iphdr

2017-05-04 Thread Girish Moodalbail
On 5/4/17 9:42 AM, Oleg wrote: Hi, all. It seems struct ip and struct iphdr are similar: struct ip, despite of it name, doesn't contain anything but ip header. So, my noob question, what is the difference between them? Also, see this: http://stackoverflow.com/questions/42840636/difference-

[PATCH net-next] geneve: fix incorrect setting of UDP checksum flag

2017-04-27 Thread Girish Moodalbail
200 remote 192.168.13.1 dstport 6081 noudpcsum Similarly, creating a link with 'noudpcsum' set results in a creation of link for which UDP checksum will be computed on outbound packets. Fixes: 9b4437a5b870 ("geneve: Unify LWT and netdev handling.") Signed-off-by: Girish Moodalb