Commit 88543e7d authored by Willy Tarreau's avatar Willy Tarreau Committed by Kleber Sacilotto de Souza

net/appletalk: fix minor pointer leak to userspace in SIOCFINDIPDDPRT

BugLink: https://bugs.launchpad.net/bugs/1798617

[ Upstream commit 9824dfae ]

Fields ->dev and ->next of struct ipddp_route may be copied to
userspace on the SIOCFINDIPDDPRT ioctl. This is only accessible
to CAP_NET_ADMIN though. Let's manually copy the relevant fields
instead of using memcpy().

BugLink: http://blog.infosectcbr.com.au/2018/09/linux-kernel-infoleaks.html
Cc: Jann Horn <jannh@google.com>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent ce708463
...@@ -284,8 +284,12 @@ static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -284,8 +284,12 @@ static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
case SIOCFINDIPDDPRT: case SIOCFINDIPDDPRT:
spin_lock_bh(&ipddp_route_lock); spin_lock_bh(&ipddp_route_lock);
rp = __ipddp_find_route(&rcp); rp = __ipddp_find_route(&rcp);
if (rp) if (rp) {
memcpy(&rcp2, rp, sizeof(rcp2)); memset(&rcp2, 0, sizeof(rcp2));
rcp2.ip = rp->ip;
rcp2.at = rp->at;
rcp2.flags = rp->flags;
}
spin_unlock_bh(&ipddp_route_lock); spin_unlock_bh(&ipddp_route_lock);
if (rp) { if (rp) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment