From patchwork Sun Jun 10 03:01:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 138140 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp2599377lji; Sat, 9 Jun 2018 20:49:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJb1AnOCAixH6G9mep/1UUZSVIPKMh+/i69e0ZApmtk2/B1saXzKRHjvKidtPChew6ypHrX X-Received: by 2002:a37:646:: with SMTP id 67-v6mr10071813qkg.35.1528602570170; Sat, 09 Jun 2018 20:49:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528602570; cv=none; d=google.com; s=arc-20160816; b=ozZdX2t4z39D87GUyeqfnMQfybAJjThmwLIuPsS+Q1ukw5faDTpi4ARXO/54STGhqp TZFq25exl3PRv4tfQ4WgEFp1RmkK6X0Sf+kijXIAXbgjdz6IvudcbCCmsoXA8mLW7jic 1+AFfI/GGLkPjxDNyWXt7hk6YdSoMci307rNHmfe3AzIo2RBd9+muuLSfwx7MCkSux7V iOUWtGpXkcNEsgXslzLzEjPp0OWMTbO4MR+BHDrTMFtwAxGBcMm/IBGOk5+xh5+puUpo DcNW41MJF7lfy05LJ+vqTL00Br18OK5JBoIJneSsoFjji1k0Fnr04RpPvZkyDQ9o5/Xk c7nw== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=0r7ZojhBR0H1j2YjDJ1B1Qxo+NrSeT9peX3xz5O1fqk=; b=s0jZIgUl2pusIGVbQHg+ZLg0Hif0eLUdWm9eaAgFf3gYvHFsPpiQs4G+ttIq16r36L FExMm70I7JYb7S6AWoSteIiuvug7VJIATH+uxZz4B/LWg4NCjiOh2MvyYK5sfepo60jj 5k6EOi5hiVfWh8igbQ6P7kaBvB+Z9zOk1xzdiYj/ozZp8owzyCTIKAn7jJQxEUVHHFxO 0z5Z4GiI7EZoh/GziKUx+fdC4/IY53jh0g3SCPNQARRadpKe+1Ew3hIP1KfRZWnyw82V G688QmWQCifnzhIEbAlbhLpF/3n19rE8RtNZXVO1L7uN7rszEOL3uYRSm62esCH2Mors 7+/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OrWHrRUq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u10-v6si13368089qkk.26.2018.06.09.20.49.29 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 09 Jun 2018 20:49:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OrWHrRUq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRrM9-0001nq-HH for patch@linaro.org; Sat, 09 Jun 2018 23:49:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRqfE-0003qY-9a for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:05:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRqfD-0004Kc-De for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:05:08 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:43801) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRqfD-0004KK-7u for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:05:07 -0400 Received: by mail-pf0-x241.google.com with SMTP id j20-v6so8482171pff.10 for ; Sat, 09 Jun 2018 20:05:07 -0700 (PDT) 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; bh=0r7ZojhBR0H1j2YjDJ1B1Qxo+NrSeT9peX3xz5O1fqk=; b=OrWHrRUqfL//B1tD9D505L58pKQ1uBrWCBjh9lw+OZ0bEuOE6lqqv9E9G8A8LDjRry tO0iGnV+KblrorIj55oTCjDxCZIDNfVtEx+IZmlLpWBA62FxWRD56v5AwGgLHqhRfXjg v/hud9i+NZ94sKpbI4Hzj6iq4WghV2Ktvv5mc= 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; bh=0r7ZojhBR0H1j2YjDJ1B1Qxo+NrSeT9peX3xz5O1fqk=; b=eVbU0qJp1nSDFjgsbSAIJkZ6n4ORCK1NRAD7Vk60NpD0mcNlqMHIhH3aeVJL2oSEZ4 vcmSQjagkXIBpvtzgSlpxpEMtxVilOtkbDTuqU0CDXVBnmd+b0MS0X9QnJErzBe5Ah8c ysmA8JpDKkBirOlm7sxVuaMupBWtBzSoA0bkLQIdNh6yMWGXDmvZ7LjLN5KmNwGl8+7W sNDP4wdrrC12+F5KrkeIJNUTA4XWq9J/uGPZao7zDFAUUVvo4CWGR6yZ9HLBWPARHvwS IVFIYERJq/JVgKHREJZjee+dP/8Mek2Eocb2OTGcCb8cF2JTmEM7cVTqVe/28pqPmN4g GH3g== X-Gm-Message-State: APt69E0oYRlB46YGByEaaQJVDLvC4W3nTQrjxxdfBjH8USFwGMdkoT4y NeyN6662IxlMmmGNVM5PFZldY0HoxJc= X-Received: by 2002:a63:7d4c:: with SMTP id m12-v6mr10215593pgn.201.1528599906137; Sat, 09 Jun 2018 20:05:06 -0700 (PDT) Received: from cloudburst.twiddle.net (rrcs-173-198-77-219.west.biz.rr.com. [173.198.77.219]) by smtp.gmail.com with ESMTPSA id y17-v6sm31712718pfe.33.2018.06.09.20.05.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Jun 2018 20:05:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 9 Jun 2018 17:01:48 -1000 Message-Id: <20180610030220.3777-77-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180610030220.3777-1-richard.henderson@linaro.org> References: <20180610030220.3777-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::241 Subject: [Qemu-devel] [PATCH v2 076/108] linux-user: Split out setfsgid, setfsuid, setgid, setuid X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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 --- linux-user/syscall.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index c55c414239..76a66b56fe 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -10533,6 +10533,21 @@ IMPL(setdomainname) return ret; } +IMPL(setfsgid) +{ + return get_errno(setfsgid(arg1)); +} + +IMPL(setfsuid) +{ + return get_errno(setfsuid(arg1)); +} + +IMPL(setgid) +{ + return get_errno(sys_setgid(low2highgid(arg1))); +} + IMPL(setgroups) { int gidsetsize = arg1; @@ -10668,6 +10683,11 @@ IMPL(setsid) return get_errno(setsid()); } +IMPL(setuid) +{ + return get_errno(sys_setuid(low2highuid(arg1))); +} + #ifdef TARGET_NR_sigaction IMPL(sigaction) { @@ -11594,15 +11614,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1, void *p; switch(num) { - case TARGET_NR_setuid: - return get_errno(sys_setuid(low2highuid(arg1))); - case TARGET_NR_setgid: - return get_errno(sys_setgid(low2highgid(arg1))); - case TARGET_NR_setfsuid: - return get_errno(setfsuid(arg1)); - case TARGET_NR_setfsgid: - return get_errno(setfsgid(arg1)); - #ifdef TARGET_NR_lchown32 case TARGET_NR_lchown32: if (!(p = lock_user_string(arg1))) @@ -13406,6 +13417,9 @@ static impl_fn *syscall_table(unsigned num) SYSCALL(sendto); #endif SYSCALL(setdomainname); + SYSCALL(setfsgid); + SYSCALL(setfsuid); + SYSCALL(setgid); SYSCALL(setgroups); SYSCALL(sethostname); SYSCALL(setitimer); @@ -13425,6 +13439,7 @@ static impl_fn *syscall_table(unsigned num) #endif SYSCALL(settimeofday); SYSCALL(setsid); + SYSCALL(setuid); #ifdef TARGET_NR_sigaction SYSCALL(sigaction); #endif