lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20091202211026.5116.67536.stgit@mimic.site>
Date:	Wed, 02 Dec 2009 16:10:26 -0500
From:	Patrick Mullaney <pmullaney@...ell.com>
To:	alacrityvm-devel@...ts.sourceforge.net
Cc:	linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: [PATCH 1/2] venet-macvlan: correctly remove newline from lower device
	name

Signed-off-by: Patrick Mullaney <pmullaney@...ell.com>
---

 kernel/vbus/devices/venet/macvlan.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/kernel/vbus/devices/venet/macvlan.c b/kernel/vbus/devices/venet/macvlan.c
index 8724e26..432ff5d 100644
--- a/kernel/vbus/devices/venet/macvlan.c
+++ b/kernel/vbus/devices/venet/macvlan.c
@@ -350,7 +350,11 @@ ll_ifname_store(struct vbus_device *dev, struct vbus_device_attribute *attr,
 	if (priv->dev.vbus.opened)
 		return -EINVAL;
 
-	strncpy(priv->ll_ifname, buf, count-1);
+	memcpy(priv->ll_ifname, buf, count);
+
+	/* remove trailing newline if present */
+	if (priv->ll_ifname[count-1] == '\n')
+		priv->ll_ifname[count-1] = '\0';
 
 	if (priv->mdev.lowerdev) {
 		dev_put(priv->mdev.lowerdev);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ