• 1 Post
  • 5 Comments
Joined 1 year ago
cake
Cake day: July 13th, 2023

help-circle

  • It has been quite a while since the last progress report. A ton of progress has been made since then, but I simply didn’t get around writing a new progress report. There have been 639 commits since the last progress report. This is significantly more than the last time given how long there has been since the last progress report.

    Is this rap?
    Some work needs to be done on the flow.
    Nice bars though.

    Release builds are slower but should still be faster than the LLVM backend.

    Had us in the second half.

    the resulting executables are about 20% faster and for simple-raytracer faster than LLVM in debug mode.

    Had us in the first half.

    core::simd is fully supported through emulation

    Had us in the first half again.

    There are still things to be done though. [link] lists things I know of that still need to be done.

    You see that “though”… you thinkin’… the rhythm… I’ve broken it!
    Accidentally repetitive?.. or maybe I’m just… unrollin’ it!

    You go be busy… with them sanitizers… and tracebacks
    I’ll just be here chilin’… and puttin’ Rust on them maps


    No but seriously, great work.

    And yes, I know that was lame/cringe.



  • Hello there. Now I feel uncomfortable. Who am I to talk in the presence of experts.

    To generate the LLVM code correctly you need to run build.rs if there is any

    Good point.

    and run proc macros which are natively compiled compiler plugins

    Hmm. When I read “Given the existence of macros”, I didn’t really think of compiler plugins. If that’s what was meant, then I apologize for what looks now like an ELI5 comment.

    The compilation process can be sandboxed as a whole, but if it runs arbitrary code, a malicious crate could take over the build process and falsify the LLVM output.

    Given that crater not only builds crates, but also runs tests, one would hope that such things wouldn’t sneak to painter unnoticed!


  • I’m afraid this question doesn’t make a lot of sense. You seem to be confused about the purpose of the painter tool, or how macros work, probably both.

    Neither is painter a sandbox tool, nor do macros have the ability to “run code”, arbitrary or otherwise, anywhere.

    painter is just a call graph analysis tool for the crates.io ecosystem. It does the analysis based on generated LLVM IR code (which is not “runnable” as is) from all versions of all crates.

    It’s security application is to reliably find what crate releases are vulnerable if a vulnerability is found in releases of crate Foo.

    Note that we already have cargo-audit and advisory-db. painter’s goal is to confirm via call graph analysis that “Yes, your crate is vulnerable. This part of your crate calls this vulnerable part of crate Foo”.

    No crate code is actually run by or in painter, except the code written to run the tool itself, of course ;)

    As for Rust macros, they get expanded in the parsing stage after lexing. You can see what’s literally expanded with cargo expand. Macros are long gone by the time you get to code generation.

    Incidentally, painter has this current limitation listed in the README:

    • LTO and optimizers are disabled to prevent inlining, but many cases exist in which the invocation is lost at a bytecode level. Source analysis can improve this. Examples of cases where an invoke is likely lost:
      • Dynamic function calls (pointers, vtables, etc.)
      • Inlining

    That’s real source/expanded code lost by the time we got to the generated IR code stage. For macros to “run arbitrary code” at that stage would be quite something ;)


  • Public Availability of “Painter” Tool

    We are proud to announce the first publicly-available tool in our Security Toolkit: Painter! Painter is an open source project that creates a complete call graph across the entire crates ecosystem to reveal how crates relate to each other. When a vulnerability exists in one crate, Painter allows users to more easily assess potential or active risks to other crates.

    The tool is aimed at addressing issues and determining risks when using other tools (such as Cargo Audit). This allows users to not only determine if a vulnerable dependency exists but if the attack path is realized. Painter was created by Rust Foundation Security Engineer Walter Pearce and released for public usage in July 2023.

    ^ This is new(ish) info.