From nobody Thu Nov 28 14:43:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1691293117; cv=none; d=zohomail.com; s=zohoarc; b=DE+RY6Qb5Fguwo9QTyOpy6bYbhBoCmkYCYqTAu4ubiaF8z78eX17FIYVUGdaxDaHR4W9RpfZGdWtZa75izCW5kA9nf2KK03r6E0yYaGjTxDfukzdmk6cpwUJLotO3Q7ADGoGMhPsL8IBJR2wMHBr2YBi6+pGif3g7hUl+aMaIR8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1691293117; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VNYrY2Waoll+LErzR9Xgbts1EKTxuONltL+p3Yeklu4=; b=anCWmIWsrYVkAn/aSikJcK1S98QlURehbiI5q9AIAJdXqJRWQ0weyRLj8TupkDFL81pGIHbth2wjwe6ucSxHBEDyMCtgyzqLzsvdTVxzKhSoSdM7oA/szTDP4agRMDpCcDBow1d8mBtAPyf2LxpbHyR2WXNfwnbvVU1U/pwJnlQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1691293117636514.2436551712758; Sat, 5 Aug 2023 20:38:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSUa9-0003fJ-3d; Sat, 05 Aug 2023 23:37:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSUa6-0003eA-V6 for qemu-devel@nongnu.org; Sat, 05 Aug 2023 23:37:26 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qSUa5-0007Xr-DG for qemu-devel@nongnu.org; Sat, 05 Aug 2023 23:37:26 -0400 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-26814e27a9eso1685285a91.0 for ; Sat, 05 Aug 2023 20:37:25 -0700 (PDT) Received: from stoup.. ([2602:47:d490:6901:9454:a46f:1c22:a7c6]) by smtp.gmail.com with ESMTPSA id a5-20020a17090a740500b00262e604724dsm6306451pjg.50.2023.08.05.20.37.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Aug 2023 20:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691293044; x=1691897844; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VNYrY2Waoll+LErzR9Xgbts1EKTxuONltL+p3Yeklu4=; b=jvuBu+oiUXsexECcMGF/DL7Brf2aPF5l5SKDbNubqQx1A+QuXsL9YqVlp8ZqA2btjg gjDgS1wn0zR5aldc9ZVe41bvut3dSMIXe7Y30RbA1qQ+Wy8aYvujYmyUDfqubSdouKLf /8W6et5Ln6QOLgyhIl3xQjm2vvVXnYiNepcu25Nr2++tBwW4Lk67skKCWzj/OKMpr3IU vALUNIKHrpaL7a1DCEa/Pb1/NSblNF50F0ZOdskKVYJA6R17wtyLj54+OC+WI9MS1oKx SqK3VdBLuA6NX+py1Fv5E42sUFEpDTVSXRRwuw2qXDBOL/4uCaf5pkWxyvUmaOxqXeLQ IOuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691293044; x=1691897844; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VNYrY2Waoll+LErzR9Xgbts1EKTxuONltL+p3Yeklu4=; b=FLoEE9H+kdH80HFkLoAc+6Q4z21SrVhWQ7ioV1anRkd30ezA8k9Nxj7KqDgUo6x12N wzCPrrIvi+4IVEpQ3l8jpgFxvxrZKyV5vECC2KEkcaf5OEcJ1//b/k01nk0HkIrvZNwF rGCnGniQY1qBpdzanPrCqY3R7FvhqtHXSvXWp0tp+6v6pX1adHOtd5j8dTQaZk5MuOY5 R9dAkPqLogxOYU21HSIKaFXJIfSHGSTpB54ecqfmKf3g+ZLEXo6FKUUD6mNyTewOuCil ilYc44kjU8EICZ8TizQ1KNPpJVqxmEa2EBpmAX0k/45ek0YXha0YrDbGc5tlWscQbbRp WJAQ== X-Gm-Message-State: AOJu0YwuTUjBu7Ap5/1XxoLGub5kxIH1cNV1TU1S2z0Y+tu3efB3RQCu RMa7Lf5sxboYPqcCuHsYjeO3HqqC79okxfvL6iI= X-Google-Smtp-Source: AGHT+IHoZZRsCRVfqMthXl9skZoxp+CFbRUeonxt2D5x/N2gvomcNo5sDJf9+JmGlUpA09gnRILPpg== X-Received: by 2002:a17:90a:6c45:b0:263:fccf:8f6 with SMTP id x63-20020a17090a6c4500b00263fccf08f6mr4044567pjj.14.1691293043858; Sat, 05 Aug 2023 20:37:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Akihiko Odaki , Helge Deller Subject: [PULL 09/24] linux-user: Do nothing if too small brk is specified Date: Sat, 5 Aug 2023 20:37:00 -0700 Message-Id: <20230806033715.244648-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230806033715.244648-1-richard.henderson@linaro.org> References: <20230806033715.244648-1-richard.henderson@linaro.org> 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: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1691293119757100003 Content-Type: text/plain; charset="utf-8" From: Akihiko Odaki Linux 6.4.7 does nothing when a value smaller than the initial brk is specified. Fixes: 86f04735ac ("linux-user: Fix brk() to release pages") Reviewed-by: Helge Deller Signed-off-by: Akihiko Odaki Message-Id: <20230802071754.14876-6-akihiko.odaki@daynix.com> Signed-off-by: Richard Henderson --- linux-user/syscall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f64024273f..e1436a3962 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -820,14 +820,14 @@ abi_long do_brk(abi_ulong brk_val) =20 /* brk pointers are always untagged */ =20 - /* return old brk value if brk_val unchanged or zero */ - if (!brk_val || brk_val =3D=3D target_brk) { + /* return old brk value if brk_val unchanged */ + if (brk_val =3D=3D target_brk) { return target_brk; } =20 /* do not allow to shrink below initial brk value */ if (brk_val < initial_target_brk) { - brk_val =3D initial_target_brk; + return target_brk; } =20 new_brk =3D TARGET_PAGE_ALIGN(brk_val); --=20 2.34.1