Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: neighbor: fix a crash caused by mod zero
pneigh_enqueue() tries to obtain a random delay by mod NEIGH_VAR(p, PROXY_DELAY). However, NEIGH_VAR(p, PROXY_DELAY) migth be zero at that point because someone could write zero to /proc/sys/net/ipv4/neigh/[device]/proxy_delay after the callers check it. This patch uses prandom_u32_max() to get a random delay instead which avoids potential division by zero. Signed-off-by: weichenchen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
- Loading branch information