From: Thomas Graf <tgraf@suug.ch>
To: Ronen Arad <ronen.arad@intel.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] netlink: trim skb to exact size to avoid MSG_TRUNC
Date: Tue, 13 Oct 2015 10:56:00 +0200 [thread overview]
Message-ID: <20151013085600.GA23077@pox.localdomain> (raw)
In-Reply-To: <1444698923-13992-1-git-send-email-ronen.arad@intel.com>
On 10/12/15 at 06:15pm, Ronen Arad wrote:
> The available room in the skb allocated in netlink_dump for iproute2
> show requests (e.g. "ip link [show]", "bridge [-c] vlan show") should
> be trimmed to the exact size requested in order to avoid MSG_TRUNC flag
> set in netlink_recvmg.
> This was handled properly for small skb allocated when no interface has
> many VLANs configured. This patch applies the same logic to larger skbs
> which are allocated using the calculated min_dump_alloc size.
>
> Signed-off-by: Ronen Arad <ronen.arad@intel.com>
Wouldn't this imply a bug in which rtnl_calcit() does not account for
some data that is later dumped? How else could the skb end up being
larger than what alloc_size accounts for at this point unless we end
up stuffing 2x smallish messages into the padded projection of the
calculated maximum message size of that type. Is that what you are
seeing?
Regardless of that, alloc_size is likely larger than nlk->max_recvmsg_len
anyway at this point so unless the reader suddenly provides a different
message size or does peeking it will likely still be truncated.
I'm just trying to understand which exact case you are solving here.
next prev parent reply other threads:[~2015-10-13 8:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-13 1:15 [PATCH] netlink: trim skb to exact size to avoid MSG_TRUNC Ronen Arad
2015-10-13 8:56 ` Thomas Graf [this message]
2015-10-13 17:52 ` Arad, Ronen
2015-10-14 7:44 ` Thomas Graf
2015-10-15 6:41 ` Arad, Ronen
2015-10-15 8:55 ` [PATCH net-next v2] netlink: Trim skb to alloc " Ronen Arad
2015-10-19 2:33 ` David Miller
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=20151013085600.GA23077@pox.localdomain \
--to=tgraf@suug.ch \
--cc=netdev@vger.kernel.org \
--cc=ronen.arad@intel.com \
/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