From patchwork Thu Jan 6 22:57:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 530358 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp1578789imp; Thu, 6 Jan 2022 15:01:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCXklMxZjy0N/r6LVATBjCMidSncz3ORs1qIpyEo9p2qPAkYleECtOUEe5torN2r4CMkMy X-Received: by 2002:a92:ac01:: with SMTP id r1mr30265190ilh.67.1641510066859; Thu, 06 Jan 2022 15:01:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641510066; cv=none; d=google.com; s=arc-20160816; b=hg59QzzhyFnA7EQGDkBMwZKpyBNopo7b0puarNzQ2XhZUZyFmCfcPSu/igL1yhZePI 7zVek9fVH3frzeyVRPHaV+7Uf12AcoBwKuhERfPJCE1w+avRD+6mhNOIzQwvORd8cEv6 mt1AB8qzC3EedIyZ8tfKKNLKcMmh3yjsWb4Hexx0st0yt+MCycadOOmTTVOdYGOrEOMS 8Sy8ff/zu78tIP4bwGqbWMQbi0caBBg+cPbOfORl3hMX7PnjJP+QQ/FXxmULd+m1M4cI MZB6cojGhiFXEQs5B/5MUYc/wDji1p2Giu7p7HfycCsb46NqHjHmFUkzHtKmDoPYfo6L QQkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=qXmfusgryZRwHORLLj3tYYX8dUPLK+MhJ1OKc+3H5hY=; b=YfOpQ1dVdz4OmeB4zmYF1SQid+7Pt9R7yOW/CtLWeXF+ejDVY1IOVUkDxVqeqBRdJ1 DwJ4gWKuybmQ34wgtsHhHmNygskVrnyoh7Zv3ubExTvFOryeK4SLZ2MfLnKh3B6JBTaw Fgcu5bTNO1+NyPVtHGUpdw+xmRrCLKa04L0PYEhMdkPCaBhfjJQBDie0ThZ2LuvQU5vx vmarydQS5MGBesxWzBS8oMVaXw7yhR07q4DXQrzS8AjmQt7SeRQY0OJ2iNZWofCqtSZD /4rtDGkZ5dLJ5dpzNQlb0B32aJwiy6lWYkoqZ+sznSqxX02Y6TPI1WcyWPBWyU5kYoJJ wSNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aOl5wDI6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r13si1823017iov.20.2022.01.06.15.01.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Jan 2022 15:01:06 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aOl5wDI6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5bko-0000st-D2 for patch@linaro.org; Thu, 06 Jan 2022 18:01:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5bhY-000518-7Z for qemu-devel@nongnu.org; Thu, 06 Jan 2022 17:57:44 -0500 Received: from [2607:f8b0:4864:20::62f] (port=37804 helo=mail-pl1-x62f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5bhV-0000Gc-U8 for qemu-devel@nongnu.org; Thu, 06 Jan 2022 17:57:43 -0500 Received: by mail-pl1-x62f.google.com with SMTP id q14so3517777plx.4 for ; Thu, 06 Jan 2022 14:57:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qXmfusgryZRwHORLLj3tYYX8dUPLK+MhJ1OKc+3H5hY=; b=aOl5wDI6Yq24+mK8tLh+f81d6AVwUTHyOksdCqBQyfNXu0ir4o3lJt24sjcmUmVeaU 5j6Ikf5/6+m+DtqsP6PekQPLb8N/slIhVo8A4LsjdilgplCKpa3//QJqtyBmkUfCyPlE gDQ4lQl0gu9HxCn2si0f+3Kdo8TD1IsYBvflTInP8RQefiuJp2lomRGsj/2RCFjJAReD 5V6W9cORTZQjhrQisduN19Kt7q8K1K9qqJpHZhm+xosogiwrYKPU1WbILM5TzAJPGrKP 5GD98l845Y6CGn9C9MGfQJA90in7QqBQbdQ0+QVReRUS08CVTMycmPJImm3aNvQ6hvzT qEng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qXmfusgryZRwHORLLj3tYYX8dUPLK+MhJ1OKc+3H5hY=; b=TpbTlxh+zbFhIBbQjDjRjCa3gmfg/qhJ7UgSvpnOeTvliIEf/Ro01xylmVO/cw5QGe IzLNNySGchnTmCdgnv7L6Eb8uNlDmo53cHsKthwf1f1iDGS5516/D7GQ4hE4txyztOI8 WzBUe0IwYXEHUmrXCi007paD0WtmCJZ7ANkCBObzeGV+Q3s/3PtboFNxuKqDrYFhp7gQ D8/i4pestbuO4qRCi7pdKsBWpwwBmiVqIDzn6tbrxNZ/1upsisP9ZZnpodc32j+UNZJs 5CW1GF183byMKsyc8aa8qMUpIqUvaAZOde7/BqwYwZIuDVwAo1uvx39bo/nTNqKks+IP 9ksQ== X-Gm-Message-State: AOAM532rauyx5sON5SUu47f6EuBtoz7N4kgyDwcOTSjLd2P7m7JEGKvc Duo46NjLGJRbGaB72U91d0wSomNPwngwdw== X-Received: by 2002:a17:902:ce8d:b0:149:5e3c:34f2 with SMTP id f13-20020a170902ce8d00b001495e3c34f2mr56759836plg.147.1641509860177; Thu, 06 Jan 2022 14:57:40 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id rj6sm5774687pjb.50.2022.01.06.14.57.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 14:57:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/4] linux-user: Do not special-case NULL for PR_GET_PDEATHSIG Date: Thu, 6 Jan 2022 14:57:35 -0800 Message-Id: <20220106225738.103012-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220106225738.103012-1-richard.henderson@linaro.org> References: <20220106225738.103012-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62f (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The kernel does not special-case arg2 != NULL, so neither should we. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ce9d64896c..e8f9e0643e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6444,7 +6444,7 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2, int deathsig; ret = get_errno(prctl(PR_GET_PDEATHSIG, &deathsig, arg3, arg4, arg5)); - if (!is_error(ret) && arg2 && put_user_s32(deathsig, arg2)) { + if (!is_error(ret) && put_user_s32(deathsig, arg2)) { return -TARGET_EFAULT; } return ret; From patchwork Thu Jan 6 22:57:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 530355 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp1577123imp; Thu, 6 Jan 2022 14:58:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5cbAwTrtSNFiuf0Da6WmGf86eeAZgi+LitsY34cNQ/r57YqixJS7UGD1SgMD7AMlVEqil X-Received: by 2002:a25:5582:: with SMTP id j124mr78032253ybb.366.1641509914800; Thu, 06 Jan 2022 14:58:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641509914; cv=none; d=google.com; s=arc-20160816; b=ftHnVclhezYu2riK2+/bi+K52SNITIaFC30NgBgySNiLsetgK2Lb2DgWDH4jav4S6C j25bCozGos7CGIb+oM1gstFN/vPczmrTAQF/YUg3ttpBDjnBA1WQDhxHkUy5y1dubx1X L1yVxYeHyifaj5m6q1D+bjxWyJmWhf8F29nwF/9bqHFOM7pvxGFR9lI1buSiEu/cTyCG 44BqhO9W24N5RkYgpMzqARyMa/dmDyaZ10nTb6BEjIFc7gXWJgQJVe9r1h89ZgsWFm/u tkV6+ky80uQ9UwgNGqu9BuH+M4+/y3KdCB7Jjd8GNjwZ4r/rV9LIcoMQn2f4P85nMnSU /gTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=FPLXcVJRKIkGZiLXyE9cylyg96r5/ouMmhNjrQoRrLM=; b=DGz7PDsYmIydjZOqhzkF0i5Hs1WxMvZgVEzdPiVYHUWKJBJ8SQzQ5+YFCMQuO8Mq6U Brpebq+n06tW2k5gDI1E7Sg7HAfigs4aFGx+xntpAfSN2va/Sgdz5g1nOVSR2uzfQTa/ 2rf7CqP9mLhNXGdjZvotI3meGjZG8U9No/l/G5GVivMVXMlq3BmD9nsTUX8yNRJJaZSr 1yCXtdOtSqLiusY9GaUiYTRr+6zhmPsT0gKVZA7F9IIF7T2NbG1DGl6lIkdRgZxNk53y PoeGMiVYwUdkAedItSCk7b/qDuhahg8/foZCd7VV5onFOanCEdNKBqbtYwq+mDQl+jOO lQMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MJ4hV+oe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f189si2867594ybg.11.2022.01.06.14.58.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Jan 2022 14:58:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MJ4hV+oe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5biM-00052E-Ay for patch@linaro.org; Thu, 06 Jan 2022 17:58:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5bhY-000519-7Z for qemu-devel@nongnu.org; Thu, 06 Jan 2022 17:57:44 -0500 Received: from [2607:f8b0:4864:20::42a] (port=40600 helo=mail-pf1-x42a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5bhV-0000Gh-Vs for qemu-devel@nongnu.org; Thu, 06 Jan 2022 17:57:43 -0500 Received: by mail-pf1-x42a.google.com with SMTP id q3so3687397pfs.7 for ; Thu, 06 Jan 2022 14:57:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FPLXcVJRKIkGZiLXyE9cylyg96r5/ouMmhNjrQoRrLM=; b=MJ4hV+oeiiLSEGqzHXl7gyzqFZIfssEFmQBwN0Cy4fJjJFBP/Cp2VrCcdTS+epbuaA 6FBUYOiO2ugSUjUx92mBCi6hSSGLzttZ7WR154lyji33WWdTkpX0+txGdch2r9UQL4aC wAIYzAZJ+Mi1H9F4+XStlBjF45SW/5mtWd09hKhQSShZ+p/q6tl4gsVsgpS6t32toEme sfP5KnkwRcZohUS3dOzJsYi+CjQu/W0FkAmwhxsP4g6ipATbM0uzLQYPdrutjCJuR/0a +uaBWmnQx1mm0lyoRzCmh4WE4glllr8qOpueOTPkxiIZ9nODdAbi0W5sDlzuPY6X3jNh 4TuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FPLXcVJRKIkGZiLXyE9cylyg96r5/ouMmhNjrQoRrLM=; b=F7ZfgwMc8MqiZwAQIGbrN3IEiO0iCG5sbdxo6owE9gxmBDjyzbygUMdR/vqKM8xmwF NKRaSl0YOPf4hxl9hgLp2/TJXP6dGL37w3PCXcD+bIqL2MBrunXEe8Azn7wRBAFnNQqM HjOm5hsH3z9MjokR7MTOvtT+h6hoZ746b4Yn/jpsVAIwDyGoisIMuXnVgUvOAZuUgtHr tZgFuEdrmw2p48DjgAZUT5y9BNN2bWmAVKqll/n2xqtldLoGd3LuZ23N7B0smI83LQh2 YK8e9koz0sMVnf/r1e8+UXSOnRXQwcmbALwa58ssPgPlF6leyrQFEW0+JzxXy4EGglmL IR+A== X-Gm-Message-State: AOAM533IYl3nXycAm1PwksvPu9G2kZUaK/+ScXlzFWMEKHKQS23Xfj3r bywe0sRCF2wzz7vaPMRFcTIvGLErglkTaw== X-Received: by 2002:a05:6a00:22c3:b0:4ba:f0a1:a9b6 with SMTP id f3-20020a056a0022c300b004baf0a1a9b6mr62136035pfj.36.1641509860766; Thu, 06 Jan 2022 14:57:40 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id rj6sm5774687pjb.50.2022.01.06.14.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 14:57:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/4] linux-user: Map signal number in PR_GET_PDEATHSIG Date: Thu, 6 Jan 2022 14:57:36 -0800 Message-Id: <20220106225738.103012-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220106225738.103012-1-richard.henderson@linaro.org> References: <20220106225738.103012-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::42a (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Convert the host signal number to guest signal number before returning the value to the guest. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- linux-user/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index e8f9e0643e..9eb2fb2bb2 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6444,7 +6444,8 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2, int deathsig; ret = get_errno(prctl(PR_GET_PDEATHSIG, &deathsig, arg3, arg4, arg5)); - if (!is_error(ret) && put_user_s32(deathsig, arg2)) { + if (!is_error(ret) && + put_user_s32(host_to_target_signal(deathsig), arg2)) { return -TARGET_EFAULT; } return ret; From patchwork Thu Jan 6 22:57:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 530356 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp1577127imp; Thu, 6 Jan 2022 14:58:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzklDozhy6DX9RoPgDBOdiYGfOvQQQj6mVjI/b7oG49zwvhQTGSoMkxdOrkd9kXuzof51tH X-Received: by 2002:a25:90a:: with SMTP id 10mr62044854ybj.407.1641509915083; Thu, 06 Jan 2022 14:58:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641509915; cv=none; d=google.com; s=arc-20160816; b=WSa0e/ykukGqUzm9PkPEA++HBY2eCrjrN/yX5K0hJUeLLssCWFaEdbRP1iZGd7YOB4 DqWGtqjSWZrcFLm8NMCJSGv2oWRcRVc5BgykLA+13n1LF/Sfy5dReeIehzMOd12VvWvj m3jnk4nkUMxGIAB3dYBikvnXNpinDNW62gxiQCiP4pIBJPAWwOWYi0dU5MqB/0C6Wk48 9b96o5DdCW0ZCeYUgqYkOKYwAJLbnijt2h2ErgnpYqydP02o6LXJbb+/NSiLgLeetTUO alGphEhDD03nysvrBp0JuK3QMtrm6MUkTkCbu9i+6a/I0lN+MaKfeeJKiVcm+2sMQiCy KxzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=59sTGIBhkZUxdVU/3Jb3/NHZMJKwGa7GltMG/ts6cC0=; b=GeKEEpE1e9YhOVHOf6XudFqALdosA3Th/nv46MgJe3zUQtDygikBEFcuXTUURHDrkJ H52gDHnu9+Qv28C6tD5gr6baxAoDYEq9XuMzVHJXzM0EFYpBECiQhBjSHeW54kjul9zg kaJCQPoOaueVxO3mxjEWvSZ+I8DqlvXwzsmv9FrkVyqXQ6nznjEDv1CDCyDAMdTBPc+t R417YapJXv+o0WW3/iTc2HQ1z7kJtDmtei17YJRvigE/V/jXZU0f2xgfUqTEAqrfsR42 su2Wk08EVNYEgZupvbzLcyUqqRIn0CF0zgrEgXZZXhQfYWk5HlZhYA9kxHvoraktlwFB 6gZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PLsZ1cv6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s7si3979174ybu.142.2022.01.06.14.58.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Jan 2022 14:58:35 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PLsZ1cv6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5biM-00051k-Jr for patch@linaro.org; Thu, 06 Jan 2022 17:58:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5bhY-00051A-AK for qemu-devel@nongnu.org; Thu, 06 Jan 2022 17:57:44 -0500 Received: from [2607:f8b0:4864:20::102c] (port=35450 helo=mail-pj1-x102c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5bhW-0000Gm-Ij for qemu-devel@nongnu.org; Thu, 06 Jan 2022 17:57:43 -0500 Received: by mail-pj1-x102c.google.com with SMTP id r16-20020a17090a0ad000b001b276aa3aabso10222582pje.0 for ; Thu, 06 Jan 2022 14:57:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=59sTGIBhkZUxdVU/3Jb3/NHZMJKwGa7GltMG/ts6cC0=; b=PLsZ1cv6BZMZLOI2grfrooPyO7FcScA4NoQl9ITpqc9S0v+pk2VfHoYVG3u37xfXeu S7Y8w0QMEbf9XaRMt/gQjVRU/BtkemNEN4a1ygtCWaExRPOXlMWPOLLKNlMe8QMe+JLZ ym1ZoZtlc8vX7bB04yyyhvkfWKnW8jg589wKpCJnzclu1KTFfQc7Q/JwKCBRCEYB+flW zLCOWU/0hEHao1rrrHc7Q1oJhoSWQ3E7rCSeQ6dVWoy02hMG+UOawY35iCrvBxPv2M+8 nSfCRKG2YnCjEqBsockSAF8KVQzMiJaSo0+Mtn/ZCe0ScBgZeh0fxI35Zsi2GShyRpEW kSvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=59sTGIBhkZUxdVU/3Jb3/NHZMJKwGa7GltMG/ts6cC0=; b=B+zUqnKoXXtk6TskfM/ru1uVp5l5kDBl3MU8tDZzRHtKLDTBLAmVUvw9Z5Iz92ctYo 2lHG/W4VNElNJKp1f/UqhPg1LEgFRGc37S6ceZdiOM8v6cwMjHrECOavLb7nCMw2LpAx h30iupKQDrzqtiI7CnPpCFKC4OTg3xxEB2V5vqHdnHlmes1IUAqdZuJU2mw4+g+VrWOn 9noAI8U/XduUkTE2zHK3GWnDbuSFpOmM24EMd8IKIuQKaqzhTmxlugpZL1hiaB5UZ24P kAz9+ddGxo2B0nGNnVwrTNppXjWvsdms5DcyzVpBismWbXBEgemlFdCoDghWYhb3Splo LEmQ== X-Gm-Message-State: AOAM5310+IDaV79rxVlUjo+tZvN5cSpTtEsnAN17n2r4dp42sMHbtGTE x7hr/f7U9SSYPiJnVi8FkX1iJQC/mqzn0Q== X-Received: by 2002:a17:902:7146:b0:149:537e:e35e with SMTP id u6-20020a170902714600b00149537ee35emr59780119plm.55.1641509861285; Thu, 06 Jan 2022 14:57:41 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id rj6sm5774687pjb.50.2022.01.06.14.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 14:57:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 3/4] linux-user: Implement PR_SET_PDEATHSIG Date: Thu, 6 Jan 2022 14:57:37 -0800 Message-Id: <20220106225738.103012-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220106225738.103012-1-richard.henderson@linaro.org> References: <20220106225738.103012-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102c (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9eb2fb2bb2..8495f5e08e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6450,6 +6450,9 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2, } return ret; } + case PR_SET_PDEATHSIG: + return get_errno(prctl(PR_SET_PDEATHSIG, target_to_host_signal(arg2), + arg3, arg4, arg5)); case PR_GET_NAME: { void *name = lock_user(VERIFY_WRITE, arg2, 16, 1); From patchwork Thu Jan 6 22:57:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 530357 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp1578744imp; Thu, 6 Jan 2022 15:01:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/7U7TdviqdvDoNuMhIDtJTtZJOyrNKEksZqQ2CWSBPaxZ43sMj8Yzvom9bhINqYUfY2AX X-Received: by 2002:a05:6638:ccd:: with SMTP id e13mr20137952jak.7.1641510063876; Thu, 06 Jan 2022 15:01:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641510063; cv=none; d=google.com; s=arc-20160816; b=aLlQZAMIzNTqK4M7ZAlYrzXy5WMtyujIsdh4rQLsyfk821SAnNEuq3ECTIL6u5BCbS K5iQGlsR3r2Onr8YCPtySs/PypnclJVTbmMZvyK6zGKWQs2B5A9p8Ut4RG/HEDFm+MZy cNgsBuYZ31LRx7jWGyM6OTkCsFrUj3YefceiLDLGjJ2eiOkUXqkQmRaZBybMAM+stwrJ zSvfdVaFCougVOmU2MqJO4Qjvy7juMzPHJY83ouL4wdqsIc+QTdqHGT2LjGl3IPthBiF wu3DIw+sWg+T/yvkTKEEznBRMyRckf76Zq+1Xf95vlqp3ih7nLoyDPACmvHaoy+74ctx IGWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=RKNFvbhviu9dunAjijjleYy70Vtx5VjKsvJ12r8S+Og=; b=FaddnqlifW+yavPpaCyrlPk9WfZTvAZY3lhc1wemSe+7CB5fY3Tl3nmt3ZHCVCSHGC GmDFQkqYaV2xnGodsq2jkMznZlQ46jOMYHxccO161lB8rMVU/FyOcnmogdCcUj1+liJT eEb8GtZVjeGiEuSmukLFl8DlzyKIkhkEu5vESnXmfMX7Z0NZZLQJ83RV9zH2hmr379h4 TuMHTk4U3lsdZmjtbJlaNvw37Ku2Sv4V63y+ba0VgintfbmAFFxzzfdk38sXA6ufTIEe 0HOy8ayubvc0JmBuxqkSmu/KKlXYra3uq2tmP1xGmzSjD9ac9l+jNDyNzrX2aBZ4jL0T bQCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ilcGtGPn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x15si1967654ilu.172.2022.01.06.15.01.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Jan 2022 15:01:03 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ilcGtGPn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5bkl-0000lb-Dt for patch@linaro.org; Thu, 06 Jan 2022 18:01:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5bhj-00055X-9h for qemu-devel@nongnu.org; Thu, 06 Jan 2022 17:57:55 -0500 Received: from [2607:f8b0:4864:20::42f] (port=43951 helo=mail-pf1-x42f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5bhX-0000HR-5n for qemu-devel@nongnu.org; Thu, 06 Jan 2022 17:57:44 -0500 Received: by mail-pf1-x42f.google.com with SMTP id 196so3677872pfw.10 for ; Thu, 06 Jan 2022 14:57:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RKNFvbhviu9dunAjijjleYy70Vtx5VjKsvJ12r8S+Og=; b=ilcGtGPngjgZy3FnhQE9tp8+imvBr9PjsjOPuFbagSsLqo+AU8J/eykxlNo5+N3Vpm dEtjaM5CMRwwP3vM5ZtoB5e5cvvDFUUfGaLB+TTa/c5sz+/g1rKsG1dOUUcubbXpiex6 QDhFIbFqs6EBXDhvcbTeHblA8QcPFv1DpI/teBdujk1BndnrX4tnKXYnsCWcfJXtwRAN 28UhBe4bVc5lDcPaybzmiM4/pWYb8+UycrR7QPuShTSnfj4mmEPNzSNA9FCi3sYfa9Nj Jyy5p/kMcEUf5+cNx+lb5dwZOLOI1snUFCegAEJa7S78J33NoFMt/bwtFdK1NtIL+ogR G5lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RKNFvbhviu9dunAjijjleYy70Vtx5VjKsvJ12r8S+Og=; b=F3qlTvZ6p1IPW8qxNaILZd5RbBl3IPZAuzJg2DB20fZ4WU0F4URTqe/YxtyT3Q+HYX 2HCmUG8znuJ1EvvMbQigOVfGiz9USnOG4LxtQH3Gh8EiOiNhIy/Xq9JJt1xgkYqbC4bJ vbyULBHKXhkzyaVlL/5UseHaTNiBaSNmrSKHuLBnvLJztmiFKoYrj3JEDBJpUvVrksPu Qg6JiHCansCH0UPtSwqlP09SSYLm262XPlCssoYsCR7itAwAMHNjz4w10TQEBURcHJkj //nRymX85Mky4vA7RrPVN7MHw3B0ASddfooHIOFUdkT7dm7tR9RwRUesmmqLh0okhpfg k7RA== X-Gm-Message-State: AOAM530IaFBHOa0C3YrD9vqwKt9UNeq579cSiuaagJEVWIdmLUjYcctM D2nVWYpnbKqPSUIe5zwwpx9ZagX1IE2a/g== X-Received: by 2002:aa7:91c2:0:b0:4bc:6c97:401 with SMTP id z2-20020aa791c2000000b004bc6c970401mr30914277pfa.17.1641509861899; Thu, 06 Jan 2022 14:57:41 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id rj6sm5774687pjb.50.2022.01.06.14.57.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 14:57:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 4/4] linux-user: Implement capability prctls Date: Thu, 6 Jan 2022 14:57:38 -0800 Message-Id: <20220106225738.103012-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220106225738.103012-1-richard.henderson@linaro.org> References: <20220106225738.103012-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::42f (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is PR_CAPBSET_READ, PR_CAPBSET_DROP and the "legacy" PR_CAP_AMBIENT PR_GET_SECUREBITS, PR_SET_SECUREBITS. All of these arguments are integer values only, and do not require mapping of values between host and guest. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 8495f5e08e..4711afaf8c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6504,10 +6504,15 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2, case PR_SET_UNALIGN: return do_prctl_set_unalign(env, arg2); + case PR_CAP_AMBIENT: + case PR_CAPBSET_READ: + case PR_CAPBSET_DROP: case PR_GET_DUMPABLE: case PR_SET_DUMPABLE: case PR_GET_KEEPCAPS: case PR_SET_KEEPCAPS: + case PR_GET_SECUREBITS: + case PR_SET_SECUREBITS: case PR_GET_TIMING: case PR_SET_TIMING: case PR_GET_TIMERSLACK: