This is an archive of the discontinued LLVM Phabricator instance.

[Sanitizers] Implement interceptors for msgsnd, msgrcv
ClosedPublic

Authored by guiand on Jun 30 2020, 11:25 AM.

Diff Detail

Event Timeline

guiand created this revision.Jun 30 2020, 11:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2020, 11:25 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
eugenis added inline comments.Jun 30 2020, 12:23 PM
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
3099

We don't use braces for single line blocks.

3100

I think this needs to be msgsz + sizeof(uptr)

3111

same here, "len" does not include the message type field at the start of *msgp.
Why does the test pass?

guiand added inline comments.Jun 30 2020, 1:03 PM
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
3111

Ah, the test passes because it makes the same assumption. Thanks for catching that!

guiand updated this revision to Diff 274596.Jun 30 2020, 1:09 PM

Addressed comments

guiand marked 4 inline comments as done.Jun 30 2020, 1:24 PM
eugenis accepted this revision.Jun 30 2020, 4:12 PM

LGTM

compiler-rt/test/sanitizer_common/TestCases/Linux/sysmsg.c
24

strictly speaking, there should be an EINTR-catching loop around both calls. It's pretty unlikely to happen in a test though...

This revision is now accepted and ready to land.Jun 30 2020, 4:12 PM
This revision was automatically updated to reflect the committed changes.

This is causing lint errors: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/32793

/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:3096:  Lines should be <= 80 characters long  [whitespace/line_length] [2]
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:3105:  Lines should be <= 80 characters long  [whitespace/line_length] [2]

@guiand Could you please fix?

Yes, sorry about that!

Should be taken care of now.