Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closing the port at the wrong moment causes a kernel oops #4

Open
anszom opened this issue Jun 14, 2021 · 2 comments
Open

closing the port at the wrong moment causes a kernel oops #4

anszom opened this issue Jun 14, 2021 · 2 comments

Comments

@anszom
Copy link
Owner

anszom commented Jun 14, 2021

I don't recall the exact circumstances, this is just a note to myself to test and fix this one day

@joluxer
Copy link
Contributor

joluxer commented Mar 17, 2023

I can reproduce at least some kernel oops, so I plan to come up with some investigation and perhaps a solution. My starting point is your little test program, where the error is already reproducible.

I like your little driver, a neat piece of code. I want to use it as the kernel side base for some larger project, where I implement a RFC2217 client compatible virtual TTY provider.

@joluxer
Copy link
Contributor

joluxer commented Mar 18, 2023

After cranking up the debug output, so I could figure out, where my kernel OOPS came from.

i tested against 5.15.41-gentoo and used your little neat test program.

The problem I identified was a kind of race or actually the close order of master and slave side of a port.

A possible solution is in joluxer/vtty@f43c2f8

My way to go was serializing the destruction of the port data and delaying it, until both ends of the vtty are closed and the tty structures are cleaned up by the kernel. This required to keep the port data not zeroed, until the next time the port gets created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants