Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp113043ybg; Mon, 8 Jun 2020 17:58:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB9Pv+V0HjCIWVG9TBU+gre8OFous4MW4/lLMuyf6zszwgX6AhijGQd4ukhYk1gz/gWMdX X-Received: by 2002:a17:906:2507:: with SMTP id i7mr15465293ejb.419.1591664333442; Mon, 08 Jun 2020 17:58:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664333; cv=none; d=google.com; s=arc-20160816; b=oYxrSyrEx7LgfQSXYPJTko7GZsH3w8O9xTgGna/MKBeqSUlNHuCXgJOGcOTabAk+x0 c1QaBaSzCWmOU4lHQRzIkA5xK3cqebRMwo3Cp6yBXUfTZU/30fMWoHEZZXr8clZXs9Ou VFEVxKAcBt0kKNw1qh9pTLrpasyZ0qbvRHD0lss/zx7WxQ2/W7DSlK+eYRRWU4InlItk oLpKGKEaiHDM2AMeyiSlovJtDJeWfvfQJZq7lrHHQC7ltCj6CzXKqyjicoZqwhOOa9H/ HYVEcdLTD03ZMyP2W/DewiseMUaaaygg02vQMCm/VIm4KdEIZbU4lkVaL59mEO+/pTkI 26gQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OUABWdWEFBVUpoaVzvw5oZEFLhNQamyR8tMichpCLMI=; b=CLOcg5FTXimTJdANp06tTnT4jfHoVPPJbNJEV+8f+fpu4uxAYrB+26CjctHonFOO1c N9rQIb9oWk0b22eFKcHxKibQkbT4h6qv6YtFbivlzPJc9d2UGe2b3iWhWOf4awvrAsbK Cu5hJ/cWYLM0XT/Gwmaw9pgbec14VmLLrffIrDbalGxlUArKZ4X+jmNNZFkR6XI3SHPg Jfc0jdUrYaiPob9q6vEAsVbDF1GGqtMEVGBUwxvNyutAgZ9swGRg4hZUPQJxd/v6E8/G WYWs0sG32Palj/+P+v5XFHjxuwEhcMtD0evYgW+yvaYQ8KzxTs8Q9XQilxIj8za8ht5U kISA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WiO8QZiO; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x22si8058447eje.542.2020.06.08.17.58.30; Mon, 08 Jun 2020 17:58:53 -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=@kernel.org header.s=default header.b=WiO8QZiO; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731924AbgFIA4a (ORCPT + 99 others); Mon, 8 Jun 2020 20:56:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:54664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728315AbgFHXJE (ORCPT ); Mon, 8 Jun 2020 19:09:04 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 48858208C9; Mon, 8 Jun 2020 23:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657744; bh=TZrUG0c+bqLjBayBmaG07PdziZ3fDMuG7ttxZs3ZcfA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WiO8QZiOI3Ynh2+DZ4bUY5Ztma6D67bJ8l6uGYfHfxU0x4762+TSZ6giP2AYjbOOr IM9bhDI6rWoRBpVdxapEJgmFj9jdG6d+aMJtetVvp/jhcxqA+CWjma/YHjB/k65S0i lY4rOEYn6EhaVNhVxSWQ7so43sIQpQHAaq0d6yfo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andrii Nakryiko , Alexei Starovoitov , Sasha Levin , linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 132/274] selftests/bpf: Fix invalid memory reads in core_relo selftest Date: Mon, 8 Jun 2020 19:03:45 -0400 Message-Id: <20200608230607.3361041-132-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrii Nakryiko [ Upstream commit 13c908495e5d51718a6da84ae925fa2aac056380 ] Another one found by AddressSanitizer. input_len is bigger than actually initialized data size. Fixes: c7566a69695c ("selftests/bpf: Add field existence CO-RE relocs tests") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200429012111.277390-8-andriin@fb.com Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/prog_tests/core_reloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/prog_tests/core_reloc.c b/tools/testing/selftests/bpf/prog_tests/core_reloc.c index 31e177adbdf1..084ed26a7d78 100644 --- a/tools/testing/selftests/bpf/prog_tests/core_reloc.c +++ b/tools/testing/selftests/bpf/prog_tests/core_reloc.c @@ -392,7 +392,7 @@ static struct core_reloc_test_case test_cases[] = { .input = STRUCT_TO_CHAR_PTR(core_reloc_existence___minimal) { .a = 42, }, - .input_len = sizeof(struct core_reloc_existence), + .input_len = sizeof(struct core_reloc_existence___minimal), .output = STRUCT_TO_CHAR_PTR(core_reloc_existence_output) { .a_exists = 1, .b_exists = 0, -- 2.25.1