From nobody Tue Nov 26 08:23:19 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=1709352799; cv=none; d=zohomail.com; s=zohoarc; b=K7PEzQE2IHXs7UYMMP98EClvExCpWETreWgqKh/eKZXQd5vqUYeaC/hKCHalwEPOQU+qylfZR2QuM9Nc98oayOnVnCLfFnpu/N2X437XjX/rUb/uqg3HWpcasvPlQ7s0z/e2gdU9u7lwGqaTbsdRTnIHMu8NV+5L7v2aBEirH8I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709352799; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=o8MXSoWfmAHZQ0rBmuR55Qzx+gnIMTEYTxvhSOOyEls=; b=SXU/de3xkKEIsy9vqSlztHcYweJB6TWrj9XuGqxT8e6U8XGV0ywNAm1U1b16EeMLOGIrXZCjIJSSUtGjNn7aoOyRUyeyp/6udUhjYeA1AFkmDI5ST+BsBCvAMa5ml8MR6yAOTJaoOi5PXZP0IHH1G87lknzgpD2dRVbwFHXXR+c= 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 1709352799216568.6009294492009; Fri, 1 Mar 2024 20:13:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgGjF-0005KD-5K; Fri, 01 Mar 2024 23:12:05 -0500 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 1rgDpj-0008IF-3A for qemu-devel@nongnu.org; Fri, 01 Mar 2024 20:06:36 -0500 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgDph-0001px-Fa for qemu-devel@nongnu.org; Fri, 01 Mar 2024 20:06:34 -0500 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6e5a50d91b4so2238958b3a.2 for ; Fri, 01 Mar 2024 17:06:32 -0800 (PST) Received: from stoup.. (098-147-055-211.res.spectrum.com. [98.147.55.211]) by smtp.gmail.com with ESMTPSA id lo21-20020a056a003d1500b006e5acdb5c94sm2399881pfb.176.2024.03.01.17.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 17:06:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709341591; x=1709946391; darn=nongnu.org; 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=o8MXSoWfmAHZQ0rBmuR55Qzx+gnIMTEYTxvhSOOyEls=; b=OQ8ujKQML2VNSxjZfF4sqOw0RJ0to+fk7a3jbGACjLfUNtc9glLvqT/cORLgh9+4sH FaRNfmnrp0R+0RMO1inS4stzQCsyhujWDRdqmcDOLBdv7hU6QwGcReNaGopsrn2AV5AO 4OToHWtKIO/G90FbhX7h1B3me8zunAoHIp+KkFYM/NxJ7aKyaytBMlnA8tHP2gCzMZCN OZTz3m0D6HvqLCW38jBrZ9+7CrnAn8C6OLTNeiDGAqcrMfEHHumFbV3kfg5t5Pwdlsrq PGgIjJQ7sKzlTuP9lSSA9szADYp/8cnwDFpVw/2PNWSphmTOCPULi57SvIkg1Et7PxPk GYog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709341591; x=1709946391; 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=o8MXSoWfmAHZQ0rBmuR55Qzx+gnIMTEYTxvhSOOyEls=; b=CN4K+swo0h52/1ysJNO8nizENViRTQTl73E9bbc07oH0L/bA2KavNkOT/j63epUzFT XSV+IatOkAMfjsYkY7g55975TrGM/DO4upBtG5nM2WTIK+7qas7xhS6Yx5OkhqY/YY6D jFgbwJxByh5pDLcYGhcJIFJa+X8XtkAv5cbA76trWNoMiLGmnoyWQjbQ6rfrgzpvUU4J 4/LdV06ZZy4EPR5a67I7AppV7eHyAVQ4uC9gxpOCDUA0yI/6SrUKGWwH5fmwJc5jXAXc yRYnRU0tB6sxzverlcYoVwSvlyS9mpgquUWapFDS2oOHKXRGLh3E30TXh95mtlTrY6ZF j+MA== X-Gm-Message-State: AOJu0YxLwGg1dTE8cEt5M87Tw8c6WHFAzRGShSSFMQ5Nm1u8svaL765f jKKWedpm3gWm4ZMg9HFpHxus18AYsZ3sESOv7MNxO/4ZwjrKC4VtRxKizxKB33hudnFPDD/yJZA j X-Google-Smtp-Source: AGHT+IHkoNqNVXB9d/OkKFx4ZS9wore56vROYcDpgjJKiOjriAZ+vcrW2hvnFfE9GG7kWHjkS8k45A== X-Received: by 2002:a05:6a21:2d86:b0:1a1:44f9:cbf3 with SMTP id ty6-20020a056a212d8600b001a144f9cbf3mr1035651pzb.57.1709341591585; Fri, 01 Mar 2024 17:06:31 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com Subject: [PATCH 1/3] linux-user: Implement PR_{GET,SET}_CHILD_SUBREAPER Date: Fri, 1 Mar 2024 15:06:25 -1000 Message-Id: <20240302010627.12998-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240302010627.12998-1-richard.henderson@linaro.org> References: <20240302010627.12998-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::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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, T_SCC_BODY_TEXT_LINE=-0.01 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: 1709352801280100013 Content-Type: text/plain; charset="utf-8" The "set" prctl passes through integral values. The "get" prctl returns the value into a pointer. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1929 Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- linux-user/syscall.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index bc8c06522f..263b651cc5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6450,11 +6450,21 @@ static abi_long do_prctl(CPUArchState *env, abi_lon= g option, abi_long arg2, case PR_SET_NO_NEW_PRIVS: case PR_GET_IO_FLUSHER: case PR_SET_IO_FLUSHER: + case PR_SET_CHILD_SUBREAPER: /* Some prctl options have no pointer arguments and we can pass on= . */ return get_errno(prctl(option, arg2, arg3, arg4, arg5)); =20 case PR_GET_CHILD_SUBREAPER: - case PR_SET_CHILD_SUBREAPER: + { + int val; + ret =3D get_errno(prctl(PR_GET_CHILD_SUBREAPER, &val, + arg3, arg4, arg5)); + if (!is_error(ret) && put_user_s32(val, arg2)) { + return -TARGET_EFAULT; + } + return ret; + } + case PR_GET_SPECULATION_CTRL: case PR_SET_SPECULATION_CTRL: case PR_GET_TID_ADDRESS: --=20 2.34.1