Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 30 23:14
    Changochen opened #882
  • Nov 30 23:14
    Changochen opened #882
  • Oct 29 14:42
    rianquinn commented #881
  • Oct 29 14:42
    rianquinn commented #881
  • Oct 29 11:40
    krystian-hebel commented #881
  • Oct 29 11:40
    krystian-hebel commented #881
  • Oct 23 15:48
    rianquinn assigned #881
  • Oct 23 15:48
    rianquinn assigned #881
  • Oct 23 15:48
    rianquinn labeled #881
  • Oct 23 15:48
    rianquinn labeled #881
  • Oct 23 15:48
    rianquinn commented #881
  • Oct 23 15:48
    rianquinn commented #881
  • Oct 21 14:59
    krystian-hebel opened #881
  • Oct 21 14:59
    krystian-hebel opened #881
  • Oct 12 15:31
    manoharbrm closed #3
  • Oct 12 15:31
    manoharbrm closed #3
  • Oct 09 14:46
    rianquinn opened #880
  • Oct 09 14:46
    rianquinn opened #880
  • Oct 09 14:39
    rianquinn opened #879
  • Oct 09 14:39
    rianquinn opened #879
Rian Quinn
@rianquinn
Will do.
What do you guys think of this?
This is how I would like to document the APIs in the giant rework patch
This is not complete yet, but it should give everyone a sense for what I am trying to do
Its all done using Markdown
Uhg... Gitter will not let me share the markdown for this
Jared Wright
@JaredWright
@Randshot very nice suggestion on spdlog, that looks like a perfect way to implement log levels using fmt. I’d love to see that integrated into the bareflank eco-system
@rianquinn Huge fan of taking that approach to document public APIs, or general concepts surrouding the project
Where is the source markdown for the example you posted above?
Connor Davis
@connojd
@rianquinn the markdown looks good
Rian Quinn
@rianquinn
I haven’t pushed it yet
Will do tonight
Rian Quinn
@rianquinn
I uploaded all of the docs as I think they are mostly done: https://github.com/Bareflank/bsl
This is how I would like the hypervisor repo to look as well. Really simple readme with a link to nice docs that are easy to read.
Oh... and give this a look on your phone... its awesome
Connor Davis
@connojd
Overall looks great. I do have one request...Can we use 'BSL' instead of 'BAREFLANK' to prefix the macros? It will save me some typing
Rian Quinn
@rianquinn
absolutely
That is an easy one
Connor Davis
@connojd
Im also kind of leaning torwards 'bslexpects' rather than 'bfexpects' for consistency, but I don't hate bfexpects
Rian Quinn
@rianquinn
I agree, the consistency is better
Jared Wright
@JaredWright
I like Connor’s suggestoin for all of the repos actually. At this point “bf” and “Bareflank” doesn’t mean much in the context of one project, since Bareflank is an umbrella that consists of many different tools now.
Connor Davis
@connojd
Is there a slack url for bareflank? The slack link on the bsl readme takes to a sign in page asking for a workspace
Rian Quinn
@rianquinn
huh
there is... but I need to play with it more on how to actually set it up like Gitter
Gitter on mobile devices sucks at this point
Matt Dees
@matt-dees

Is anyone running the hypervisor from a Linux 64-bit host with >5.0 header files (Ubuntu 18.04)? I'm currently getting a general protection fault using the default config and build process steps. I've been prototyping with the hypervisor on a different system (Ubuntu 18.04) with 4.4 headers and it worked fine. The new system also has an Intel i9-9900k where as the old system had an i5-4690k, but I don't think that matters too much. Curious if anyone had any advice before I start digging in. The fault occurs in the bareflank kernel module when running bfm start after successfully loading the default VMM with bfm load <VMM>. I'm using the <make> driver_quick and <make> quick steps to launch these commands. Output from dmesg:

[ 154.170400] general protection fault: 0000 [#1] SMP NOPTI

Thanks for any help or advice!

Rian Quinn
@rianquinn
No... I have never seen that before
Can you try using the 4.4 headers on the 9900k?
We are using the 5.0 headers without any issue, so I am worried that it might be an issue with the 5.0 and 9900k together as I have never tried a system like that
I would have to get some hardware to test if that were the case
Matt Dees
@matt-dees

I dug a little into the issue to provide more information with what I know about the hypervisor start-up code. I added the following debug print because I suspected that's where the issue was:

@@ -520,5 +521,6 @@ common_call_vmm(                                                                 
     tc->cpuid = cpuid;     
     tc->tlsptr = (uint64_t *)((uint64_t)g_tls + (THREAD_LOCAL_STORAGE_SIZE * (uint64_t)cpuid));

+    BFALERT("common_call_vmm: before start func");
     return _start_func((void *)(g_stack_top - sizeof(tc_t) - 1), &g_info);
 }

And was presented with the following output from dmesg:

...
[  154.147349] [BAREFLANK ALERT]: common_call_vmm: before start func
[  154.147350] [BAREFLANK ALERT]: common_call_vmm: before start func            
[  154.147350] [BAREFLANK ALERT]: common_call_vmm: before start func            
[  154.147351] [BAREFLANK ALERT]: common_call_vmm: before start func            
[  154.147351] [BAREFLANK ALERT]: common_call_vmm: before start func
[  154.147352] [BAREFLANK ALERT]: common_call_vmm: before start func  
...

This goes on for quite a while (over a thousand calls) so it seems to me common_call_vmmcall is being called repeatedly in a loop that is not ending. So maybe something to do with the way the number of cores is retrieved? I will try with 4.4 headers on the i9-9900k. Thanks!

Rian Quinn
@rianquinn
Huh.... yeah... that seems like a kernel driver issue
Either that... or the VMM is not returning properly, and thus you are simply seeing the result of corruptiong
Might not be a bad idea to print out how many cores it thinks it has, and what core Id is bsing passed to see if it is actually in a long loop, or something far worse is going on
On a side note.... playing with something fun here:
    "operator="_test = [] {
        auto ifa1 = bsl::ifarray<char>("test.txt");
        expect(!!ifa1);

        auto ifa2 = bsl::ifarray<char>("test.txt");
        expect(!!ifa2);

        ifa1 = std::move(ifa2);
        expect(!!ifa1);
    };
Wrap you mind around that C++
Rian Quinn
@rianquinn
```c++
```c++
#include <bsl/contracts.h>

#include <memory>
#include <iostream>

auto
violation_handler(const bsl::violation_info &info) -> void
{
    std::string what;
    what += "contract violation detected\n";
    what += "  - type: " + std::string(info.comment) + '\n';
    what += "  - file: " + std::string(info.location.file()) + '\n';
    what += "  - line: " + std::to_string(info.location.line()) + '\n';

    throw std::runtime_error(what);
}

auto
foo(int val) -> auto
{
    bsl::expects(val == 42);

    auto ret = [] () -> auto {
        bsl::assert(42 != 23);
        return std::make_unique<int>(42);
    }();

    bsl::ensures_audit(!!ret);
    return ret;
}

auto
main() -> int
{
    bsl::set_violation_handler(violation_handler);

    auto val = foo(42);
    std::cout << "The answer is: " << *val << '\n';

    try {
        foo(0);
    }
    catch(const std::exception &e) {
        std::cerr << e.what();
    }
}

// The answer is: 42
// contract violation detected
//   - type: [[expects default]]
//   - file: ...
//   - line: 21
Rian Quinn
@rianquinn
@connojd The contract stuff updated so that it works with modules in the future. This is based on : http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0380r1.pdf
Max
@MaxTracks
If I wa
Wanted to view the rip op code that caused a VM exit, what would be the simplest way?
Rian Quinn
@rianquinn
It is in the state structure the vcpu has
So I think ->rip()
In master you might need to access the save_state to do that
Min-Yih Hsu
@mshockwave
Hi, I'm from SSLLab @ UC Irvine. I'm working on adding load-time randomization for VMM interfaces using MultiCompiler. The idea is to randomize the function signatures of VMM interfaces every time we load a binary.
I'm wondering what VMM interfaces should we target?
Rian Quinn
@rianquinn
By default BareFlank doesn’t have any interfaces. You could attempt to randomize the interfaces in Boxy, or create your own interfaces and the show that you can randomize them
Either way the interfaces to the VMM use the vmcall instruction