Summary: | lib/libc/net/rcmd.c: add another length check to the iruserok_sa | ||
---|---|---|---|
Product: | Base System | Reporter: | Andrew Reiter <areiter> |
Component: | misc | Assignee: | Mark Johnston <markj> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | arr, markj |
Priority: | --- | ||
Version: | CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
Andrew Reiter
2020-01-31 02:17:53 UTC
Also, I did not mention that I was uncertain if this behavior was to conform to some specification which should allow this ticket to be closed. Seems reasonable to me. A commit references this bug: Author: markj Date: Wed Feb 5 16:09:44 UTC 2020 New revision: 357575 URL: https://svnweb.freebsd.org/changeset/base/357575 Log: Improve validation of the sockaddr length in iruserok_sa(). Negative numbers are not valid sockaddr lengths. PR: 243747 Submitted by: Andrew Reiter <areiter@veracode.com> MFC after: 1 week Changes: head/lib/libc/net/rcmd.c Thank you for the quick response and the commit! Best, Andrew Woops, maybe I was ignoring c99 here. I should not submit pr's when sleepy. (In reply to Andrew Reiter from comment #5) Could you elaborate? I think bc sizeof() returns size_t only the == 0 case will matter.. but that being said, having it clear/explicit (ie <= 0) is kind of nice... and at this point I am being wasteful of people's time on a pedantic bit :-). /me goes back to hole. Thanks again. (In reply to Andrew Reiter from comment #7) Ah, yes, I think you're right. I agree that it's probably better this way anyway. A commit references this bug: Author: markj Date: Wed Feb 12 15:51:29 UTC 2020 New revision: 357825 URL: https://svnweb.freebsd.org/changeset/base/357825 Log: MFC r357575: Improve validation of the sockaddr length in iruserok_sa(). PR: 243747 Changes: _U stable/12/ stable/12/lib/libc/net/rcmd.c |