Coder Social home page Coder Social logo

miniasync's People

Contributors

blazej-smorawski avatar damianduy avatar kfilipek avatar kilobyte avatar kswiecicki avatar ldorau avatar lplewa avatar lukaszstolarczuk avatar pbalcer avatar szadam avatar tuliom avatar wlemkows avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

miniasync's Issues

Use-after-free when polling a future created in a different thread (with threads_mover)

Consider the following code:

vdm_memcpy_future f;

std::thread t1([&]{
    f = vdm_memcpy(...): // with threads_mover
});
t1.join();

std::thread t2([&]{
    auto f2 = vdm_memcpy(...); // with threads_mover
    while (future_poll(&f, NULL) != FUTURE_STATE_COMPLETE);
});
t2.join();

It will most likely segfault because of use-after free in membuf. Inside t1 data_mover_threads_data is allocated from membuf, in thread-local buffer. When t1 finishes, it will mark the buffer as unused.

Then, inside t2 that same thread-local buffer is reused by f2. future_poll(&f, NULL) will then enqueue data allocated by t1 to the ringbuff and the background thread will process that data (now, already overwritten) leading to a use-after-free.

This problem might also occur for data_mover_sync.c but I did not test that.

private symbols get leaked

The library exports all its non-static symbols, making ABI tracking ineffective, and risking conflicts with matching name in user projects.

Thus, please hide them, either by changing default visibility, or via a linker map.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.