CVE-2022-23219: Buffer overflow in sunrpc clnt_create for "unix" (bug 22542)
Processing an overlong pathname in the sunrpc clnt_create function results in a stack-based buffer overflow. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
parent
e368b12f6c
commit
226b46770c
4
NEWS
4
NEWS
|
@ -156,7 +156,9 @@ Changes to build and runtime requirements:
|
||||||
|
|
||||||
Security related changes:
|
Security related changes:
|
||||||
|
|
||||||
[Add security related changes here]
|
CVE-2022-23219: Passing an overlong file name to the clnt_create
|
||||||
|
legacy function could result in a stack-based buffer overflow when
|
||||||
|
using the "unix" protocol. Reported by Martin Sebor.
|
||||||
|
|
||||||
The following bugs are resolved with this release:
|
The following bugs are resolved with this release:
|
||||||
|
|
||||||
|
|
|
@ -57,9 +57,13 @@ clnt_create (const char *hostname, u_long prog, u_long vers,
|
||||||
|
|
||||||
if (strcmp (proto, "unix") == 0)
|
if (strcmp (proto, "unix") == 0)
|
||||||
{
|
{
|
||||||
memset ((char *)&sun, 0, sizeof (sun));
|
if (__sockaddr_un_set (&sun, hostname) < 0)
|
||||||
sun.sun_family = AF_UNIX;
|
{
|
||||||
strcpy (sun.sun_path, hostname);
|
struct rpc_createerr *ce = &get_rpc_createerr ();
|
||||||
|
ce->cf_stat = RPC_SYSTEMERROR;
|
||||||
|
ce->cf_error.re_errno = errno;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
sock = RPC_ANYSOCK;
|
sock = RPC_ANYSOCK;
|
||||||
client = clntunix_create (&sun, prog, vers, &sock, 0, 0);
|
client = clntunix_create (&sun, prog, vers, &sock, 0, 0);
|
||||||
if (client == NULL)
|
if (client == NULL)
|
||||||
|
|
Loading…
Reference in New Issue