lkml.org 
[lkml]   [2017]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.12 78/99] netfilter: expect: fix crash when putting uninited expectation
    Date
    4.12-stable review patch.  If anyone has any objections, please let me know.

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

    From: Florian Westphal <fw@strlen.de>

    commit 36ac344e16e04e3e55e8fed7446095a6458c64e6 upstream.

    We crash in __nf_ct_expect_check, it calls nf_ct_remove_expect on the
    uninitialised expectation instead of existing one, so del_timer chokes
    on random memory address.

    Fixes: ec0e3f01114ad32711243 ("netfilter: nf_ct_expect: Add nf_ct_remove_expect()")
    Reported-by: Sergey Kvachonok <ravenexp@gmail.com>
    Tested-by: Sergey Kvachonok <ravenexp@gmail.com>
    Cc: Gao Feng <fgao@ikuai8.com>
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    net/netfilter/nf_conntrack_expect.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/net/netfilter/nf_conntrack_expect.c
    +++ b/net/netfilter/nf_conntrack_expect.c
    @@ -422,7 +422,7 @@ static inline int __nf_ct_expect_check(s
    h = nf_ct_expect_dst_hash(net, &expect->tuple);
    hlist_for_each_entry_safe(i, next, &nf_ct_expect_hash[h], hnode) {
    if (expect_matches(i, expect)) {
    - if (nf_ct_remove_expect(expect))
    + if (nf_ct_remove_expect(i))
    break;
    } else if (expect_clash(i, expect)) {
    ret = -EBUSY;

    \
     
     \ /
      Last update: 2017-08-28 11:02    [W:4.062 / U:0.044 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site