lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 10 Sep 2017 13:21:26 +0200
From:   Florian Westphal <>
To:     Geert Uytterhoeven <>
Cc:     Florian Westphal <>,
        Pablo Neira Ayuso <>,
        Linux Kernel Mailing List <>,
        "" <>,
        "David S. Miller" <>,
        Arnd Bergmann <>
Subject: Re: Division by zero on UP (was: Re: netfilter: nat: use keyed locks)

Geert Uytterhoeven <> wrote:
> >                 srchash = hash_by_src(net,
> >                                       &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
> > -               spin_lock_bh(&nf_nat_lock);
> > +               lock = &nf_nat_locks[srchash % ARRAY_SIZE(nf_nat_locks)];
> > +               spin_lock_bh(lock);
> If no spinlock debugging options (CONFIG_GENERIC_LOCKBREAK,
> (e.g. m68k defconfig), arch_spinlock_t is an empty struct, and thus
> ARRAY_SIZE(nf_nat_locks)] is zero, leading to:
>     net/netfilter/nf_nat_core.c: In function ‘nf_nat_setup_info’:
>     net/netfilter/nf_nat_core.c:432: warning: division by zero

Gah. Sorry.  This is the 2nd time I add such a bug :(

Can you send a patch?  It should be enough to use CONNTRACK_LOCKS
instead of ARRAY_SIZE(nf_nat_locks) to avoid this problem.

Otherwise I will take care of this next thing monday morning.

Powered by blists - more mailing lists