ipv4: fix NULL checking in devinet_ioctl()
Subsystems (3)
PATCH 1/1 ipv4: fix NULL checking in devinet_ioctl()
The NULL pointer check `!ifa' should come before its first use.
--- net/ipv4/devinet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/devinet.c +1 -1
@@ -823,9 +823,9 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg)if (!ifa) { ret = -ENOBUFS ; ifa =inet_alloc_ifa (); -INIT_HLIST_NODE (&ifa->hash);if (!ifa)break ; +INIT_HLIST_NODE (&ifa->hash);if (colon)memcpy (ifa->ifa_label, ifr.ifr_name,IFNAMSIZ );else
Signature · 1 line
1.7.10.4
Quoted 12 lines · Xi Wang
The NULL pointer check `!ifa' should come before its first use.
Signed-off-by Xi Wang <[email protected]>--- net/ipv4/devinet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/ipv4/devinet.c +0
-0
net/ipv4/devinet.c int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg) · line 831
Quoted 10 lines
net/ipv4/devinet.c +1
-1@@ -823,9 +823,9 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg)if (!ifa) { ret = -ENOBUFS ; ifa =inet_alloc_ifa (); -INIT_HLIST_NODE (&ifa->hash);if (!ifa)break ; +INIT_HLIST_NODE (&ifa->hash);if (colon)memcpy (ifa->ifa_label, ifr.ifr_name,IFNAMSIZ );else
Bug origin : commit fd23c3b31107e2fc483301ee923d8a1db14e53f4 (ipv4: Add hash table of interface addresses)
in linux-2.6.39
Thanks
David Miller
maintainerFrom: Eric Dumazet <[email protected]>
Date: Sat, 05 Jan 2013 15:10:02 -0800
Quoted 26 lines · Xi Wang
Quoted 12 lines
The NULL pointer check `!ifa' should come before its first use.
Signed-off-by Xi Wang <[email protected]>--- net/ipv4/devinet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/ipv4/devinet.c +0
-0net/ipv4/devinet.c int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg) · line 831
Quoted 10 lines
net/ipv4/devinet.c +1
-1@@ -823,9 +823,9 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg)if (!ifa) { ret = -ENOBUFS ; ifa =inet_alloc_ifa (); -INIT_HLIST_NODE (&ifa->hash);if (!ifa)break ; +INIT_HLIST_NODE (&ifa->hash);if (colon)memcpy (ifa->ifa_label, ifr.ifr_name,IFNAMSIZ );else Acked-by Eric Dumazet <[email protected]>
Quoted 4 lines
Bug origin : commit
fd23c3b31107e2fc483301ee923d8a1db14e53f4(ipv4: Add hash table of interface addresses)in linux-2.6.39
Applied and queued up for -stable, thanks.