Coder Social home page Coder Social logo

Comments (4)

cezuni avatar cezuni commented on July 24, 2024

@tatokis : Your report may imply that removing urbr does not guarantee mutual exclusion and incur memory corruption. If list related fields of urbr are NULL, the memory has been already broken. So I greatly appreciate your patch but it seems to be not needed in normal case.

One of unpleasant things is fixed out queue length in userspace forward routine. 😢 Anyway, your application manage to work by increasing OUT_Q_LEN.
https://github.com/cezuni/usbip-win/blob/94b35a0916962874f062076176ec597a612aaa77/userspace/lib/usbip_forward.c#L251

from usbip-win.

tatokis avatar tatokis commented on July 24, 2024

I will definitely try that, thank you. That said, it still shouldn't trigger a bluescreen, and it doesn't seem to happen without that commit.

That aside, this sounds more like a "double free" issue (RemoveEntryList getting called twice on the same pointer), rather than memory corruption.
I believe if there was corruption, the fields wouldn't be null, but some random values, and there would also possibly be corruption that wouldn't let me view the struct fields inside WinDbg.

from usbip-win.

cezuni avatar cezuni commented on July 24, 2024

@tatokis : After inspecting a code, list_state NULL case was found. So list_state should be initialized when urbr is created. Could you try with the following diff?

diff --git a/driver/vhci/usbreq.c b/driver/vhci/usbreq.c
index db5bb0c..508f187 100644
--- a/driver/vhci/usbreq.c
+++ b/driver/vhci/usbreq.c
@@ -161,6 +161,7 @@ create_urbr(pusbip_vpdo_dev_t vpdo, PIRP irp, unsigned long seq_num_unlink)
        urbr->vpdo = vpdo;
        urbr->irp = irp;
        urbr->seq_num_unlink = seq_num_unlink;
+       InitializeListHead(&urbr->list_state);
        return urbr;
 }
 

from usbip-win.

tatokis avatar tatokis commented on July 24, 2024

That fixes the issue, and the system no longer crashes on unlink. Thank you :)

from usbip-win.

Related Issues (20)

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.