Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4852892pxj; Wed, 9 Jun 2021 03:35:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiKWrnufTJb5ezkBSZYzvAsXmPrnLqFhc3jKbeKcPUzXNQ/tdBg5m42VI4JLzcC53nigcq X-Received: by 2002:a17:906:c2d6:: with SMTP id ch22mr12905664ejb.227.1623234900921; Wed, 09 Jun 2021 03:35:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623234900; cv=none; d=google.com; s=arc-20160816; b=C30YCMm8QDUpvFqOEoVMF20qezQ2TB/DedNr+SbpmYX+oG+J87RAMhzuoT1IC1r3SN ove/U3W5LIMipq3k+DfH5meKbsE5AZiOecjv03KbNpmKYyHQ6U4H5cyY77tjDPxyEnbD l1Tf+gQZAnIvB7TSf5P8xP3Sey80nBVra53Fiw3rBLLXNHE0UHXmxmgdXlrVlT8R2cGA h3rb1z4vUDJ9041wbLJYKGK9Rp+qwBL8/XQLG+kZoXKsAZz/RQGtWl1DhrbV18JPfOkA fM8SCj9RR3IPyiKcOu5lMAvdIpiJ3tBBXfAUDTVfBtBE86DbbVSqZojt9BtvWw3ZuPHW nd1w== 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=komPeD7zUIG177tXRSyVnMdgaUC74IlJoNi9KU5pvzEHYfNbyle+9O5q0SSRMVOezD BEaT9tr5qQR7pkgvICj6aks8C74RSQSiZE06FUSLXqNB3PzJU4Z4IiUQyX10nu1BRdBb //ZQIONYi4wt1p7zzrpd+4/gbxZR7GNNW5fPb5hXteHJE5gQTFSCsOwAYfc1+tbYD5pv JjxQAXWWKsKxHw6S6e/+7NPx0ndULT3gFe4kJJwz2X5Obnv+mQ24rKiJN01NfLMiRcCB x7Brm8lL92+PnoBkJ+qlx7V9VjQepaUpMVJrSOW/fXbmTvS/oh2XfLE7ZGfhlIlLBCNa qmwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JF8wI4yY; 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 t12si2496603edc.179.2021.06.09.03.34.36; Wed, 09 Jun 2021 03:35:00 -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=JF8wI4yY; 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 S234480AbhFHTGd (ORCPT + 99 others); Tue, 8 Jun 2021 15:06:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:33092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237128AbhFHS5Y (ORCPT ); Tue, 8 Jun 2021 14:57:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F1D6961622; Tue, 8 Jun 2021 18:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177746; bh=CAnlmVg2OB/1ByO4Wsm94f5zmagty4A3TeD/u65t30k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JF8wI4yY7xETEez5DSUV9kEVGPXq/eWEVSnKFx6z9M/UUOYiWSQJrt4MaXtFUrGOk LpCgWEl7skgVTp7SHT9ODmSazjg0wYTjApyluJBkcaMl3WHa4m3P4mPLQszMJWtohK 5POyJ9Dw7OV4GuvUCMNXgL3txD2+Vurmd1kLgcxA= 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.10 085/137] wireguard: allowedips: initialize list head in selftest Date: Tue, 8 Jun 2021 20:27:05 +0200 Message-Id: <20210608175945.242677364@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175942.377073879@linuxfoundation.org> References: <20210608175942.377073879@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: 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,