From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752904AbdBEXPd (ORCPT ); Sun, 5 Feb 2017 18:15:33 -0500 Received: from smtp-sh2.infomaniak.ch ([128.65.195.6]:45086 "EHLO smtp-sh2.infomaniak.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752727AbdBEXPa (ORCPT ); Sun, 5 Feb 2017 18:15:30 -0500 From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= To: linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , netdev@vger.kernel.org, Alexei Starovoitov , Arnaldo Carvalho de Melo , Daniel Borkmann Subject: [PATCH net-next v1 2/7] samples/bpf: Ignore already processed ELF sections Date: Mon, 6 Feb 2017 00:14:23 +0100 Message-Id: <20170205231428.23846-2-mic@digikod.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170205231428.23846-1-mic@digikod.net> References: <20170205231428.23846-1-mic@digikod.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Antivirus: Dr.Web (R) for Unix mail servers drweb plugin ver.6.0.2.8 X-Antivirus-Code: 0x100000 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a missing check for the map fixup loop. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Arnaldo Carvalho de Melo Cc: Daniel Borkmann --- samples/bpf/bpf_load.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c index 396e204888b3..e04fe09d7c2e 100644 --- a/samples/bpf/bpf_load.c +++ b/samples/bpf/bpf_load.c @@ -328,6 +328,8 @@ int load_bpf_file(char *path) /* load programs that need map fixup (relocations) */ for (i = 1; i < ehdr.e_shnum; i++) { + if (processed_sec[i]) + continue; if (get_sec(elf, i, &ehdr, &shname, &shdr, &data)) continue; -- 2.11.0