-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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 issue 2551 #3956
Fix issue 2551 #3956
Conversation
Fixing issue with Logitech webcams and NULL deref in kernel. raspberrypi#2551
Fix NULL deref in kernel with certain webcams. #issue 2551
if (!dev) | ||
return NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really no linux hacker, but wouldn't it make sense to move this check all the way up to the opening curly brace? Initializing the struct and integer is of no use, if the device is NULL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is fine. You need all declarations to precede code in the C standard kernel targets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to do that too but C best practices - declare variables first. Some compilers may have issue with the order.
Did you already take your proposal upstream? This is what you'll be asked. Once it is accepted upstream, the commit could be applied here. |
As @popcornmix says, the commit itself looks fine, although we'd rather not have merge requests in PRs. As also said, we'd prefer to see it go upstream first, but if you get no response there come back and give us a nudge. |
Hi yes I submitted upstream. Still waiting to hear back from the usb maintainers. Please hold on this for now. Hoping to get it upstream. |
Upstream PR is here: |
You do realise that all mainline patches go via the mailing lists, and not as PRs to Linus' repo. The patch subject line should also start with the subsystem that it applies to, ie "usb: core:" in this case. https://www.kernel.org/doc/html/latest/process/submitting-patches.html |
Yes sorry I'll let the mailing list deal with it. At least they can see the code changes necessary and the explanation. |
Kernel null dereference occasionally (race condition) when using certain webcams. Need to check before deref. Affects mainline Linux kernel too.