From: Alexey Dobriyan <adobriyan@gmail.com>
To: Kees Cook <keescook@chromium.org>
Cc: Linux-MM <linux-mm@kvack.org>
Subject: Re: slab_ksize() and friends size_t -> unsigned int?
Date: Sat, 7 Apr 2018 13:23:00 +0300 [thread overview]
Message-ID: <20180407102300.GA2083@avx2> (raw)
In-Reply-To: <CAGXu5j+Ljf03iYAZY9A2YURJVB_0WvpyhDZHf1Sw_Fec-AfpOw@mail.gmail.com>
On Fri, Apr 06, 2018 at 10:06:31PM -0700, Kees Cook wrote:
> 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));
slab_ksize() can be changed.
As for ksize(). That path through page allocator is scary.
SLAB can be made unsigned int as well.
prev parent reply other threads:[~2018-04-07 10:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-07 5:06 slab_ksize() and friends size_t -> unsigned int? Kees Cook
2018-04-07 10:23 ` Alexey Dobriyan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180407102300.GA2083@avx2 \
--to=adobriyan@gmail.com \
--cc=keescook@chromium.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).