diff mbox

Seeing new kernel unaligned access messages in linux-next on ia64

Message ID alpine.LSU.2.01.1003280107420.14977@obet.zrqbmnf.qr
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Jan Engelhardt March 28, 2010, 12:11 a.m. UTC
On Sunday 2010-03-28 00:37, David Miller wrote:
>
>> net: fix unaligned access in IFLA_STATS64
>
>Applied to net-next-2.6, thanks Jan.
>
>Hey, don't we need some adjustments to if_nlmsg_size()?  I don't see
>it accounting for IFLA_STATS64/"struct rtnl_link_stats64" there.

If I am not mistaken, the answer is "not strictly". But of course it's 
nicer if we don't need to realloc just because we were too conservative 
in the initial calculation.


git://dev.medozas.de/linux net

parent c5c57d7c7837858aa499610a3ee760b39f1de937 (v2.6.34-rc1-1276-gc5c57d7)
commit 305876b7c1c720db30239d08d56b3a058d56aa21
Author: Jan Engelhardt <jengelh@medozas.de>
Date:   Sun Mar 28 01:03:32 2010 +0100

net: increase preallocated size of nlmsg to accomodate for IFLA_STATS64

When more data is stuffed into an nlmsg than initially projected, an
extra allocation needs to be done. Reserve enough for IFLA_STATS64 so
that this does not to needlessy happen.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 net/core/rtnetlink.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

David Miller March 28, 2010, 12:17 a.m. UTC | #1
From: Jan Engelhardt <jengelh@medozas.de>
Date: Sun, 28 Mar 2010 01:11:13 +0100 (CET)

> On Sunday 2010-03-28 00:37, David Miller wrote:
>>
>>> net: fix unaligned access in IFLA_STATS64
>>
>>Applied to net-next-2.6, thanks Jan.
>>
>>Hey, don't we need some adjustments to if_nlmsg_size()?  I don't see
>>it accounting for IFLA_STATS64/"struct rtnl_link_stats64" there.
> 
> If I am not mistaken, the answer is "not strictly". But of course it's 
> nicer if we don't need to realloc just because we were too conservative 
> in the initial calculation.

Right.

> net: increase preallocated size of nlmsg to accomodate for IFLA_STATS64
> 
> When more data is stuffed into an nlmsg than initially projected, an
> extra allocation needs to be done. Reserve enough for IFLA_STATS64 so
> that this does not to needlessy happen.
> 
> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>

Applied, thanks a lot!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index ed0766f..bf919b6 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -653,6 +653,7 @@  static inline size_t if_nlmsg_size(const struct net_device *dev)
 	       + nla_total_size(IFNAMSIZ) /* IFLA_QDISC */
 	       + nla_total_size(sizeof(struct rtnl_link_ifmap))
 	       + nla_total_size(sizeof(struct rtnl_link_stats))
+	       + nla_total_size(sizeof(struct rtnl_link_stats64))
 	       + nla_total_size(MAX_ADDR_LEN) /* IFLA_ADDRESS */
 	       + nla_total_size(MAX_ADDR_LEN) /* IFLA_BROADCAST */
 	       + nla_total_size(4) /* IFLA_TXQLEN */