From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29505C433B4 for ; Tue, 6 Apr 2021 14:44:06 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BDAE4613C0 for ; Tue, 6 Apr 2021 14:44:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BDAE4613C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=tachyum.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTmw0-0002zq-TR for qemu-devel@archiver.kernel.org; Tue, 06 Apr 2021 10:44:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTmuS-0001js-Ni for qemu-devel@nongnu.org; Tue, 06 Apr 2021 10:42:28 -0400 Received: from mx1.tachyum.com ([66.160.133.170]:48927) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTmuQ-0002QJ-E3 for qemu-devel@nongnu.org; Tue, 06 Apr 2021 10:42:28 -0400 Received: by mx1.tachyum.com (Postfix, from userid 1000) id 6E11410056EF; Tue, 6 Apr 2021 07:42:23 -0700 (PDT) Received: from tsk-dev-sw-mkysel.tachyum.sk (tsk-fw1.tachyum.sk [93.184.71.90]) by mx1.tachyum.com (Postfix) with ESMTP id C55F91005684; Tue, 6 Apr 2021 07:42:21 -0700 (PDT) From: Matus Kysel To: Subject: [PATCH v2] linux-user: strace now handles unshare syscall args correctly Date: Tue, 6 Apr 2021 14:42:03 +0000 Message-Id: <20210406144203.1020598-1-mkysel@tachyum.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=66.160.133.170; envelope-from=mkysel@tachyum.com; helo=mx1.tachyum.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:All patches CC here" , Laurent Vivier , Matus Kysel Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Syscall unshare did not have custom print function for strace, but it's argument is same as flags in clone syscall, so it can be easily implemented. Also updated missing flags from clone_flags. Signed-off-by: Matus Kysel --- linux-user/strace.c | 18 ++++++++++++++++++ linux-user/strace.list | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index e969121b6c..1cadb6d50f 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1109,6 +1109,12 @@ UNUSED static struct flags clone_flags[] = { #if defined(CLONE_NEWNET) FLAG_GENERIC(CLONE_NEWNET), #endif +#if defined(CLONE_NEWCGROUP) + FLAG_GENERIC(CLONE_NEWCGROUP), +#endif +#if defined(CLONE_NEWTIME) + FLAG_GENERIC(CLONE_NEWTIME), +#endif #if defined(CLONE_IO) FLAG_GENERIC(CLONE_IO), #endif @@ -3467,6 +3473,18 @@ print_unlinkat(void *cpu_env, const struct syscallname *name, } #endif +#ifdef TARGET_NR_unshare +static void +print_unshare(void *cpu_env, const struct syscallname *name, + abi_long arg0, abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4, abi_long arg5) +{ + print_syscall_prologue(name); + print_flags(clone_flags, arg0, 1); + print_syscall_epilogue(name); +} +#endif + #ifdef TARGET_NR_utime static void print_utime(void *cpu_env, const struct syscallname *name, diff --git a/linux-user/strace.list b/linux-user/strace.list index 084048ab96..3b7c15578c 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1573,7 +1573,7 @@ { TARGET_NR_unlinkat, "unlinkat" , NULL, print_unlinkat, NULL }, #endif #ifdef TARGET_NR_unshare -{ TARGET_NR_unshare, "unshare" , NULL, NULL, NULL }, +{ TARGET_NR_unshare, "unshare" , NULL, print_unshare, NULL }, #endif #ifdef TARGET_NR_userfaultfd { TARGET_NR_userfaultfd, "userfaultfd" , NULL, NULL, NULL }, -- 2.25.1