Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/compat/netbsd32 Pull up following revision(s) (reques...



details:   https://anonhg.NetBSD.org/src/rev/41ec5eba0e6c
branches:  netbsd-8
changeset: 744825:41ec5eba0e6c
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Feb 13 19:34:29 2020 +0000

description:
Pull up following revision(s) (requested by mlelstv in ticket #1504):

        sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.108
        sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.109

Don't use strlcpy to copy untrusted input, it may not be NUL-terminated.

Where did the +1 came from ?

diffstat:

 sys/compat/netbsd32/netbsd32_ioctl.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (72 lines):

diff -r 059b1fd64e8c -r 41ec5eba0e6c sys/compat/netbsd32/netbsd32_ioctl.c
--- a/sys/compat/netbsd32/netbsd32_ioctl.c      Wed Feb 12 20:15:04 2020 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.c      Thu Feb 13 19:34:29 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.c,v 1.89.8.2 2019/07/22 16:27:29 martin Exp $   */
+/*     $NetBSD: netbsd32_ioctl.c,v 1.89.8.3 2020/02/13 19:34:29 martin Exp $   */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.89.8.2 2019/07/22 16:27:29 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.89.8.3 2020/02/13 19:34:29 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -145,7 +145,7 @@
 netbsd32_to_if_addrprefreq(const struct netbsd32_if_addrprefreq *ifap32,
        struct if_addrprefreq *ifap, u_long cmd)
 {
-       strlcpy(ifap->ifap_name, ifap32->ifap_name, sizeof(ifap->ifap_name));
+       memcpy(ifap->ifap_name, ifap32->ifap_name, IFNAMSIZ);
        ifap->ifap_preference = ifap32->ifap_preference;
        memcpy(&ifap->ifap_addr, &ifap32->ifap_addr,
            min(ifap32->ifap_addr.ss_len, _SS_MAXSIZE));
@@ -341,7 +341,7 @@
 netbsd32_to_ieee80211req(struct netbsd32_ieee80211req *ireq32,
                         struct ieee80211req *ireq, u_long cmd)
 {
-       strlcpy(ireq->i_name, ireq32->i_name, IFNAMSIZ);
+       memcpy(ireq->i_name, ireq32->i_name, IFNAMSIZ);
        ireq->i_type = ireq32->i_type;
        ireq->i_val = ireq32->i_val;
        ireq->i_len = ireq32->i_len;
@@ -355,7 +355,7 @@
 {
        int i;
 
-       strlcpy(nwk->i_name, nwk32->i_name, IFNAMSIZ);
+       memcpy(nwk->i_name, nwk32->i_name, IFNAMSIZ);
        nwk->i_wepon = nwk32->i_wepon;
        nwk->i_defkid = nwk32->i_defkid;
        for (i = 0; i < IEEE80211_WEP_NKID; i++) {
@@ -569,7 +569,7 @@
 netbsd32_from_if_addrprefreq(const struct if_addrprefreq *ifap,
        struct netbsd32_if_addrprefreq *ifap32, u_long cmd)
 {
-       strlcpy(ifap32->ifap_name, ifap->ifap_name, sizeof(ifap32->ifap_name));
+       memcpy(ifap32->ifap_name, ifap->ifap_name, IFNAMSIZ);
        ifap32->ifap_preference = ifap->ifap_preference;
        memcpy(&ifap32->ifap_addr, &ifap->ifap_addr,
            min(ifap->ifap_addr.ss_len, _SS_MAXSIZE));
@@ -770,7 +770,7 @@
 netbsd32_from_ieee80211req(struct ieee80211req *ireq,
                           struct netbsd32_ieee80211req *ireq32, u_long cmd)
 {
-       strlcpy(ireq32->i_name, ireq->i_name, IFNAMSIZ);
+       memcpy(ireq32->i_name, ireq->i_name, IFNAMSIZ);
        ireq32->i_type = ireq->i_type;
        ireq32->i_val = ireq->i_val;
        ireq32->i_len = ireq->i_len;
@@ -784,7 +784,7 @@
 {
        int i;
 
-       strlcpy(nwk32->i_name, nwk->i_name, IFNAMSIZ);
+       memcpy(nwk32->i_name, nwk->i_name, IFNAMSIZ);
        nwk32->i_wepon = nwk->i_wepon;
        nwk32->i_defkid = nwk->i_defkid;
        for (i = 0; i < IEEE80211_WEP_NKID; i++) {



Home | Main Index | Thread Index | Old Index