From 5a69f596027ff45d9daf7c6584a8a9d4f7ea0770 Mon Sep 17 00:00:00 2001 From: Pavel Kubelun Date: Mon, 28 Nov 2016 18:10:05 +0300 Subject: net: ar8216: address security vulnerabilities in swconfig & ar8216 Imported from https://chromium.googlesource.com/chromiumos/third_party/kernel/+/e1aaf7ec008a97311867f0a7d0418e4693fecfd4%5E%21/#F0 Signed-off-by: Pavel Kubelun CHROMIUM: net: ar8216: address security vulnerabilities in swconfig & ar8216 This patch does the following changes: *address the security vulnerabilities in both swconfig framework and in ar8216 driver (many bound check additions, and turned swconfig structure signed element into unsigned when applicable) *address a couple of whitespaces and indendation issues BUG=chrome-os-partner:33096 TEST=none Change-Id: I94ea78fcce8c1932cc584d1508c6e3b5dfb93ce9 Signed-off-by: Mathieu Olivari Reviewed-on: https://chromium-review.googlesource.com/236490 Reviewed-by: Toshi Kikuchi Commit-Queue: Toshi Kikuchi Tested-by: Toshi Kikuchi --- target/linux/generic/files/include/linux/switch.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'target/linux/generic/files/include') diff --git a/target/linux/generic/files/include/linux/switch.h b/target/linux/generic/files/include/linux/switch.h index dda4820a7a..f8380b98c5 100644 --- a/target/linux/generic/files/include/linux/switch.h +++ b/target/linux/generic/files/include/linux/switch.h @@ -115,12 +115,12 @@ struct switch_dev { const char *alias; struct net_device *netdev; - int ports; - int vlans; - int cpu_port; + unsigned int ports; + unsigned int vlans; + unsigned int cpu_port; /* the following fields are internal for swconfig */ - int id; + unsigned int id; struct list_head dev_list; unsigned long def_global, def_port, def_vlan; @@ -148,8 +148,8 @@ struct switch_portmap { struct switch_val { const struct switch_attr *attr; - int port_vlan; - int len; + unsigned int port_vlan; + unsigned int len; union { const char *s; u32 i; -- cgit v1.2.3