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)
Dec 22 2023, 11:11 PM
Unknown Object (File)
Nov 23 2023, 2:26 PM
Unknown Object (File)
Jul 23 2023, 2:28 AM
Unknown Object (File)
Jun 17 2023, 11:03 AM
Unknown Object (File)
May 8 2023, 8:42 PM
Unknown Object (File)
May 8 2023, 8:22 PM
Unknown Object (File)
May 4 2023, 2:22 AM
Unknown Object (File)
Apr 25 2023, 6:56 PM
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.