lists.openwall.net   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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 13 Jan 2015 22:04:38 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	jeff@...ix.org
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH] neighbour: fix base_reachable_time(_ms) not effective
 immediatly when changed

From: Jean-Francois Remy <jeff@...ix.org>
Date: Tue, 13 Jan 2015 08:51:19 +0100

> When setting base_reachable_time or base_reachable_time_ms through
> sysctl or netlink, the reachable_time value is not updated.
> This means that neighbour entries will continue to be updated using the
> old value until it is recomputed in neigh_period_work (which
>     recomputes the value every 300*HZ).
> On systems with HZ equal to 1000 for instance, it means 5mins before
> the change is effective.
> 
> This patch changes this behavior by recomputing reachable_time after
> each set on base_reachable_time or base_reachable_time_ms.
> The new value will become effective the next time the neighbour's timer
> is triggered.
> 
> Changes are made in two places: the netlink code for set and the sysctl
> handling code. For sysctl, I use a proc_handler. The ipv6 network
> code does provide its own handler but it already refreshes
> reachable_time correctly so it's not an issue.
> Any other user of neighbour which provide its own handlers must
> refresh reachable_time.
> 
> Signed-off-by: Jean-Francois Remy <jeff@...ix.org>

Your change is correct but there are some coding style issues to
deal with:

> +				/*
> +				 * update reachable_time as well, otherwise, the change will
> +				 * only be effective after the next time neigh_periodic_work
> +				 * decides to recompute it (can be multiple minutes)
> +				 */

Comments in the networking should be:

	/* Of this
	 * form.
	 */


> +	if (write && ret == 0 ) {

No space between '0' and the closing parenthesis please.

> +		/*
> +		 * update reachable_time as well, otherwise, the change will
> +		 * only be effective after the next time neigh_periodic_work
> +		 * decides to recompute it
> +		 */

Please fix this comment's layout as per above.

> +		/*
> +		 * Those handlers will update p->reachable_time after
> +		 * base_reachable_time(_ms) is set to ensure the new timer starts being
> +		 * applied after the next neighbour update instead of waiting for
> +		 * neigh_periodic_work to update its value (can be multiple minutes)
> +		 * So any handler that replaces them should do this as well
> +		 */

Likewise.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ