lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 9 May 2022 09:49:30 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Ricardo Martinez <ricardo.martinez@...ux.intel.com>
Cc:     netdev@...r.kernel.org, linux-wireless@...r.kernel.org,
        davem@...emloft.net, johannes@...solutions.net,
        ryazanov.s.a@...il.com, loic.poulain@...aro.org,
        m.chetan.kumar@...el.com, chandrashekar.devegowda@...el.com,
        linuxwwan@...el.com, chiranjeevi.rapolu@...ux.intel.com,
        haijun.liu@...iatek.com, amir.hanania@...el.com,
        andriy.shevchenko@...ux.intel.com, dinesh.sharma@...el.com,
        eliot.lee@...el.com, ilpo.johannes.jarvinen@...el.com,
        moises.veleta@...el.com, pierre-louis.bossart@...el.com,
        muralidharan.sethuraman@...el.com, Soumya.Prakash.Mishra@...el.com,
        sreehari.kancharla@...el.com, madhusmita.sahu@...el.com
Subject: Re: [PATCH net-next v8 02/14] net: skb: introduce
 skb_data_area_size()

On Fri,  6 May 2022 11:12:58 -0700 Ricardo Martinez wrote:
> Helper to calculate the linear data space in the skb.
> 
> Signed-off-by: Ricardo Martinez <ricardo.martinez@...ux.intel.com>
> Reviewed-by: Sergey Ryazanov <ryazanov.s.a@...il.com>
> ---
>  include/linux/skbuff.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index 5c2599e3fe7d..d58669d6cb91 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -1665,6 +1665,11 @@ static inline void skb_set_end_offset(struct sk_buff *skb, unsigned int offset)
>  }
>  #endif
>  
> +static inline unsigned int skb_data_area_size(struct sk_buff *skb)
> +{
> +	return skb_end_pointer(skb) - skb->data;
> +}

Not a great name, skb->data_len is the length of paged data.
There is no such thing as "data area", data is just a pointer
somewhere into skb->head.

Why do you need this? Why can't you use the size you passed 
to the dev_alloc_skb() like everyone else?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ