lkml.org 
[lkml]   [2010]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[140/156] netlink: fix unaligned access in nla_get_be64()
    2.6.33-stable review patch.  If anyone has any objections, please let us know.

    ------------------

    From: Pablo Neira Ayuso <pablo@netfilter.org>

    [ Upstream commit f5d410f2ea7ba340f11815a56e05b9fa9421c421 ]

    This patch fixes a unaligned access in nla_get_be64() that was
    introduced by myself in a17c859849402315613a0015ac8fbf101acf0cc1.

    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    include/net/netlink.h | 6 +++++-
    1 file changed, 5 insertions(+), 1 deletion(-)

    --- a/include/net/netlink.h
    +++ b/include/net/netlink.h
    @@ -945,7 +945,11 @@ static inline u64 nla_get_u64(const stru
    */
    static inline __be64 nla_get_be64(const struct nlattr *nla)
    {
    - return *(__be64 *) nla_data(nla);
    + __be64 tmp;
    +
    + nla_memcpy(&tmp, nla, sizeof(tmp));
    +
    + return tmp;
    }

    /**



    \
     
     \ /
      Last update: 2010-03-31 01:29    [W:2.083 / U:0.048 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site