Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3710548pxv; Mon, 26 Jul 2021 09:59:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEhGf4NgGZ++eWPwwXwjdxSxcvvs7f3Sm6FNwi60+p+mzeJ8boUHhv3UTWs/lPL3k0H+RZ X-Received: by 2002:a50:8d8b:: with SMTP id r11mr22332705edh.217.1627318757838; Mon, 26 Jul 2021 09:59:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627318757; cv=none; d=google.com; s=arc-20160816; b=r49HYt3AbkhYqDEBMLazTw3ii854tAqYLWXLyULvxZjCYxXI/nNpC1Oz89dLui6wpb 2z/A3r+AHL1XrymxxxmbfZxnz+tKJhvmPdlXtfooMryQWqcw+iy6kIRW+pKJEDlamiW9 C2qcy3VsCT90XoRiyV9EPzQcyw0lW4BTqg6RZtBvwendZ2YDw3nORNIuAE3i9PIx5w1b jd2oxV4CE9/DgBc0m7oC6m8oqcFMXM8uQRDyBH7+inznw5seE4RPwoy591nhN4UO54qB unpvRI0IuqYavPBZUpmqHmtm3pGChNZ8VAlqWsKQgyYd3s75U8lYRHkrpjcfHzmOqVbV 9DjQ== 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=FIxvUHX6HKvIwSHWZy0Us57ZKsBxBMqqtaPfGOtXNV4=; b=OKPqWX+TLc71q2hX8CXJAmqmXw9uKUO2pPzqzq049lFyqt6fQNOFSl8AGzSIUz5Dwf PaNhT6Gt8d4MlXDmtVeWHLNqIZ/ZIWEeqsGy5W81c4IbAMmUl2+8zDar42x0tX4tcXHE DxFVyS1D4WDKFKkaFvsPyLFhclyS3McVa/58ESnRhnq5kLKd1g3JvnaPDAV1ixw8P3ig IcPkqoL5sixd645+br+4RZBTXcu41b2QlDfttbGE+xpAE86zGW1H/a4a8VLOcrYRY8kW 9+KIvR8PChfNZkcYDu+myY8/XsYDUW7d8zM1mQF2LNvXBx+mn6sbm/9i9kH5b/0dnJJx iSzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=djp8Wabs; 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 k7si477438edr.269.2021.07.26.09.58.54; Mon, 26 Jul 2021 09:59:17 -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=djp8Wabs; 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 S235977AbhGZPeN (ORCPT + 99 others); Mon, 26 Jul 2021 11:34:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:60154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236711AbhGZPTM (ORCPT ); Mon, 26 Jul 2021 11:19:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0C08260F8F; Mon, 26 Jul 2021 15:59:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627315181; bh=K1ADPbmNrthRVbeq//bPPCUL+SkUW8YFVKW9/cweEkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=djp8WabsyRK44QSpHDt8Qi+9OQbgUVG4nw0mIRb29ASdi0qY13mf07ofHKJ0pgSh1 KMV4s/Rz+Bct68LIOwNGIA8O+mIVYnSG8CXhD1QGxrGsp+/sycH0zgtV8lIQg6ZkCY 6ex0dmveIsa9WANaS7BSVNmHlmJCBCF/HksIwqZY= 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.4 059/108] ipv6: fix another slab-out-of-bounds in fib6_nh_flush_exceptions Date: Mon, 26 Jul 2021 17:39:00 +0200 Message-Id: <20210726153833.585864785@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153831.696295003@linuxfoundation.org> References: <20210726153831.696295003@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 b903fe28ce50..d6fc22f7d7a6 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -3655,7 +3655,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