[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7f9bf5711001270435v29217b9cw15a49a1d71580cc5@mail.gmail.com>
Date: Wed, 27 Jan 2010 14:35:10 +0200
From: Atis Elsts <atis.elsts@...il.com>
To: Jarek Poplawski <jarkao2@...il.com>
Cc: David Miller <davem@...emloft.net>, shemminger@...tta.com,
djohnson@...rentnetworks.com, sakkiped@...rentnetworks.com,
netdev@...r.kernel.org
Subject: Re: [PATCH] ipv6: Fix possible NULL dereference in icmp6_dst_alloc
> On Wed, Jan 27, 2010 at 03:04:16AM -0800, David Miller wrote:
>> From: Jarek Poplawski <jarkao2@...il.com>
>> Date: Wed, 27 Jan 2010 10:34:17 +0000
>>
>> > (Btw, maybe it's a sign this might be more readable?)
>>
>> I welcome suggests that, tree wide, would make this harder
>> to misinterpret.
How about adding static inline functions for accessing the dst_entry
field in struct route via a cast? That way it would be immediately
obvious that invalid memory access is not going to happen. Like this:
static inline struct dst_entry *route_dst(struct rtable *rt)
{
return (struct dst_entry *)rt;
}
static inline struct dst_entry *route6_dst(struct rt6_info *rt)
{
return (struct dst_entry *)rt;
}
and so on...
Atis
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists