Summary: | integer underflow in grp_unmarshal_func triggered by nscd | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Alan Somers <asomers> | ||||
Component: | bin | Assignee: | Alan Somers <asomers> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | andrey.zonov, markj, matthias.pfaller, pi | ||||
Priority: | --- | ||||||
Version: | 11.4-RELEASE | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
URL: | https://reviews.freebsd.org/D26204 | ||||||
Attachments: |
|
Description
Alan Somers
2020-08-26 17:01:50 UTC
Code review in progress A commit references this bug: Author: asomers Date: Sat Sep 19 19:08:28 UTC 2020 New revision: 365910 URL: https://svnweb.freebsd.org/changeset/base/365910 Log: fix integer underflow in getgrnam_r and getpwnam_r Sometimes nscd(8) will return a 1-byte buffer for a nonexistent entry. This triggered an integer underflow in grp_unmarshal_func, causing getgrnam_r to return ERANGE instead of 0. Fix the user's buffer size check, and add a correct check for a too-small nscd buffer. PR: 248932 Event: September 2020 Bugathon Reviewed by: markj MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D26204 Changes: head/lib/libc/gen/getgrent.c head/lib/libc/gen/getpwent.c Is there any reason not to MFC the change? If so, can we close this PR? A commit references this bug: Author: asomers Date: Thu Nov 26 23:34:03 UTC 2020 New revision: 368085 URL: https://svnweb.freebsd.org/changeset/base/368085 Log: MFC r365910: fix integer underflow in getgrnam_r and getpwnam_r Sometimes nscd(8) will return a 1-byte buffer for a nonexistent entry. This triggered an integer underflow in grp_unmarshal_func, causing getgrnam_r to return ERANGE instead of 0. Fix the user's buffer size check, and add a correct check for a too-small nscd buffer. PR: 248932 Event: September 2020 Bugathon Reviewed by: markj Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D26204 Changes: _U stable/12/ stable/12/lib/libc/gen/getgrent.c stable/12/lib/libc/gen/getpwent.c *** Bug 225260 has been marked as a duplicate of this bug. *** *** Bug 130749 has been marked as a duplicate of this bug. *** |