Opened 3 years ago

Closed 3 years ago

#20066 closed enhancement (fixed)

Make test-memwipe work better on OpenBSD

Reported by: rubiate Owned by:
Priority: Medium Milestone: Tor: 0.2.9.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: openbsd, review-group-8
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Where "work" means access freed buffers without exploding.

It currently segfaults 100% of the time but it could be "fixed" by setting the malloc.conf options in the program to turn off some of the protections.

's' will turn off malloc canaries (among other things). This stops it segfaulting. 'c' would do the same thing but would break on releases older than 5.9 which didn't have that option. 's' also means any new protections that are enabled by default will be turned off, which might help this keep working in the future.

Junking has two levels, so it needs 2x 'j' to guarantee it's turned off. This makes the warning about unreliable results go away.

Freelist and unmap protection aren't on by default but it will crash if it is, so a 'u' and 'f' will ensure it's off (it does nothing if it's already off).

Child Tickets

Attachments (1)

disableairbags.patch (918 bytes) - added by rubiate 3 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 3 years ago by nickm

Milestone: Tor: 0.2.9.x-final
Status: newneeds_review

Can't hurt, I guess. To be clear, have you tested this and confirmed it works for you? If so, it just needs a changes file.

comment:2 Changed 3 years ago by nickm

Keywords: review-group-8 added

Changed 3 years ago by rubiate

Attachment: disableairbags.patch added

comment:3 Changed 3 years ago by rubiate

Here's another patch with an attempt at a changes file.

Without this patch, reliably and repeatably:

$ src/test/test-memwipe
Segmentation fault (core dumped)

With:

$ src/test/test-memwipe
It appears that memset is good enough on this platform. Good.
OKAY: memwipe seems to work.

comment:4 Changed 3 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Applied as 08d1ac4f2ae81a79d19cbb830c3c88cb2998cb6e; thank you!

Note: See TracTickets for help on using tickets.