This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch release/2.26/master updated. glibc-2.26-165-g74d16a5
- From: fw at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 29 Jun 2018 17:24:22 -0000
- Subject: GNU C Library master sources branch release/2.26/master updated. glibc-2.26-165-g74d16a5
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, release/2.26/master has been updated
via 74d16a57a3615fcf05e5c60cb5a8f25e8acf38b9 (commit)
from 3aaf8bda00988f21f4a83affff47bafc74a745a0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=74d16a57a3615fcf05e5c60cb5a8f25e8acf38b9
commit 74d16a57a3615fcf05e5c60cb5a8f25e8acf38b9
Author: Steve Ellcey <sellcey@caviumnetworks.com>
Date: Fri Jun 29 17:32:23 2018 +0200
Check length of ifname before copying it into to ifreq structure.
[BZ #22442]
* sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
Check if ifname is too long.
(cherry picked from commit 2180fee114b778515b3f560e5ff1e795282e60b0)
diff --git a/ChangeLog b/ChangeLog
index c502ace..7ecc33e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-11-15 Steve Ellcey <sellcey@cavium.com>
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
2018-06-29 Daniel Alvarez <dalvarez@redhat.com>
Jakub Sitnicki <jkbs@redhat.com>
diff --git a/NEWS b/NEWS
index db43d87..48d28e1 100644
--- a/NEWS
+++ b/NEWS
@@ -120,6 +120,7 @@ The following bugs are resolved with this release:
[22299] x86-64: Don't set GLRO(dl_platform) to NULL
[22320] glob: Fix one-byte overflow (CVE-2017-15670)
[22321] sysconf: Fix missing definition of UIO_MAXIOV on Linux
+ [22442] if_nametoindex: Check length of ifname before copying it
[22322] libc: [mips64] wrong bits/long-double.h installed
[22325] glibc: Memory leak in glob with GLOB_TILDE (CVE-2017-15671)
[22342] NSCD not properly caching netgroup
diff --git a/sysdeps/unix/sysv/linux/if_index.c b/sysdeps/unix/sysv/linux/if_index.c
index 8ba5eae..a874634 100644
--- a/sysdeps/unix/sysv/linux/if_index.c
+++ b/sysdeps/unix/sysv/linux/if_index.c
@@ -43,6 +43,12 @@ __if_nametoindex (const char *ifname)
if (fd < 0)
return 0;
+ if (strlen (ifname) >= IFNAMSIZ)
+ {
+ __set_errno (ENODEV);
+ return 0;
+ }
+
strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
{
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
NEWS | 1 +
sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
3 files changed, 13 insertions(+), 0 deletions(-)
hooks/post-receive
--
GNU C Library master sources