Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1769762imm; Thu, 27 Sep 2018 02:09:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV61aHBUyaGL8TG8y1p7Ux39T4E2ZG2EojytqLAnuS8o1ZAxj4Ta0PiuGf7qX+uATKvuj0WBJ X-Received: by 2002:a63:6c89:: with SMTP id h131-v6mr9106332pgc.237.1538039344454; Thu, 27 Sep 2018 02:09:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538039344; cv=none; d=google.com; s=arc-20160816; b=y9KEo8Lvc35FYwQbCKgfQ58DNN0Ded5jl9/0eVVqQGd3GqtssXXHlS4w+4SeydHnV2 rcMYnFBLMCjrG9Vm31f242qcbeAZZXaiKgktLn1fjprbzMUMMPLEJw43JhixI0RJyt3Q 72ICy6VVheFN3rcu/NXuH01OmN5qC2/VKnD0BbiwObg1ygYAk7K6sTtuSdvykP+iHtvQ wfzugaKdLvQ0WjewvRlkXHhFkAZNDjNjH4Y5uMQ5Pdahe6FfAnwetuHY83Af/1d+0NLr loGUuCD0s+splNdb6Ib1taIo9RHCXBOs6ZJ7gGuYXyBQ7iv/mYWQ1PJbLsuexWxwuA5d lt0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=/HBaG/xxurtoO6/RUPz1B6AtZPb51Wy4/UQh3uyodTU=; b=QeASOZZd5tEhnFMOjXhKL78aPe00K9VlAjCGhEM4mW3fbKdfzyxurHqZQsOxZ6po6v MiwPPXskS/JJ/wpDqx+FAM6wpIMiH/zWUJf2LQSrYevpBOprF8y81uukxZe5bjlEbiJ3 RaizNTf6urCr62//KWquHRzogK2ZIVrID3ZJHt+2oNZ+ackvhClA0LpHNdNT7fwe4wys giiBr5DoVMFulx0jD4dKafVG3Wenny/NHmDxIRBxFwy31v2UAb14ffETIaPjvDof2tZa f9Eq141JGOpx6YbY+uoGzx2EtLwwzHL9HteW1SO3vHx447ogGMLlRzs1WU2wcg4VXlDV T7MQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 22-v6si1522492pfl.220.2018.09.27.02.08.49; Thu, 27 Sep 2018 02:09:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727410AbeI0PYb (ORCPT + 99 others); Thu, 27 Sep 2018 11:24:31 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54720 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbeI0PYa (ORCPT ); Thu, 27 Sep 2018 11:24:30 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2BD2810C7; Thu, 27 Sep 2018 09:07:15 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jann Horn , Willy Tarreau , "David S. Miller" Subject: [PATCH 4.18 03/88] net/appletalk: fix minor pointer leak to userspace in SIOCFINDIPDDPRT Date: Thu, 27 Sep 2018 11:02:44 +0200 Message-Id: <20180927090301.011776079@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927090300.631426620@linuxfoundation.org> References: <20180927090300.631426620@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Willy Tarreau [ Upstream commit 9824dfae5741275473a23a7ed5756c7b6efacc9d ] 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 Signed-off-by: Willy Tarreau Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/appletalk/ipddp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/net/appletalk/ipddp.c +++ b/drivers/net/appletalk/ipddp.c @@ -283,8 +283,12 @@ static int ipddp_ioctl(struct net_device case SIOCFINDIPDDPRT: spin_lock_bh(&ipddp_route_lock); rp = __ipddp_find_route(&rcp); - if (rp) - memcpy(&rcp2, rp, sizeof(rcp2)); + if (rp) { + memset(&rcp2, 0, sizeof(rcp2)); + rcp2.ip = rp->ip; + rcp2.at = rp->at; + rcp2.flags = rp->flags; + } spin_unlock_bh(&ipddp_route_lock); if (rp) {