lkml.org 
[lkml]   [2022]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH net] tipc: Fix potential OOB in tipc_link_proto_rcv()
    Date
    Fix the potential risk of OOB if skb_linearize() fails in
    tipc_link_proto_rcv().

    Fixes: 5cbb28a4bf65 ("tipc: linearize arriving NAME_DISTR and LINK_PROTO buffers")
    Signed-off-by: YueHaibing <yuehaibing@huawei.com>
    ---
    net/tipc/link.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/net/tipc/link.c b/net/tipc/link.c
    index e260c0d557f5..b3ce24823f50 100644
    --- a/net/tipc/link.c
    +++ b/net/tipc/link.c
    @@ -2224,7 +2224,9 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb,
    if (tipc_own_addr(l->net) > msg_prevnode(hdr))
    l->net_plane = msg_net_plane(hdr);

    - skb_linearize(skb);
    + if (skb_linearize(skb))
    + goto exit;
    +
    hdr = buf_msg(skb);
    data = msg_data(hdr);

    --
    2.34.1
    \
     
     \ /
      Last update: 2022-12-03 10:47    [W:6.793 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site