From patchwork Mon Nov 1 13:52:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1549175 X-Patchwork-Delegate: daniel@makrotopia.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=PGK7eHJR; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=hauke-m.de header.i=@hauke-m.de header.a=rsa-sha256 header.s=MBO0001 header.b=cW8MGK8J; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HjZLY3Lk4z9sVc for ; Tue, 2 Nov 2021 00:55:49 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0aNHCQxmk4If8m03L+FurRhradwUNZiokmcOHzLWjaM=; b=PGK7eHJRwu4lSU 1YyyHB+Zcwh9F3tUgPWLahIWuMlDNohVWuegqNXLp8IUR+lszOiebzjrSOuD4UtRszuTEk+jxXkk7 Fa+rWr7Gr5u0ThSrU3UWVUjhWRjHrZasmjY8d8tjJcWdjC13vB9mRohHfiH3ZmqL9tHwaHeZojjk8 E40Tl0QRW+IPGcf7whjk61bBPjzuETTqAILCUiJhjGCeUx8k+G0tyBi+kBryN5tsVBMvurEiEbYVs lC/j5kg18xRbye4Rb0wUdkIs9g77RHp4V4e1ubjKuLSLEc+1fWe2nu4twlkdfdRm1xWFd/cr0yyvq Ad+ocmkjaXYY5qNnSV+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhXkP-00GV9n-CA; Mon, 01 Nov 2021 13:53:13 +0000 Received: from mout-p-202.mailbox.org ([2001:67c:2050::465:202]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhXkL-00GV8z-0f for openwrt-devel@lists.openwrt.org; Mon, 01 Nov 2021 13:53:10 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:105:465:1:3:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4HjZHL5hBZzQjgk; Mon, 1 Nov 2021 14:53:02 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hauke-m.de; s=MBO0001; t=1635774780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HY3D3N4Salz13mG7i8BR6VoWHLoS3yjQ3J+EYB9njx8=; b=cW8MGK8JorSn+xVjdmXIeavImbnNBdF0ZMi/wI4D83Z4zOq+gjmiDVFJ/AENQ8OZHUAdQK j+8zHaT6QYnyI12xve0qFSWOO0tGwKMDy4vHSEoJ+Dyy8rDpoM8ajf9Hq4D1ADWtCobKeO sFwDPO8dOr/u8qjbTvz/isTb5VU1X5ItmQ8AQ7Fbg15ySxeK8as6+fyfBQ9ac4FeBAQdS6 a/AIdIskGrExBtVmfEaHc44/Kh3KkrLCyx409O6beqW7CQMj6X6Zn/6+SNJiHIXEGsDPEH G6VmvdmXATolYJB+8//1+TSKKPSa9CYjr1kzYTaOTu3xiC2LnCLb2HazStQoRg== From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Cc: Hauke Mehrtens Subject: [PATCH 2/2] jail: elf: Remove MIPS 64 warning Date: Mon, 1 Nov 2021 14:52:55 +0100 Message-Id: <20211101135255.750200-2-hauke@hauke-m.de> In-Reply-To: <20211101135255.750200-1-hauke@hauke-m.de> References: <20211101135255.750200-1-hauke@hauke-m.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 44848731 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211101_065309_324280_AC125AB1 X-CRM114-Status: UNSURE ( 9.88 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The procd jails are working fine on MIPS64 too now. I saw this error message when add_path_and_deps() was called which calls elf_load_deps() again under some conditions. This is happening because gcc_mips64_bug_work_around is stored in the data segment [...] Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2001:67c:2050:0:0:0:465:202 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The procd jails are working fine on MIPS64 too now. I saw this error message when add_path_and_deps() was called which calls elf_load_deps() again under some conditions. This is happening because gcc_mips64_bug_work_around is stored in the data segment. We have a call trace like this: elf_load_deps() gcc_mips64_bug_work_around = 1; call add_path_and_deps() call elf_load_deps() gcc_mips64_bug_work_around = 1; error if gcc_mips64_bug_work_around =! 1 gcc_mips64_bug_work_around = 0; return; return; error if gcc_mips64_bug_work_around =! 1 return; I got the same error messages on MIPS 32 BE, when I removed the compile check. This was tested in qemu on MIPS 64 BE and MIPS64 LE. Signed-off-by: Hauke Mehrtens --- jail/elf.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/jail/elf.c b/jail/elf.c index 18a7b7c..176d046 100644 --- a/jail/elf.c +++ b/jail/elf.c @@ -235,11 +235,7 @@ int elf_load_deps(const char *path, const char *map) unsigned long dyn_offset, dyn_size; unsigned long load_offset, load_vaddr; unsigned long interp_offset; -#if defined(__mips__) && (__mips == 64) - static int gcc_mips64_bug_work_around; - gcc_mips64_bug_work_around = 1; -#endif if (elf_find_section(map, PT_LOAD, &load_offset, NULL, &load_vaddr)) { ERROR("failed to load the .load section from %s\n", path); return -1; @@ -256,14 +252,6 @@ int elf_load_deps(const char *path, const char *map) int clazz = map[EI_CLASS]; -#if defined(__mips__) && (__mips == 64) - if (gcc_mips64_bug_work_around != 1) { - ERROR("compiler bug: GCC for MIPS64 should be fixed!\n"); - return -1; - } - gcc_mips64_bug_work_around = 0; -#endif - if (clazz == ELFCLASS32) return elf32_scan_dynamic(map, dyn_offset, dyn_size, load_vaddr - load_offset); else if (clazz == ELFCLASS64)