Skip to content

Intercepting arguments with va_args will not pass in arguments correctly #1

@cjappl

Description

@cjappl

auto result = REAL(open)(path, oflag, args);

Hi @drowaudio!

Was just poking around your repo, and noticed a bug that I just fixed in RADSan also here, wanted to file an issue so you don't get weird reports later on.

The fix can be seen in this PR:
https://github.com/realtime-sanitizer/llvm-project/pull/23/files

You must unpack the va_arg first, then pass it in to the REAL call. The three in our code that had this problem were:

  1. open
  2. openat
  3. fcntl

but be wary of any of these syscalls that accept variable args.

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions