diff options
author | Kees Cook <keescook@chromium.org> | 2021-06-02 23:27:41 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-04 00:15:10 +0300 |
commit | 9c153d3889767eb347a9b1719cc6f336faccdba9 (patch) | |
tree | 4e7f748d0dfcf0dde63765b6a3e4b38ef9d922a0 /net/8021q/vlan.c | |
parent | 5ff5622ea1f16d535f1be4e478e712ef48fe183b (diff) |
net: vlan: Avoid using strncpy()
Use strscpy_pad() instead of strncpy() which is considered deprecated:
https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlan.c')
-rw-r--r-- | net/8021q/vlan.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index fb3d3262dc1a..4cdf8416869d 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c @@ -638,7 +638,8 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg) case GET_VLAN_REALDEV_NAME_CMD: err = 0; - vlan_dev_get_realdev_name(dev, args.u.device2); + vlan_dev_get_realdev_name(dev, args.u.device2, + sizeof(args.u.device2)); if (copy_to_user(arg, &args, sizeof(struct vlan_ioctl_args))) err = -EFAULT; |