Bug 170295 - [patch] mountd(8): correct credentials parsing in -mapall and -maproot options
Summary: [patch] mountd(8): correct credentials parsing in -mapall and -maproot options
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-31 14:00 UTC by Andrey Simonenko
Modified: 2013-09-23 14:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Simonenko 2012-07-31 14:00:25 UTC
The usr.sbin/mountd/mountd.c:parsecred() function has the following mistakes:

1. It has buffer overflow if number of GIDs of some user is greater than
   the XU_NGROUPS value, incorrect usage of getgrouplist(3).

2. It incorrectly gets group lists for a user given without groups: it
   forgets about a single group of a user or forgets about the first
   supplementary group of a user.

3. If a user is unknown it silently uses -2:-2 credentials and this
   does not correspond to exports(5) rules.

4. If a group is unknown, then it ignores this group and this
   does not correspond to exports(5) rules.

5. It uses atoi(3) function to parse UID and GID, and does not check
   any mistakes in numbers.

Fix: 

[ patch elided - gavin@ ]
Comment 1 Gavin Atkinson freebsd_committer freebsd_triage 2013-09-23 14:28:42 UTC
State Changed
From-To: open->closed

PR closed at request of submitter.