21 Jan, 2020

1 commit

  • The bitmap allocation did not use full unsigned long sizes
    when calculating the required size and that was triggered by KASAN
    as slab-out-of-bounds read in several places. The patch fixes all
    of them.

    Reported-by: syzbot+fabca5cbf5e54f3fe2de@syzkaller.appspotmail.com
    Reported-by: syzbot+827ced406c9a1d9570ed@syzkaller.appspotmail.com
    Reported-by: syzbot+190d63957b22ef673ea5@syzkaller.appspotmail.com
    Reported-by: syzbot+dfccdb2bdb4a12ad425e@syzkaller.appspotmail.com
    Reported-by: syzbot+df0d0f5895ef1f41a65b@syzkaller.appspotmail.com
    Reported-by: syzbot+b08bd19bb37513357fd4@syzkaller.appspotmail.com
    Reported-by: syzbot+53cdd0ec0bbabd53370a@syzkaller.appspotmail.com
    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Pablo Neira Ayuso

    Kadlecsik József
     

14 Jan, 2020

1 commit

  • map->members is freed by ip_set_free() right before using it in
    mtype_ext_cleanup() again. So we just have to move it down.

    Reported-by: syzbot+4c3cc6dbe7259dbf9054@syzkaller.appspotmail.com
    Fixes: 40cd63bf33b2 ("netfilter: ipset: Support extensions which need a per data destroy function")
    Acked-by: Jozsef Kadlecsik
    Signed-off-by: Cong Wang
    Signed-off-by: Pablo Neira Ayuso

    Cong Wang
     

08 Oct, 2019

1 commit

  • The inline function-specifier should not be used for static functions
    defined in .c files since it bloats the kernel. Instead leave the
    compiler to decide which functions to inline.

    While a couple of the files affected (ip_set_*_gen.h) are technically
    headers, they contain templates for generating the common parts of
    particular set-types and so we treat them like .c files.

    Signed-off-by: Jeremy Sowden
    Acked-by: Jozsef Kadlecsik
    Signed-off-by: Pablo Neira Ayuso

    Jeremy Sowden
     

25 Jun, 2019

1 commit


19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

10 Jun, 2019

1 commit

  • It's better to use my kadlec@netfilter.org email address in
    the source code. I might not be able to use
    kadlec@blackhole.kfki.hu in the future.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Jozsef Kadlecsik

    Jozsef Kadlecsik
     

28 Apr, 2019

1 commit


09 Jan, 2018

2 commits


18 Oct, 2017

1 commit

  • In preparation for unconditionally passing the struct timer_list pointer to
    all timer callbacks, switch to using the new timer_setup() and from_timer()
    to pass the timer pointer explicitly. This introduces a pointer back to the
    struct ip_set, which is used instead of the struct timer_list .data field.

    Cc: Pablo Neira Ayuso
    Cc: Jozsef Kadlecsik
    Cc: Florian Westphal
    Cc: "David S. Miller"
    Cc: Stephen Hemminger
    Cc: simran singhal
    Cc: Muhammad Falak R Wani
    Cc: netfilter-devel@vger.kernel.org
    Cc: coreteam@netfilter.org
    Cc: netdev@vger.kernel.org
    Signed-off-by: Kees Cook
    Signed-off-by: David S. Miller

    Kees Cook
     

07 Apr, 2017

1 commit

  • The following Coccinelle script was used to detect this:
    @r@
    expression x;
    void* e;
    type T;
    identifier f;
    @@
    (
    *((T *)e)
    |
    ((T *)x)[...]
    |
    ((T*)x)->f
    |

    - (T*)
    e
    )

    Unnecessary parantheses are also remove.

    Signed-off-by: simran singhal
    Reviewed-by: Stephen Hemminger
    Signed-off-by: Pablo Neira Ayuso

    simran singhal
     

10 Nov, 2016

4 commits


28 Mar, 2016

1 commit

  • This fix adds a new reference counter (ref_netlink) for the struct ip_set.
    The other reference counter (ref) can be swapped out by ip_set_swap and we
    need a separate counter to keep track of references for netlink events
    like dump. Using the same ref counter for dump causes a race condition
    which can be demonstrated by the following script:

    ipset create hash_ip1 hash:ip family inet hashsize 1024 maxelem 500000 \
    counters
    ipset create hash_ip2 hash:ip family inet hashsize 300000 maxelem 500000 \
    counters
    ipset create hash_ip3 hash:ip family inet hashsize 1024 maxelem 500000 \
    counters

    ipset save &

    ipset swap hash_ip3 hash_ip2
    ipset destroy hash_ip3 /* will crash the machine */

    Swap will exchange the values of ref so destroy will see ref = 0 instead of
    ref = 1. With this fix in place swap will not succeed because ipset save
    still has ref_netlink on the set (ip_set_swap doesn't swap ref_netlink).

    Both delete and swap will error out if ref_netlink != 0 on the set.

    Note: The changes to *_head functions is because previously we would
    increment ref whenever we called these functions, we don't do that
    anymore.

    Reviewed-by: Joshua Hunt
    Signed-off-by: Vishwanath Pai
    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Pablo Neira Ayuso

    Vishwanath Pai
     

07 Nov, 2015

1 commit

  • The data extensions in ipset lacked the proper memory alignment and
    thus could lead to kernel crash on several architectures. Therefore
    the structures have been reorganized and alignment attributes added
    where needed. The patch was tested on armv7h by Gerhard Wiesinger and
    on x86_64, sparc64 by Jozsef Kadlecsik.

    Reported-by: Gerhard Wiesinger
    Tested-by: Gerhard Wiesinger
    Tested-by: Jozsef Kadlecsik
    Signed-off-by: Jozsef Kadlecsik

    Jozsef Kadlecsik
     

14 Jun, 2015

2 commits


16 Sep, 2014

1 commit


22 Oct, 2013

1 commit


01 Oct, 2013

7 commits


30 Apr, 2013

2 commits