• E
    netfilter: xtables: fix reentrancy · db856674
    Eric Dumazet 提交于
    commit f3c5c1bf (make ip_tables reentrant) introduced a race in
    handling the stackptr restore, at the end of ipt_do_table()
    
    We should do it before the call to xt_info_rdunlock_bh(), or we allow
    cpu preemption and another cpu overwrites stackptr of original one.
    
    A second fix is to change the underflow test to check the origptr value
    instead of 0 to detect underflow, or else we allow a jump from different
    hooks.
    Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
    Cc: Jan Engelhardt <jengelh@medozas.de>
    Signed-off-by: NPatrick McHardy <kaber@trash.net>
    db856674
ip_tables.c 55.1 KB