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: 927271 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="OrWHrRUq"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 413Mbg32Jkz9s1R for ; Sun, 10 Jun 2018 13:49:51 +1000 (AEST) Received: from localhost ([::1]:42431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRrMS-0001nq-Dg for incoming@patchwork.ozlabs.org; Sat, 09 Jun 2018 23:49:48 -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-Google-Smtp-Source: ADUXVKKR9OlDL/0M5T7/hC+2DKkVduJigauAldF5AaunZ87yre3BUNGmkIn/QcDzaMAWMIiYKdFzNQ== 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- linux-user/syscall.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) 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