Opened 6 weeks ago

Last modified 4 weeks ago

#31609 new defect

Make CIRCUIT_IS_ORIGIN() look at the base magic number

Reported by: dgoulet Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-circuit, 042-deferred-20190918
Cc: Actual Points:
Parent ID: Points: 0.1
Reviewer: Sponsor:

Description

Currently, CIRCUIT_IS_ORIGIN() actually looks at the purpose, not the base magic number:

#define CIRCUIT_IS_ORIGIN(c) (CIRCUIT_PURPOSE_IS_ORIGIN((c)->purpose))

We should move it to look at the magic like CIRCUIT_IS_ORCIRC() is doing.

The reason is because I was adding tracing events to the circuit subsystem and I kept having state transition event with a circuit global identifier of 0 which can't be because that value is set just after allocation.

But at that point, the purpose has not been set so CIRCUIT_IS_ORIGIN() wasn't returning true.

Furthermore, this made me discover another issue documented in #31608 where if we do make this change, we _must_ fix this ticket else we have a NULL deref.

Child Tickets

TicketStatusOwnerSummaryComponent
#31608newcircuit_state_publish() never triggers when a new origin circuit is createdCore Tor/Tor

Change History (1)

comment:1 Changed 4 weeks ago by nickm

Keywords: 042-deferred-20190918 added
Milestone: Tor: 0.4.2.x-finalTor: unspecified

Deferring various tickets from 0.4.2 to Unspecified.

Note: See TracTickets for help on using tickets.