storj/lib/uplinkc
Jeff Wendling e22c0bff94 lib/uplinkc: fix flaky download test (#2791)
The download driver code loops through the downloaded_data buffer
but doesn't ensure that it always passes a valid pointer to the
Go side. In particular, if the malloc'd memory ends against an
unmapped page, and the test passes a pointer one past the end
of the memory region, and since the Go side always dereferences
the pointer when creating a slice, it will attempt to read
unmapped memory, causing a segfault.

This bug doesn't always present. Indeed, it depends on the details
of your system's memory allocator. I validated that this could be
a cause of observed crashes on OS X by using mmap and mprotect
to do the allocations ensuring that the page directly after the
memory we use was unmapped/protected. The crash happened exactly
as seen, and was fixed by changing this condition in the while
loop.

Change-Id: I685dac07ff9b904097375dbf850f387450858753
2019-08-15 11:32:29 +03:00
..
testdata lib/uplinkc: fix flaky download test (#2791) 2019-08-15 11:32:29 +03:00
apikey.go Re-implement libstorj API (V2) using libuplink (V3) (#2573) 2019-07-30 13:40:05 +02:00
bucket.go Re-implement libstorj API (V2) using libuplink (V3) (#2573) 2019-07-30 13:40:05 +02:00
convert.go libuplink: Add size to ObjectInfo (#2714) 2019-08-06 11:36:35 +02:00
encryption_access.go Re-implement libstorj API (V2) using libuplink (V3) (#2573) 2019-07-30 13:40:05 +02:00
main.go Uplink C bindings part 1 (#2196) 2019-06-13 11:09:05 -04:00
object.go lib/uplink: remove Seek method (#2768) 2019-08-13 20:29:02 +03:00
project.go lib/uplink: ensure it's silent by default (#2676) 2019-08-01 07:14:09 -04:00
scope.go Uplink C bindings part 1 (#2196) 2019-06-13 11:09:05 -04:00
testdata_test.go Re-implement libstorj API (V2) using libuplink (V3) (#2573) 2019-07-30 13:40:05 +02:00
universe_test.go Uplink C bindings part 1 (#2196) 2019-06-13 11:09:05 -04:00
universe.go Uplink C bindings part 2 (#2209) 2019-06-15 13:23:12 +02:00
uplink_definitions.h libuplink: Add size to ObjectInfo (#2714) 2019-08-06 11:36:35 +02:00
uplink.go lib/uplink: ensure it's silent by default (#2676) 2019-08-01 07:14:09 -04:00