Skip to content

Commit

Permalink
Bluetooth: Add BUILD_BUG_ON check for SKB control buffer size
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marcel Holtmann authored and Johan Hedberg committed Sep 15, 2014
1 parent 047b2ec commit 7cb9d20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/bluetooth/af_bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7cb9d20

Please sign in to comment.