Bug 172523 - [patch] rpc.lockd(8): Check value of res->ai_family
Summary: [patch] rpc.lockd(8): Check value of res->ai_family
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
Depends on:
Reported: 2012-10-09 23:30 UTC by Erik Cederstrand
Modified: 2018-01-03 05:14 UTC (History)
0 users

See Also:

file.diff (502 bytes, patch)
2012-10-09 23:30 UTC, Erik Cederstrand
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Cederstrand 2012-10-09 23:30:06 UTC
Found with Clang Static Analyzer: http://scan.freebsd.your.org/freebsd-head/WORLD/2012-10-07-amd64/report-Ap4YNc.html#EndPath

Similar to the create_service() function, lookup_addresses() should fail if the value of res->ai_family is neither AF_INET of AF_INET6.

The base type for res->ai_family is int, so there is no constraint that the value is with AF_INET or AF_INET6.

Fix: See attached patch. Instead of "break;" in the default switch, fail like create_service() function does.

Patch attached with submission follows:
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:22 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped