Selaa lähdekoodia

Bluetooth: Add BUILD_BUG_ON check for SKB control buffer size

The struct bt_skb_cb size needs to stay within the limits of skb->cb
at all times and to ensure that add a BUILD_BUG_ON to check for it at
compile time.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Marcel Holtmann 11 vuotta sitten
vanhempi
commit
7cb9d20fd9
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      net/bluetooth/af_bluetooth.c

+ 3 - 0
net/bluetooth/af_bluetooth.c

@@ -709,8 +709,11 @@ EXPORT_SYMBOL_GPL(bt_debugfs);
 
 static int __init bt_init(void)
 {
+	struct sk_buff *skb;
 	int err;
 
+	BUILD_BUG_ON(sizeof(struct bt_skb_cb) > sizeof(skb->cb));
+
 	BT_INFO("Core ver %s", VERSION);
 
 	bt_debugfs = debugfs_create_dir("bluetooth", NULL);