• Xin Long's avatar
    sctp: free cmd->obj.chunk for the unprocessed SCTP_CMD_REPLY · be7a7729
    Xin Long authored
    This patch is to fix a memleak caused by no place to free cmd->obj.chunk
    for the unprocessed SCTP_CMD_REPLY. This issue occurs when failing to
    process a cmd while there're still SCTP_CMD_REPLY cmds on the cmd seq
    with an allocated chunk in cmd->obj.chunk.
    
    So fix it by freeing cmd->obj.chunk for each SCTP_CMD_REPLY cmd left on
    the cmd seq when any cmd returns error. While at it, also remove 'nomem'
    label.
    
    Reported-by: syzbot+107c4aff5f392bf1517f@syzkaller.appspotmail.com
    Fixes: 1da177e4 ("Linux-2.6.12-rc2")
    Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    be7a7729
sm_sideeffect.c 50.3 KB