#ifndef __NET_GENEVE_H #define __NET_GENEVE_H 1 #include /* Geneve Header: * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |Ver| Opt Len |O|C| Rsvd. | Protocol Type | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Virtual Network Identifier (VNI) | Reserved | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Variable Length Options | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * Option Header: * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Option Class | Type |R|R|R| Length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Variable Option Data | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct geneve_opt { __be16 opt_class; u8 type; #ifdef __LITTLE_ENDIAN_BITFIELD u8 length:5; u8 r3:1; u8 r2:1; u8 r1:1; #else u8 r1:1; u8 r2:1; u8 r3:1; u8 length:5; #endif u8 opt_data[]; }; #define GENEVE_CRIT_OPT_TYPE (1 << 7) struct genevehdr { #ifdef __LITTLE_ENDIAN_BITFIELD u8 opt_len:6; u8 ver:2; u8 rsvd1:6; u8 critical:1; u8 oam:1; #else u8 ver:2; u8 opt_len:6; u8 oam:1; u8 critical:1; u8 rsvd1:6; #endif __be16 proto_type; u8 vni[3]; u8 rsvd2; struct geneve_opt options[]; }; #ifdef CONFIG_INET struct net_device *geneve_dev_create_fb(struct net *net, const char *name, u8 name_assign_type, u16 dst_port); #endif /*ifdef CONFIG_INET */ #endif /*ifdef__NET_GENEVE_H */ =83e526f2a2fa4b2e82b6bd3ddbb26b70acfa8947'>refslogtreecommitdiff
path: root/drivers/usb/serial/wishbone-serial.c
diff options
context:
space:
mode:
authorVincent Pelletier <plr.vincent@gmail.com>2017-01-18 00:57:44 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-25 12:03:52 +0100
commit83e526f2a2fa4b2e82b6bd3ddbb26b70acfa8947 (patch)
tree3067a6dfefc8299039bc89f9eca8dc36a77e1ab4 /drivers/usb/serial/wishbone-serial.c
parentd9b2997e4a0a874e452df7cdd7de5a54502bd0aa (diff)
usb: gadget: f_fs: Assorted buffer overflow checks.
OS descriptor head, when flagged as provided, is accessed without checking if it fits in provided buffer. Verify length before access. Also, there are other places where buffer length it checked after accessing offsets which are potentially past the end. Check buffer length before as well to fail cleanly. Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/wishbone-serial.c')