Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3696289pxv; Mon, 26 Jul 2021 09:36:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKY9CVWywynMxldt7fyIuLwKnKPfeD3xDP7IfsbloKUEnwJPV+i2Hp0O+kHAmjG4QI/Gt5 X-Received: by 2002:a5d:8996:: with SMTP id m22mr15072464iol.6.1627317407906; Mon, 26 Jul 2021 09:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627317407; cv=none; d=google.com; s=arc-20160816; b=X8bCtDwNhwOllZUxRBhoC1fJSBKBtkpNn2doV68opI2H5QGtCn5usK9oegPjqzZDPy PxEsbIJEs4DfRujEPq+04TfS4eTUWo1lQtKrrvAo7p5CxVdb3Cs1In1E3Xwi12pKU3eE pRmbh8OLo0cKiQRt7fZj6IZaSenzvtVcWQX/jG15ytWA/lzRm8MEQbNJsRF6JetKD0DS UDE9epDoXisbvLPv5z1Y0Pxv74OJ5hRo2YMLt+y+/gFqRUoXbhnh3OynIfYcevZHBdh6 leBm9YIR+iI9jBDevXAp5IWxlEB26Hsyjo4VOGtuPvdvj5PWehuy1u3iO4+Nj64+kYDh UA8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kP/7S3aHe0mj5JERiul2kEEo/lJ+FAWAl5fthUyYS7Q=; b=xN/jEXcPGW8k+6qHMMfeeOEKaNWMeh6coEvGkCaSvtqZlw+Qcx1OS+746aF2BaFYtr XjIlqHXtKiWf1cX18pY05eixfQk4kVPERHi8hcp86ul67E/pBDIZ10YVwCYKWAa/+Tz7 ieGO9KprobWh5Z64U7dzGt+DqwAejST3IzKJzk0ZvPHn2z5jiBDHeXZvRyOW+/JR2Gzg YX+KCvJAXB6h5mIlSPA24BD+ZP/rU6+2Kd0wPvP+8Y2SqeB00s3oeP9E11d58yXhV86Y N53dz7rhjbFrAQ4+RT4YkAyQBkWQmB+xNXRa8b8z1dhNfngOIQwzkBBgbLaqBgJ63tli SHWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VDZiKhU+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si304364ioc.2.2021.07.26.09.36.34; Mon, 26 Jul 2021 09:36:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VDZiKhU+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239438AbhGZPw2 (ORCPT + 99 others); Mon, 26 Jul 2021 11:52:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:47948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233155AbhGZPcD (ORCPT ); Mon, 26 Jul 2021 11:32:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D163660EB2; Mon, 26 Jul 2021 16:11:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627315918; bh=lt7gDp/hN1IsxntOiOG0y7SZerHgnCH6tEfNFOCtDfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VDZiKhU+Fe3r1I0vB6B8cih5CSEk5yLyN44c6z6OuMWQM41ChUeMwP66jgS9EwwH/ iCyx3UZQHAy1GI9RKeezjiFtmRx5ZOjT4k+c1Zi0eYAldbIsbkGpNdQi0bTDSgZBsm /6NbOTU5KIBah/TadPxYqQB52KVLyTbKE1gxG25A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Abeni , "David S. Miller" , Sasha Levin Subject: [PATCH 5.13 118/223] ipv6: fix another slab-out-of-bounds in fib6_nh_flush_exceptions Date: Mon, 26 Jul 2021 17:38:30 +0200 Message-Id: <20210726153850.128151992@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153846.245305071@linuxfoundation.org> References: <20210726153846.245305071@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paolo Abeni [ Upstream commit 8fb4792f091e608a0a1d353dfdf07ef55a719db5 ] While running the self-tests on a KASAN enabled kernel, I observed a slab-out-of-bounds splat very similar to the one reported in commit 821bbf79fe46 ("ipv6: Fix KASAN: slab-out-of-bounds Read in fib6_nh_flush_exceptions"). We additionally need to take care of fib6_metrics initialization failure when the caller provides an nh. The fix is similar, explicitly free the route instead of calling fib6_info_release on a half-initialized object. Fixes: f88d8ea67fbdb ("ipv6: Plumb support for nexthop object in a fib6_info") Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv6/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index d417e514bd52..09e84161b731 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -3642,7 +3642,7 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg, err = PTR_ERR(rt->fib6_metrics); /* Do not leave garbage there. */ rt->fib6_metrics = (struct dst_metrics *)&dst_default_metrics; - goto out; + goto out_free; } if (cfg->fc_flags & RTF_ADDRCONF) -- 2.30.2