From nobody Mon Feb 9 04:03:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630013016292251.38247106021004; Thu, 26 Aug 2021 14:23:36 -0700 (PDT) Received: from localhost ([::1]:39864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJMqV-0002S6-65 for importer@patchew.org; Thu, 26 Aug 2021 17:23:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJMfp-0005io-OU for qemu-devel@nongnu.org; Thu, 26 Aug 2021 17:12:33 -0400 Received: from mail-il1-x129.google.com ([2607:f8b0:4864:20::129]:34451) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJMfo-0006n2-Ah for qemu-devel@nongnu.org; Thu, 26 Aug 2021 17:12:33 -0400 Received: by mail-il1-x129.google.com with SMTP id j15so4765943ila.1 for ; Thu, 26 Aug 2021 14:12:31 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id a17sm2348633ilp.75.2021.08.26.14.12.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 14:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GiaQIIYvzMX3kBsTWafB+XsF4D6nhHn7w46Aapsrz8s=; b=LAs8+ToliEcKEEyZjdCYGge8+7qLiaCSgX+Hi0Qv0lax1Phnwyx7I15w/TUGoQcjxi psMe75OhLT9PimifkAEEZ+RzJGA1rsD4Pc04zU/TXgprcIM540FQBycywBDo/IuVjHHg by3yi8ydt7QpgAYqemIAhG+BMfz00RzX0i8LBSiK6cCDOef69nkoOJXouR3TlJtPR5Ju wZF9SYX4pYwZWrpqFBWVVKrsKXu7nFgwFMMNoNbORShEoNfIFDwiweL0PpGxSDoNjeEe sEXLaQsp2e8WDs2wY/JSoUAQRWUZnjbwqGrZ/tXMMsNizb9Fa7GLPGqnoJFtprTwYHYC gHBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GiaQIIYvzMX3kBsTWafB+XsF4D6nhHn7w46Aapsrz8s=; b=MOH03LjfiiY6fIxa5lUvb1pyxgQe2A3PDef3vq6KGVvXhW3kdmC0m32k1b+BPCmxrV AwXLyMxMd7k/kCrOx2zU6egCqBNL/WLvYI6fketGldqIq2w0/kKXk8Q7WbrjT6a+IquM d3fCvGf34SQmhRC92/T69mEQTj+UEWKuZCI880AXUZ5PP5AaSOV8Y6d6oPFzXVDHO7LL jGS19bdCytH4H+ppQK3pptpjUSIL23C7sY3rCJE/JMIbIh9LkufVNXA3ghWFdGeDQenb csMttdDfy+wLbA3FAoP5gQxKDA+3EpNC5Jn4C/MtUz1hwW6nzXHuf6HbmnemGofULicc eORA== X-Gm-Message-State: AOAM533D63Rltw6yqpdRy2IkMUkWw9Y8aFUpjPjwEbGbpfx2RhSDTrkp B1zlAewDPxmSY4PrrByTnWqI7SzZhczCf8x7 X-Google-Smtp-Source: ABdhPJwzwuWJu1oTzjvrW/C9RPghQwIZytYNS9miCoUQaTzif89Ia7GPGdt2VcwgPKaETZj0V6UYjw== X-Received: by 2002:a92:c808:: with SMTP id v8mr4090340iln.110.1630012350963; Thu, 26 Aug 2021 14:12:30 -0700 (PDT) From: imp@bsdimp.com To: qemu-devel@nongnu.org Subject: [PATCH v2 09/43] bsd-user: Fix calculation of size to allocate Date: Thu, 26 Aug 2021 15:11:27 -0600 Message-Id: <20210826211201.98877-10-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210826211201.98877-1-imp@bsdimp.com> References: <20210826211201.98877-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::129; envelope-from=imp@bsdimp.com; helo=mail-il1-x129.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630013017149100001 Content-Type: text/plain; charset="utf-8" From: Warner Losh It was incorrect to subtract off the size of an unsigned int here. In bsd-user fork, this change was made when moving the arch specific items to specific files. The size in BSD that's available for the arguments does not need a return address subtracted from it. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsdload.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c index 5282a7c4f2..379015c744 100644 --- a/bsd-user/bsdload.c +++ b/bsd-user/bsdload.c @@ -143,10 +143,9 @@ int loader_exec(const char *filename, char **argv, cha= r **envp, struct target_pt_regs *regs, struct image_info *infop, struct bsd_binprm *bprm) { - int retval; - int i; + int retval, i; =20 - bprm->p =3D TARGET_PAGE_SIZE * MAX_ARG_PAGES - sizeof(unsigned int); + bprm->p =3D TARGET_PAGE_SIZE * MAX_ARG_PAGES; for (i =3D 0; i < MAX_ARG_PAGES; i++) { /* clear page-table */ bprm->page[i] =3D NULL; } --=20 2.32.0