lkml.org 
[lkml]   [2014]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.16 300/357] IB/core: When marshaling uverbs path, clear unused fields
    Date
    3.16-stable review patch.  If anyone has any objections, please let me know.

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

    From: Matan Barak <matanb@mellanox.com>

    commit a59c5850f09b4c2d6ad2fc47e5e1be8d654529d6 upstream.

    When marsheling a user path to the kernel struct ib_sa_path, need
    to zero smac, dmac and set the vlan id to the "no vlan" value.

    Fixes: dd5f03beb4f7 ("IB/core: Ethernet L2 attributes in verbs/cm structures")
    Reported-by: Aleksey Senin <alekseys@mellanox.com>
    Signed-off-by: Matan Barak <matanb@mellanox.com>
    Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/infiniband/core/uverbs_marshall.c | 4 ++++
    1 file changed, 4 insertions(+)

    --- a/drivers/infiniband/core/uverbs_marshall.c
    +++ b/drivers/infiniband/core/uverbs_marshall.c
    @@ -140,5 +140,9 @@ void ib_copy_path_rec_from_user(struct i
    dst->packet_life_time = src->packet_life_time;
    dst->preference = src->preference;
    dst->packet_life_time_selector = src->packet_life_time_selector;
    +
    + memset(dst->smac, 0, sizeof(dst->smac));
    + memset(dst->dmac, 0, sizeof(dst->dmac));
    + dst->vlan_id = 0xffff;
    }
    EXPORT_SYMBOL(ib_copy_path_rec_from_user);



    \
     
     \ /
      Last update: 2014-10-04 02:21    [W:3.991 / U:0.436 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site