summaryrefslogtreecommitdiff
path: root/dissector_80211.c
blob: ecaf355138d881b8c58aeb9da26c7102cae9d26b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * netsniff-ng - the packet sniffing beast
 * Copyright 2009, 2010 Daniel Borkmann.
 * Subject to the GPL, version 2.
 */

#include <stdint.h>

#include "hash.h"
#include "protos.h"
#include "dissector.h"
#include "dissector_80211.h"
#include "lookup.h"

struct hash_table ieee80211_lay2;

static inline void dissector_init_entry(int type)
{
	dissector_set_print_type(&ieee80211_ops, type);
}

static inline void dissector_init_exit(int type)
{
	dissector_set_print_type(&none_ops, type);
}

static void dissector_init_layer_2(int type)
{
	init_hash(&ieee80211_lay2);
//	INSERT_HASH_PROTOS(blubber_ops, ieee80211_lay2);
	for_each_hash_int(&ieee80211_lay2, dissector_set_print_type, type);
}

void dissector_init_ieee80211(int fnttype)
{
	dissector_init_entry(fnttype);
	dissector_init_layer_2(fnttype);
	dissector_init_exit(fnttype);
	lookup_init(LT_OUI);
}

void dissector_cleanup_ieee80211(void)
{
	free_hash(&ieee80211_lay2);
	lookup_cleanup(LT_OUI);
}
>tree8e5526795b8650ce7cd5a9414717dc494e01f6a4 /Documentation/devicetree/bindings parent2c1f6951a8a82e6de0d82b1158b5e493fc6c54ab (diff)
[media] usbvision: revert commit 588afcc1
Commit 588afcc1c0e4 ("[media] usbvision fix overflow of interfaces array")' should be reverted, because: * "!dev->actconfig->interface[ifnum]" won't catch a case where the value is not NULL but some garbage. This way the system may crash later with GPF. * "(ifnum >= USB_MAXINTERFACES)" does not cover all the error conditions. "ifnum" should be compared to "dev->actconfig-> desc.bNumInterfaces", i.e. compared to the number of "struct usb_interface" kzalloc()-ed, not to USB_MAXINTERFACES. * There is a "struct usb_device" leak in this error path, as there is usb_get_dev(), but no usb_put_dev() on this path. * There is a bug of the same type several lines below with number of endpoints. The code is accessing hard-coded second endpoint ("interface->endpoint[1].desc") which may not exist. It would be great to handle this in the same patch too. * All the concerns above are resolved by already-accepted commit fa52bd50 ("[media] usbvision: fix crash on detecting device with invalid configuration") * Mailing list message: http://www.spinics.net/lists/linux-media/msg94832.html Signed-off-by: Vladis Dronov <vdronov@redhat.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: <stable@vger.kernel.org> # for v4.5 Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'Documentation/devicetree/bindings')