-
Notifications
You must be signed in to change notification settings - Fork 280
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
Fix SIGSEGV when cur_req is null pointer #45
Conversation
Can you show me how/where this can happen (i.e. where pc->cur_req can be NULL)? |
Note: theoretically this should never happen, but if it does, I would actually prefer that it generate a SIGSEGV. I need to see how it's possible, and then preferably fix it at its source instead of papering it over with a return TRUE, which is not what is expected from the call site in the gdb code if the read request fails. |
The problem happens when I was trying to do whatis(sym).ctype in epython for all kernel symbols. Program received signal SIGSEGV, Segmentation fault. |
My symbol address is like this: ffffffa9a7c80000 (T) _text, |
(gdb) info args |
(gdb) info registers |
crash64> p swiotlb |
crash64> dis swiotlb |
Sorry, I'm not familiar with mypkdump, but that command does end up using target_read_memory() in an unexpected way. But with your patch, you are returning TRUE without reading anything, so that makes little sense. |
At a minimum, if there is no pc->cur_req then memtype and the readflags would need to be initialized, and then a readmem() issued. Presumably KVADDR and RETURN_ON_ERROR would suffice? |
Try this: --- a/gdb_interface.c 2018-11-07 12:00:00.000000000 -0500
|
Well, that patch didn't display as I had entered it -- so guess I don't know how to properly show a patch in these comments, but you get the idea... |
No description provided.