This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] CVE-2018-19591: if_nametoindex: Fix descriptor for overlong name [BZ #23927]
- From: Andreas Schwab <schwab at suse dot de>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 27 Nov 2018 16:08:31 +0100
- Subject: Re: [PATCH] CVE-2018-19591: if_nametoindex: Fix descriptor for overlong name [BZ #23927]
- References: <87a7luh87n.fsf@oldenburg.str.redhat.com>
On Nov 27 2018, Florian Weimer <fweimer@redhat.com> wrote:
> diff --git a/sysdeps/unix/sysv/linux/if_index.c b/sysdeps/unix/sysv/linux/if_index.c
> index e3d08982d9..3e999d6509 100644
> --- a/sysdeps/unix/sysv/linux/if_index.c
> +++ b/sysdeps/unix/sysv/linux/if_index.c
> @@ -45,6 +45,7 @@ __if_nametoindex (const char *ifname)
>
> if (strlen (ifname) >= IFNAMSIZ)
> {
> + __close_nocancel_nostatus (fd);
> __set_errno (ENODEV);
> return 0;
> }
Just move it before the opensock call.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."