Page MenuHomeFreeBSD

libsysdecode: decode PROT_MAX allocations
ClosedPublic

Authored by kaktus on Sep 18 2019, 7:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 12:24 AM
Unknown Object (File)
Fri, Dec 6, 8:23 PM
Unknown Object (File)
Nov 20 2024, 11:14 AM
Unknown Object (File)
Oct 29 2024, 10:28 AM
Unknown Object (File)
Oct 3 2024, 2:55 PM
Unknown Object (File)
Sep 29 2024, 11:26 PM
Unknown Object (File)
Sep 25 2024, 4:42 AM
Unknown Object (File)
Sep 21 2024, 5:28 AM
Subscribers

Details

Summary

libsysdecode: decode PROT_MAX flags

Extend libsysdecode to pretty-print PROT_MAX flags and fix decoding of regular protection flags broken since r349240.

before:
truss:
mmap(0x0,40960,0x30000,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34366234624 (0x800632000)
kdump:
11439 protmax CALL mmap(0,0xa000,0x30000<><invalid>196608,0x21002<MAP_PRIVATE|MAP_ANON|MAP_NOCORE>,0xffffffff,0)

after:
truss:
mmap(0x0,40960,PROT_MAX(PROT_READ|PROT_WRITE)|PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34366234624 (0x800632000)
kdump:
11439 protmax CALL mmap(0,0xa000,0x30000<PROT_MAX(PROT_READ|PROT_WRITE)|PROT_READ|PROT_WRITE>,0x21002<MAP_PRIVATE|MAP_ANON|MAP_NOCORE>,0xffffffff,0)

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

lib/libsysdecode/flags.c
668

Why don't you print non-max protection bits ?

kaktus edited the summary of this revision. (Show Details)

don't return too early

lib/libsysdecode/flags.c
669

Maybe I should strip the whole early return as both truss and dump ignore the return value anyway?

lib/libsysdecode/flags.c
669

I do not think that you should return early at all if first print_mask_int() returned false. Instead the final return value should be false, thats all.

No, I do not think that changing the signature of the public function in libsysdecode is good idea. Because you would need to bump the lib version number due to the ABI changes, which seems to be more noise that to just satisfy the interface.

This revision is now accepted and ready to land.Sep 19 2019, 1:05 PM
kaktus retitled this revision from truss and ktrace should decode PROT_MAX allocations to libsysdecode: decode PROT_MAX allocations.Sep 26 2019, 8:33 PM
kaktus edited the summary of this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.