netdevice: Fix wrong string handle in kernel command line parsing
authorWang Chen <wangchen@cn.fujitsu.com>
Wed, 2 Jul 2008 02:57:19 +0000 (19:57 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Jul 2008 02:57:19 +0000 (19:57 -0700)
commit93b3cff9915322d6fa36bac0064714a7076230e4
treef17f0fd69b2c5c930b29f5e40b214d6a458cbbfc
parent8fde8a076940969d32805b853efdce8b988d7dda
netdevice: Fix wrong string handle in kernel command line parsing

v1->v2: Use strlcpy() to ensure s[i].name be null-termination.

1. In netdev_boot_setup_add(), a long name will leak.
   ex. : dev=21,0x1234,0x1234,0x2345,eth123456789verylongname.........
2. In netdev_boot_setup_check(), mismatch will happen if s[i].name
   is a substring of dev->name.
   ex. : dev=...eth1 dev=...eth11

[ With feedback from Ben Hutchings. ]

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c