From nobody Fri Mar 29 15:36:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1617720249; cv=none; d=zohomail.com; s=zohoarc; b=GwESKyVM9gfiLP5I4IPekAf7jPf9lwlWet2piW4EEBEezvRSIrBx/iYkWaeyjcfsXM5OpMedBV+pFU6EvVbJ52sO/uiZFUKtqkb8+mTQPWnVY906DCe1dxr3AYbhxaZI1xCHyznueyYUnbcyLp+y2+XNhcdoTerHXSpR8GWCZRQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617720249; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject; bh=IbTjTLvgMTKxMYkRkn1hJ9KGBYShWWHgOGnqfcDvFog=; b=f94R/UXjIvWpOgOecdp+/O6VJKGEa/V6/LDiPI0tqZfdH3UpnH5P9zCt2dn++MdeAJAuk1BqvbnjIdN/Qxhm023vRw0ub1igbXxP3yb4Lwj7GrefNPK1N6dwWYt61mfzUU6TAVmOBrJQ8fRc06tSERDGpJTaIAdktJYo/lzFyko= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617720249714299.26573035121555; Tue, 6 Apr 2021 07:44:09 -0700 (PDT) Received: from localhost ([::1]:57370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTmw4-0002zq-Dn for importer@patchew.org; Tue, 06 Apr 2021 10:44:08 -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: 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=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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Syscall unshare did not have custom print function for strace, but it's arg= ument 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 Reviewed-by: Laurent Vivier --- 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[] =3D { #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 syscallna= me *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