linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* slab_ksize() and friends size_t -> unsigned int?
@ 2018-04-07  5:06 Kees Cook
  2018-04-07 10:23 ` Alexey Dobriyan
  0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2018-04-07  5:06 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: Linux-MM

Hi,

I saw all the other int and size_t conversions to unsigned int. What
about ksize(), slab_ksize() and related functions too? It looks like
many callers are already expecting unsigned int anyway...

net/core/skbuff.c:      unsigned int size = frag_size ? : ksize(data);

Though some are "int", ew:

int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
                     gfp_t gfp_mask)
{
        int i, osize = skb_end_offset(skb);
        int size = osize + nhead + ntail;
...
        size = SKB_WITH_OVERHEAD(ksize(data));



-Kees

-- 
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-07 10:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-07  5:06 slab_ksize() and friends size_t -> unsigned int? Kees Cook
2018-04-07 10:23 ` Alexey Dobriyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).