From patchwork Tue Jun 8 18:27:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 455835 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp4032250jae; Tue, 8 Jun 2021 12:14:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYgsdEcjDP7NQ1PBosjgRSK3Q4t6qdxvMMKRQacsynNbN8SZJPFWh0neKMOVd0J4NFynlc X-Received: by 2002:a50:fb8a:: with SMTP id e10mr28289047edq.330.1623179648075; Tue, 08 Jun 2021 12:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623179648; cv=none; d=google.com; s=arc-20160816; b=Wcsw+GcYmNlqN3fbWY8N0AJmxhVcnmhCr6MXgBMZGoaIL/LvS96C4PYwEfcfnKfno0 /sDLb7xRa/8MQi99ds9RfsXyZd7lXr5dfyT9p2IMvoPs0p0rrysdHJhh5yDZ+nQ4lVSa NBZn5qWLAqv40xqAiJUT3HLTSTpOU0IQ0IIctZfKFXoAO3+F+d5y/1ckVzRlvLso835y BRPavom+C0R3rwn9x9B3mMCCFOfam8NYqw+WonlBPp5JXFtLdqFBSa6vLqVR+dk9CZFH 2E01E43ou9eNzrxss0RP69/v9C1dyviT4G/lu5MX7mmkIGTWteP//3z6MS+3okqP2De1 n3zg== 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=uzUv3C7lBHQr1geg8Ub36SmmFRG+oK2Zfa1YNYuSl40=; b=udx9zEUHHmn5/cmGDBDuuYTmL3D37EUm1sgjZLItjzc22DLV95mjnfWpD/GfNCxsXS Ktu+ka9t5M0IALiyN0iD+OUiA9nGT07bu+lkcavgUGpXHemtQsNIcyyRpVxYAYCSLm38 vATE0fc5onGIM1xSnzB1mz4gGf2HLHFxy5gZyqpisagaKR/Iimwhn6bcajw/HVpQ1TsR Fli0W/zU5WCfH69AFetcoW2oWe0HfTyasyMA4NzrNErE4m3FRHp7DyQmeSwg9/kPnl03 QBfdE+kV+A8kX3cSU4qyHF8cwEvR3oPh/WyT0wiEWWfjbh/hVl56sny3uWP96xj+0VqG ezMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JfxGsNcA; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 l23si509825ejb.573.2021.06.08.12.14.07; Tue, 08 Jun 2021 12:14:08 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=JfxGsNcA; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S237006AbhFHTOF (ORCPT + 12 others); Tue, 8 Jun 2021 15:14:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:35256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235925AbhFHTMB (ORCPT ); Tue, 8 Jun 2021 15:12:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E3AB06194A; Tue, 8 Jun 2021 18:49:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623178157; bh=CAnlmVg2OB/1ByO4Wsm94f5zmagty4A3TeD/u65t30k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JfxGsNcA0Yx/5iFUu0noBiaalewnb6Y3ehEKq4lqN1lw+B4g61kNjn/vIugj0hCxg wlVlwToWI8gh6mY5CTv7yArxpoxrJWp8QMtr1Cp+qAZmlwkkGsH7Gj8ujY36fxAT8+ t/ys5qJvwvgh0plasweVWwUxGcwzXcZj+ftJzzNM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Jason A. Donenfeld" , "David S. Miller" Subject: [PATCH 5.12 099/161] wireguard: allowedips: initialize list head in selftest Date: Tue, 8 Jun 2021 20:27:09 +0200 Message-Id: <20210608175948.806991696@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175945.476074951@linuxfoundation.org> References: <20210608175945.476074951@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jason A. Donenfeld commit 46cfe8eee285cde465b420637507884551f5d7ca upstream. The randomized trie tests weren't initializing the dummy peer list head, resulting in a NULL pointer dereference when used. Fix this by initializing it in the randomized trie test, just like we do for the static unit test. While we're at it, all of the other strings like this have the word "self-test", so add it to the missing place here. Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") Cc: stable@vger.kernel.org Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireguard/selftest/allowedips.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/wireguard/selftest/allowedips.c +++ b/drivers/net/wireguard/selftest/allowedips.c @@ -296,6 +296,7 @@ static __init bool randomized_test(void) goto free; } kref_init(&peers[i]->refcount); + INIT_LIST_HEAD(&peers[i]->allowedips_list); } mutex_lock(&mutex); @@ -333,7 +334,7 @@ static __init bool randomized_test(void) if (wg_allowedips_insert_v4(&t, (struct in_addr *)mutated, cidr, peer, &mutex) < 0) { - pr_err("allowedips random malloc: FAIL\n"); + pr_err("allowedips random self-test malloc: FAIL\n"); goto free_locked; } if (horrible_allowedips_insert_v4(&h,