Opened 4 weeks ago

Closed 3 weeks ago

#31793 closed defect (fixed)

Bug: tor_addr_is_internal() called from src/feature/dirauth/process_descs.c:447 with a non-IP address of type 0

Reported by: arma Owned by: teor
Priority: Very High Milestone: Tor: 0.4.2.x-final
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Normal Keywords: master-regression ipv6 042-must BugSmashFund asn-merge
Cc: teor, neel Actual Points: 0.4
Parent ID: Points: 0.5
Reviewer: nickm Sponsor:

Description

Starting tor from git master on moria1, I get tens of thousands of these:

Sep 18 16:32:03.546 [warn] tor_addr_is_internal_(): Bug: tor_addr_is_internal() called from src/feature/dirauth/process_descs.c:447 with a non-IP address of type 0 (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] tor_bug_occurred_(): Bug: src/lib/net/address.c:318: tor_addr_is_internal_: This line should not have been reached. (Future instances of this warning will be silenced.) (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug: Tor 0.4.2.1-alpha-dev (git-d6d3e829dd20b78e): Line unexpectedly reached at tor_addr_is_internal_ at src/lib/net/address.c:318. Stack trace: (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     ../git/src/app/tor(log_backtrace_impl+0x47) [0x55b51002c057] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     ../git/src/app/tor(tor_bug_occurred_+0x19b) [0x55b5100270eb] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     ../git/src/app/tor(tor_addr_is_internal_+0xbf) [0x55b51001c47f] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     ../git/src/app/tor(authdir_wants_to_reject_router+0x159) [0x55b50ff8a609] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     ../git/src/app/tor(router_add_to_routerlist+0x50e) [0x55b50ff4a32e] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     ../git/src/app/tor(dirserv_add_descriptor+0x239) [0x55b50ff89709] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     ../git/src/app/tor(init_keys+0x446) [0x55b50ff5de66] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     ../git/src/app/tor(set_options+0x755) [0x55b50ff9aae5] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     ../git/src/app/tor(options_init_from_string+0x35a) [0x55b50ffa01ea] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     ../git/src/app/tor(options_init_from_torrc+0x5e8) [0x55b50ffa0858] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     ../git/src/app/tor(tor_init+0x309) [0x55b50fe6cf99] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     ../git/src/app/tor(tor_run_main+0xa9) [0x55b50fe6d739] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     ../git/src/app/tor(tor_main+0x43) [0x55b50fe6a9c3] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     ../git/src/app/tor(main+0x19) [0x55b50fe6a649] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     /lib64/libc.so.6(__libc_start_main+0x100) [0x7fec1801dd20] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)
Sep 18 16:32:03.546 [warn] Bug:     ../git/src/app/tor(+0x5f559) [0x55b50fe6a559] (on Tor 0.4.2.1-alpha-dev d6d3e829dd20b78e)

Child Tickets

Change History (13)

comment:1 Changed 4 weeks ago by nickm

Cc: teor neel added
Keywords: 042-regression ipv6? 042-must added
Priority: MediumHigh

I think this could be related to #31088.

comment:2 Changed 4 weeks ago by teor

Yes, the address null and internal checks are in the wrong order:
https://github.com/torproject/tor/pull/1267/files#diff-c535b81e06d7fed27d5d3cdaabf1c4b8R439
https://github.com/torproject/tor/pull/1267/files#diff-c535b81e06d7fed27d5d3cdaabf1c4b8R447

We also need to:

  • add a test that fails because of this bug
  • work out why chutney didn't fail when the authorities logged all these bugs

comment:3 Changed 4 weeks ago by teor

I have a fix for this issue, but I need to extract it out of a broken VM.

comment:4 Changed 4 weeks ago by teor

Actual Points: 0.3
Keywords: master-regression ipv6 043-must added; 042-regression ipv6? 042-must removed
Milestone: Tor: 0.4.2.x-finalTor: 0.4.3.x-final
Owner: set to teor
Points: 0.5
Status: newassigned
Version: Tor: unspecified

comment:5 Changed 4 weeks ago by teor

Actual Points: 0.30.4
Status: assignedneeds_review

See my PR:

I added some (failing) tests, fixed the bug and the tests, and then added even more test coverage.

comment:6 Changed 4 weeks ago by nickm

Milestone: Tor: 0.4.3.x-finalTor: 0.4.2.x-final

I don't think you meant to put this in 0.4.3?

comment:7 Changed 4 weeks ago by teor

Keywords: BugSmashFund added

comment:8 Changed 4 weeks ago by asn

Reviewer: nickm

comment:9 Changed 4 weeks ago by nickm

Keywords: 042-must asn-merge added; 043-must removed
Status: needs_reviewmerge_ready

This looks correct to me, and the tests look like they should test the desired behavior.

Coveralls reports that we have lost all coverage: I'm guessing that's coverall's problem, though, not ours: I think it's okay to merge this.

comment:10 Changed 4 weeks ago by teor

I restarted the coverage job, hopefully we get a better result from coveralls this time around.

comment:11 Changed 4 weeks ago by nickm

Priority: HighVery High

comment:12 Changed 3 weeks ago by teor

Coverage is now at 100%, I'll open a separate ticket for some coverage flapping.

comment:13 Changed 3 weeks ago by asn

Resolution: fixed
Status: merge_readyclosed

Merged!

There was no changes file but I guess this hasn't been released according to the OP.

Note: See TracTickets for help on using tickets.