Luiz Augusto von Dentz 13244cccc2 skbuff: introduce skb_pull_data
Like skb_pull but returns the original data pointer before pulling the
data after performing a check against sbk->len.

This allows to change code that does "struct foo *p = (void *)skb->data;"
which is hard to audit and error prone, to:

        p = skb_pull_data(skb, sizeof(*p));
        if (!p)
                return;

Which is both safer and cleaner.

Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-12-07 17:05:38 +01:00
..
2021-08-13 14:09:19 -07:00
2021-11-23 12:18:48 +00:00
2021-08-05 13:27:50 +01:00
2021-11-16 13:16:54 +00:00
2021-11-23 12:18:48 +00:00
2021-09-03 11:48:28 +01:00
2021-11-23 12:18:48 +00:00
2021-11-16 19:07:54 -08:00
2021-12-07 17:05:38 +01:00
2020-06-18 20:46:23 -07:00
2021-10-27 18:13:57 -07:00