Discussion:
Replace time_second with time_uptime in some places
(too old to reply)
Greg Troxel
2015-08-05 16:27:40 UTC
Permalink
Some codes in sys/net* use time_second to
manage time periods such as cache expirations.
However, time_second doesn't increase monotonically
and can leap by say settimeofday(2) according to
time_second(9). We should use time_uptime
instead of it to avoid such time leaps.
http://www.netbsd.org/~ozaki-r/use-time_uptime.diff
Generally this sounds sensible. One thing to consider is whether this
change results in leaking uptime to hosts over the network. (That could
be used to help identify roving hosts.)
Ryota Ozaki
2015-08-06 03:35:28 UTC
Permalink
Post by Greg Troxel
Some codes in sys/net* use time_second to
manage time periods such as cache expirations.
However, time_second doesn't increase monotonically
and can leap by say settimeofday(2) according to
time_second(9). We should use time_uptime
instead of it to avoid such time leaps.
http://www.netbsd.org/~ozaki-r/use-time_uptime.diff
Generally this sounds sensible. One thing to consider is whether this
change results in leaking uptime to hosts over the network. (That could
be used to help identify roving hosts.)
Right. A possible leakage is ia6t_expire, but a TTL is
calculated by ia6t_expire - time_uptime so time_uptime
itself isn't leaked.

Here is a list of variables to which time_uptime can
be assigned and how they are used:

- rmx_expire : exchanged with userland
- ia6t_expire : used to calculate TTL and
passed from userland
(but not used for now)
- ia6t_preferred : passed from userland
(but not used for now)
- ia6_updatetime : passed to userland
(via ia6t_expire and ia6t_preferred)
- ia6_createtime : internal use only
- ip6_log_time : internal use only
- ru_reseed : internal use only
- ln_expire : passed to userland
(should be passed from userland too
but not used for now. See PR/50127)
- ndpr_lastupdate : passed to userland
(via in6_prefix#expire)
- ndpr_preferred : internal use only
- ndpr_expire : internal use only

...so I found I forgot some conversions on passing/getting
values to/from userland. Fixed them.

http://www.netbsd.org/~ozaki-r/use-time_uptime.diff

Anyway we would need to add some tests for the IPv6
lifetime management.

Thanks,
ozaki-r

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...