Bluetooth: Add BUILD_BUG_ON check for SKB control buffer size
Subsystems (2)
Marcel Holtmann
maintainerPATCH 1/1 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 <[email protected]>
--- net/bluetooth/af_bluetooth.c | 3 +++ 1 file changed, 3 insertions(+)
net/bluetooth/af_bluetooth.c +3 -0
@@ -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 );
Signature · 1 line
1.9.3
Johan Hedberg
AppliedHi Marcel,
Quoted 8 lines · Marcel Holtmann
The struct
bt_skb_cbsize needs to stay within the limits ofskb->cbat all times and to ensure that add aBUILD_BUG_ONto check for it at compile time.Signed-off-by Marcel Holtmann <[email protected]>--- net/bluetooth/af_bluetooth.c | 3 +++ 1 file changed, 3 insertions(+)
Applied to bluetooth-next. Thanks.
Johan