Opened 9 years ago

Closed 8 years ago

Last modified 7 years ago

#1345 closed defect (fixed)

Exits tracked with TrackHostExits should not reset on hup

Reported by: Sebastian Owned by:
Priority: High Milestone: Tor: 0.2.2.x-final
Component: Core Tor/Tor Version: 0.2.1.25
Severity: Keywords: tor-client
Cc: Sebastian, nickm Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description (last modified by nickm)

Using TrackHostExits with a long TrackHostExitsExpire should mean
Exits are only rotated if they go down. I don't see a reason why
we should forget the trackings we set up earlier when we got a hup
and the TrackingHostExits* options didn't change, especially because
some Tor packages like the debian package hup tor frequently.

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (15)

comment:1 Changed 9 years ago by nickm

Worth fixing if that's what people want, though I suspect there are others who definitely _do_ want their tracked exits reset on a HUP. Seems like a fine case for a boolean option.

comment:2 Changed 9 years ago by nickm

Description: modified (diff)
Keywords: easy added
Milestone: Tor: 0.2.3.x-final

This should be fairly easy for anybody who reads C and can track the control flow for the SIGNAL command from handle_control_signal() down through signal_callback() to do_hup().

comment:3 Changed 9 years ago by nickm

Whoops, I was thinking of a different bug. This one should be fairly easy too, modulo the flushing issues.

comment:4 Changed 9 years ago by nickm

ugh. No, I was thinking of this bug.

comment:5 Changed 8 years ago by arma

Priority: minormajor
Summary: Exits tracked with TrackHostExits reset on hupExits tracked with TrackHostExits should not reset on hup

Because debian's tor package hups tor daily, I think this one is important to resolve in the 0.2.3 timeframe: it can quite reasonably bite users in a way they'll find impossible to track down.

Speaking of which, is there a full list of things that Tor will flush/reset/etc on hup? The list has changed over the years, but if a user wants to predict whether this will happen, where would she look?

comment:6 Changed 8 years ago by nickm

The patch is easy enough to do. One thing to note, though: right now, addressmap_clear_transient() clears three things: DNS results, virtual address mappings, and trackexithost mappings. Do we want to clear all of these on HUP? Some? None?

comment:7 in reply to:  6 Changed 8 years ago by rransom

Replying to nickm:

The patch is easy enough to do. One thing to note, though: right now, addressmap_clear_transient() clears three things: DNS results, virtual address mappings, and trackexithost mappings. Do we want to clear all of these on HUP? Some? None?

We want to clear TrackHostExits mappings on SIGHUP iff they are for hosts not listed in TrackHostExits after the HUP. More generally, we want to clear a TrackHostExits mapping whenever TrackHostExits changes and the mapped host is not in the new TrackHostExits list.

We should clear virtual address mappings on SIGHUP iff AutomapHostsOnResolve is off after the HUP.

We shouldn't clear DNS results on SIGHUP.

comment:8 Changed 8 years ago by nickm

Milestone: Tor: 0.2.3.x-finalTor: 0.2.2.x-final

Tossing this into 0.2.2.x -- if debian is hupping hourly, we'll need to fix this one.

comment:9 Changed 8 years ago by nickm

err, daily. same point though.

comment:10 Changed 8 years ago by nickm

Keywords: easy removed

comment:11 Changed 8 years ago by nickm

Status: newneeds_review

See branch bug1345 in my public repository. It's more or less straightforward, but wasn't totally trivial.

comment:12 Changed 8 years ago by rransom

bug1345 looks good.

consider_recording_trackhost's documentation comment seems to be wrong, though. (But it's no more wrong than it was before.)

comment:13 Changed 8 years ago by nickm

Resolution: Nonefixed
Status: needs_reviewclosed

revised and merged.

comment:14 Changed 7 years ago by nickm

Keywords: tor-client added

comment:15 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.