Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 0/3] shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode
@ 2026-09-24 11:25 Petr Vorel
  2026-09-24 11:25 ` [LTP] [PATCH v2 1/3] tst_assert: Use 'long long' to fix 32bit compat mode truncation Petr Vorel
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Petr Vorel @ 2026-09-24 11:25 UTC (permalink / raw)
  To: ltp

1st and 2nd commit are pre-release fixes.
NOTE: 3rd commit can be postponed after the release.

Changes v1->v2:
* PATH_KERN_SHMMAX >= INT_MAX check (Cyril)
* General test cleanup in the 3rd commit

Link to v2:
https://patchwork.kernel.org/project/ltp/list/?series=1168638&state=*
https://lore.kernel.org/ltp/20260918125021.1939455-1-pvorel@suse.cz/T/#t

Kind regards,
Petr

Andrea Cervesato (2):
  tst_assert: Use 'long long' to fix 32bit compat mode truncation
  shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode

Petr Vorel (1):
  shmctl03: Use safe_shmctl(), TST_EXP_LE_LU()

 lib/tst_assert.c                            |  9 ++++----
 testcases/kernel/syscalls/shmctl/shmctl03.c | 24 ++++++++++-----------
 2 files changed, 16 insertions(+), 17 deletions(-)

-- 
2.55.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [LTP] [PATCH v2 1/3] tst_assert: Use 'long long' to fix 32bit compat mode truncation
  2026-09-24 11:25 [LTP] [PATCH v2 0/3] shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode Petr Vorel
@ 2026-09-24 11:25 ` Petr Vorel
  2026-09-24 13:24   ` [LTP] " linuxtestproject.agent
  2026-09-24 11:25 ` [LTP] [PATCH v2 2/3] shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode Petr Vorel
  2026-09-24 11:25 ` [LTP] [PATCH v2 3/3] shmctl03: Use safe_shmctl(), TST_EXP_LE_LU() Petr Vorel
  2 siblings, 1 reply; 8+ messages in thread
From: Petr Vorel @ 2026-09-24 11:25 UTC (permalink / raw)
  To: ltp

From: Andrea Cervesato <andrea.cervesato@suse.com>

Using 'long long' in tst_assert_ulong() correctly verifies values on
32bit compat mode truncation.

This fixes failure of shmctl03.c on /proc/sys/kernel/shmall on 32bit
(potentially on other sysfs files).

Reported-by: Wei Gao <wegao@suse.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
[ pvorel: separate into its own commit, write the commit message ]
Co-developed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/tst_assert.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/tst_assert.c b/lib/tst_assert.c
index b68bd5d397..5a4896ac52 100644
--- a/lib/tst_assert.c
+++ b/lib/tst_assert.c
@@ -25,16 +25,17 @@ void tst_assert_int(const char *file, const int lineno, const char *path, int va
 
 void tst_assert_ulong(const char *file, const int lineno, const char *path, unsigned long val)
 {
-	unsigned long sys_val;
+	unsigned long long sys_val;
 
-	safe_file_scanf(file, lineno, NULL, path, "%lu", &sys_val);
+	safe_file_scanf(file, lineno, NULL, path, "%llu", &sys_val);
 
-	if (val == sys_val) {
+	if (val == (unsigned long)sys_val) {
 		tst_res_(file, lineno, TPASS, "%s = %lu", path, val);
 		return;
 	}
 
-	tst_res_(file, lineno, TFAIL, "%s != %lu got %lu", path, val, sys_val);
+	tst_res_(file, lineno, TFAIL, "%s != %lu got %lu",
+		path, val, (unsigned long)sys_val);
 }
 
 void tst_assert_file_int(const char *file, const int lineno, const char *path, const char *prefix, int val)
-- 
2.55.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [LTP] [PATCH v2 2/3] shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode
  2026-09-24 11:25 [LTP] [PATCH v2 0/3] shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode Petr Vorel
  2026-09-24 11:25 ` [LTP] [PATCH v2 1/3] tst_assert: Use 'long long' to fix 32bit compat mode truncation Petr Vorel
@ 2026-09-24 11:25 ` Petr Vorel
  2026-09-24 11:25 ` [LTP] [PATCH v2 3/3] shmctl03: Use safe_shmctl(), TST_EXP_LE_LU() Petr Vorel
  2 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2026-09-24 11:25 UTC (permalink / raw)
  To: ltp

From: Andrea Cervesato <andrea.cervesato@suse.com>

Kernel clamped /proc/sys/kernel/shmmax in 32bit compat mode
to INT_MAX due change in kernel v2.6.22 in commit
af7c693f14606 ("Cap shmmax at INT_MAX in compat shminfo").
Reflect that.

Reported-by: Wei Gao <wegao@suse.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
[ pvorel: check PATH_KERN_SHMMAX >= INT_MAX, separate into its own
commit, write the commit message ]
Co-developed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/shmctl/shmctl03.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/shmctl/shmctl03.c b/testcases/kernel/syscalls/shmctl/shmctl03.c
index 9e1c2f0990..0a4e27ce98 100644
--- a/testcases/kernel/syscalls/shmctl/shmctl03.c
+++ b/testcases/kernel/syscalls/shmctl/shmctl03.c
@@ -30,7 +30,14 @@ static void verify_ipcinfo(void)
 	else
 		tst_res(TPASS, "shmmin = 1");
 
-	TST_ASSERT_ULONG(PATH_KERN_SHMMAX, info.shmmax);
+	if (tst_is_compat_mode() && info.shmmax == INT_MAX) {
+		unsigned long long shmmax;
+		SAFE_FILE_SCANF(PATH_KERN_SHMMAX, "%llu", &shmmax);
+		TST_EXP_LE_LU(INT_MAX, shmmax);
+	} else {
+		TST_ASSERT_ULONG(PATH_KERN_SHMMAX, info.shmmax);
+	}
+
 	TST_ASSERT_ULONG(PATH_KERN_SHMMNI, info.shmmni);
 	TST_ASSERT_ULONG(PATH_KERN_SHMALL, info.shmall);
 }
-- 
2.55.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [LTP] [PATCH v2 3/3] shmctl03: Use safe_shmctl(), TST_EXP_LE_LU()
  2026-09-24 11:25 [LTP] [PATCH v2 0/3] shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode Petr Vorel
  2026-09-24 11:25 ` [LTP] [PATCH v2 1/3] tst_assert: Use 'long long' to fix 32bit compat mode truncation Petr Vorel
  2026-09-24 11:25 ` [LTP] [PATCH v2 2/3] shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode Petr Vorel
@ 2026-09-24 11:25 ` Petr Vorel
  2026-09-25  6:49   ` Petr Vorel
  2 siblings, 1 reply; 8+ messages in thread
From: Petr Vorel @ 2026-09-24 11:25 UTC (permalink / raw)
  To: ltp

Shorten code with safe function and test macro.
Link manpage.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
NOTE: it can be postponed after the release.

 testcases/kernel/syscalls/shmctl/shmctl03.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/testcases/kernel/syscalls/shmctl/shmctl03.c b/testcases/kernel/syscalls/shmctl/shmctl03.c
index 0a4e27ce98..46ab989b10 100644
--- a/testcases/kernel/syscalls/shmctl/shmctl03.c
+++ b/testcases/kernel/syscalls/shmctl/shmctl03.c
@@ -1,11 +1,12 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020 Cyril Hrubis <chrubis@suse.cz>
+ * Copyright (c) Linux Test Project, 2026
  */
 
 /*\
- * Call shmctl() with IPC_INFO flag and check that the data are consistent with
- * /proc/sys/kernel/shm*.
+ * Call :manpage:`shmctl(2)` with IPC_INFO flag and check that the data are
+ * consistent with /proc/sys/kernel/shm*.
  */
 
 #define _GNU_SOURCE
@@ -17,18 +18,8 @@ static void verify_ipcinfo(void)
 {
 	struct shminfo info;
 
-	TEST(shmctl(0, IPC_INFO, (struct shmid_ds *)&info));
-
-	if (TST_RET < 0) {
-		tst_res(TFAIL | TTERRNO,
-			"shmctl(0, IPC_INFO, ...) returned %li", TST_RET);
-		return;
-	}
-
-	if (info.shmmin != 1)
-		tst_res(TFAIL, "shmmin = %li, expected 1", info.shmmin);
-	else
-		tst_res(TPASS, "shmmin = 1");
+	safe_shmctl(__FILE__, __LINE__, 0, IPC_INFO, ((struct shmid_ds *)&info));
+	TST_EXP_LE_LU(info.shmmin, 1);
 
 	if (tst_is_compat_mode() && info.shmmax == INT_MAX) {
 		unsigned long long shmmax;
-- 
2.55.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [LTP] tst_assert: Use 'long long' to fix 32bit compat mode truncation
  2026-09-24 11:25 ` [LTP] [PATCH v2 1/3] tst_assert: Use 'long long' to fix 32bit compat mode truncation Petr Vorel
@ 2026-09-24 13:24   ` linuxtestproject.agent
  2026-09-25  6:55     ` Petr Vorel
  2026-09-25  8:01     ` [LTP] [RFC] " Petr Vorel
  0 siblings, 2 replies; 8+ messages in thread
From: linuxtestproject.agent @ 2026-09-24 13:24 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi Andrea,

On Thu, 24 Sep 2026 13:25:12 +0200, Andrea Cervesato wrote:
> [PATCH 1/3] tst_assert: Use 'long long' to fix 32bit compat mode truncation

--- [PATCH 1/3] ---

> @@ -25,16 +25,17 @@ void tst_assert_int(const char *file, const int lineno, const char *path, int va
>  
>  void tst_assert_ulong(const char *file, const int lineno, const char *path, unsigned long val)
>  {
> -	unsigned long sys_val;
> +	unsigned long long sys_val;
>  
> -	safe_file_scanf(file, lineno, NULL, path, "%lu", &sys_val);
> +	safe_file_scanf(file, lineno, NULL, path, "%llu", &sys_val);
>  
> -	if (val == sys_val) {
> +	if (val == (unsigned long)sys_val) {
>  		tst_res_(file, lineno, TPASS, "%s = %lu", path, val);
>  		return;
>  	}
>  
> -	tst_res_(file, lineno, TFAIL, "%s != %lu got %lu", path, val, sys_val);
> +	tst_res_(file, lineno, TFAIL, "%s != %lu got %lu",
> +		path, val, (unsigned long)sys_val);
>  }

Casting sys_val to (unsigned long) truncates values exceeding ULONG_MAX on
32-bit systems, causing false passes when (sys_val & 0xFFFFFFFF) == val and
printing a truncated value on failure. Compare values without truncation
using (unsigned long long)val == sys_val, and print sys_val with %llu on
mismatch. Handling of 32-bit compat truncation for /proc/sys/kernel/shmall
should be done in shmctl03.c instead of altering generic library assertions.

--- [PATCH 2/3] ---

> @@ -30,7 +30,14 @@ static void verify_ipcinfo(void)
>  	else
>  		tst_res(TPASS, "shmmin = 1");
>  
> -	TST_ASSERT_ULONG(PATH_KERN_SHMMAX, info.shmmax);
> +	if (tst_is_compat_mode() && info.shmmax == INT_MAX) {
> +		unsigned long long shmmax;
> +		SAFE_FILE_SCANF(PATH_KERN_SHMMAX, "%llu", &shmmax);
> +		TST_EXP_LE_LU(INT_MAX, shmmax);
> +	} else {
> +		TST_ASSERT_ULONG(PATH_KERN_SHMMAX, info.shmmax);
> +	}
> +

Branching on info.shmmax == INT_MAX conditions on the result of the syscall
under test, and TST_EXP_LE_LU(INT_MAX, shmmax) only asserts that the sysctl
file is >= INT_MAX rather than verifying that info.shmmax was clamped.
Read PATH_KERN_SHMMAX into shmmax first, and if in compat mode with
shmmax >= INT_MAX, assert TST_EXP_EQ_LU(info.shmmax, (unsigned long)INT_MAX);
otherwise assert info.shmmax == shmmax.

--- [PATCH 3/3] ---

> +	safe_shmctl(__FILE__, __LINE__, 0, IPC_INFO, ((struct shmid_ds *)&info));

Because shmctl() is the syscall under test, replacing TEST(shmctl(...)) with
safe_shmctl() turns a syscall failure into TBROK instead of TFAIL. In
addition, tests must not call safe_*() functions directly. Keep
TEST(shmctl(...)) or use TST_EXP_PASS(shmctl(0, IPC_INFO, ...)).

> +	TST_EXP_LE_LU(info.shmmin, 1);

TST_EXP_LE_LU() checks info.shmmin <= 1, which incorrectly allows 0 to pass.
The kernel SHMMIN constant is 1 and requires equality. Use
TST_EXP_EQ_LU(info.shmmin, 1).

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH v2 3/3] shmctl03: Use safe_shmctl(), TST_EXP_LE_LU()
  2026-09-24 11:25 ` [LTP] [PATCH v2 3/3] shmctl03: Use safe_shmctl(), TST_EXP_LE_LU() Petr Vorel
@ 2026-09-25  6:49   ` Petr Vorel
  0 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2026-09-25  6:49 UTC (permalink / raw)
  To: ltp

Hi,

...

> -	if (info.shmmin != 1)
> -		tst_res(TFAIL, "shmmin = %li, expected 1", info.shmmin);
> -	else
> -		tst_res(TPASS, "shmmin = 1");
> +	safe_shmctl(__FILE__, __LINE__, 0, IPC_INFO, ((struct shmid_ds *)&info));
> +	TST_EXP_LE_LU(info.shmmin, 1);

Ah, TST_EXP_EQ_LU() should have been used.
Also 1st patch should probably be improved => v3.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] tst_assert: Use 'long long' to fix 32bit compat mode truncation
  2026-09-24 13:24   ` [LTP] " linuxtestproject.agent
@ 2026-09-25  6:55     ` Petr Vorel
  2026-09-25  8:01     ` [LTP] [RFC] " Petr Vorel
  1 sibling, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2026-09-25  6:55 UTC (permalink / raw)
  To: linuxtestproject.agent; +Cc: ltp

Hi all,

> Hi Andrea,

> On Thu, 24 Sep 2026 13:25:12 +0200, Andrea Cervesato wrote:
> > [PATCH 1/3] tst_assert: Use 'long long' to fix 32bit compat mode truncation

> --- [PATCH 1/3] ---

> > @@ -25,16 +25,17 @@ void tst_assert_int(const char *file, const int lineno, const char *path, int va

> >  void tst_assert_ulong(const char *file, const int lineno, const char *path, unsigned long val)
> >  {
> > -	unsigned long sys_val;
> > +	unsigned long long sys_val;

> > -	safe_file_scanf(file, lineno, NULL, path, "%lu", &sys_val);
> > +	safe_file_scanf(file, lineno, NULL, path, "%llu", &sys_val);

> > -	if (val == sys_val) {
> > +	if (val == (unsigned long)sys_val) {
> >  		tst_res_(file, lineno, TPASS, "%s = %lu", path, val);
> >  		return;
> >  	}

> > -	tst_res_(file, lineno, TFAIL, "%s != %lu got %lu", path, val, sys_val);
> > +	tst_res_(file, lineno, TFAIL, "%s != %lu got %lu",
> > +		path, val, (unsigned long)sys_val);
> >  }

> Casting sys_val to (unsigned long) truncates values exceeding ULONG_MAX on
> 32-bit systems, causing false passes when (sys_val & 0xFFFFFFFF) == val and
> printing a truncated value on failure. Compare values without truncation
> using (unsigned long long)val == sys_val, and print sys_val with %llu on
> mismatch. Handling of 32-bit compat truncation for /proc/sys/kernel/shmall
> should be done in shmctl03.c instead of altering generic library assertions.

I wonder if it's safe to ignore this.

> --- [PATCH 2/3] ---

> > @@ -30,7 +30,14 @@ static void verify_ipcinfo(void)
> >  	else
> >  		tst_res(TPASS, "shmmin = 1");

> > -	TST_ASSERT_ULONG(PATH_KERN_SHMMAX, info.shmmax);
> > +	if (tst_is_compat_mode() && info.shmmax == INT_MAX) {
> > +		unsigned long long shmmax;
> > +		SAFE_FILE_SCANF(PATH_KERN_SHMMAX, "%llu", &shmmax);
> > +		TST_EXP_LE_LU(INT_MAX, shmmax);
> > +	} else {
> > +		TST_ASSERT_ULONG(PATH_KERN_SHMMAX, info.shmmax);
> > +	}
> > +

> Branching on info.shmmax == INT_MAX conditions on the result of the syscall
> under test, and TST_EXP_LE_LU(INT_MAX, shmmax) only asserts that the sysctl
> file is >= INT_MAX rather than verifying that info.shmmax was clamped.

I wonder if it's really important to verify it was clamped.

> Read PATH_KERN_SHMMAX into shmmax first, and if in compat mode with
> shmmax >= INT_MAX, assert TST_EXP_EQ_LU(info.shmmax, (unsigned long)INT_MAX);
> otherwise assert info.shmmax == shmmax.

OK, reading it twice is not optimal.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [LTP] [RFC] tst_assert: Use 'long long' to fix 32bit compat mode truncation
  2026-09-24 13:24   ` [LTP] " linuxtestproject.agent
  2026-09-25  6:55     ` Petr Vorel
@ 2026-09-25  8:01     ` Petr Vorel
  1 sibling, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2026-09-25  8:01 UTC (permalink / raw)
  To: linuxtestproject.agent; +Cc: ltp

Hi all,

> Hi Andrea,

> On Thu, 24 Sep 2026 13:25:12 +0200, Andrea Cervesato wrote:
> > [PATCH 1/3] tst_assert: Use 'long long' to fix 32bit compat mode truncation

> --- [PATCH 1/3] ---

> > @@ -25,16 +25,17 @@ void tst_assert_int(const char *file, const int lineno, const char *path, int va

> >  void tst_assert_ulong(const char *file, const int lineno, const char *path, unsigned long val)
> >  {
> > -	unsigned long sys_val;
> > +	unsigned long long sys_val;

> > -	safe_file_scanf(file, lineno, NULL, path, "%lu", &sys_val);
> > +	safe_file_scanf(file, lineno, NULL, path, "%llu", &sys_val);

> > -	if (val == sys_val) {
> > +	if (val == (unsigned long)sys_val) {
> >  		tst_res_(file, lineno, TPASS, "%s = %lu", path, val);
nit: maybe we should print also sys_val.
> >  		return;
> >  	}

> > -	tst_res_(file, lineno, TFAIL, "%s != %lu got %lu", path, val, sys_val);
> > +	tst_res_(file, lineno, TFAIL, "%s != %lu got %lu",
> > +		path, val, (unsigned long)sys_val);
nit: and here maybe also print the raw value:
> >  }

	if (val == (unsigned long)sys_val) {
		tst_res_(file, lineno, TPASS, "%s = %lu (%llu)", path, val, sys_val);
		return;
	}

	tst_res_(file, lineno, TFAIL, "%s != %lu got %lu (%llu)",
		path, val, (unsigned long)sys_val, sys_val);

It would print sometimes unnecessary info:

shmctl03.c:26: TPASS: info.shmmin == 1 (1)
shmctl03.c:30: TPASS: INT_MAX <= shmmax (2147483647 <= 4294967295)
shmctl03.c:34: TPASS: /proc/sys/kernel/shmmni = 4096 (4096)
shmctl03.c:35: TPASS: /proc/sys/kernel/shmall = 4294967040 (1152921504606846720)

> Casting sys_val to (unsigned long) truncates values exceeding ULONG_MAX on
> 32-bit systems, causing false passes when (sys_val & 0xFFFFFFFF) == val and
> printing a truncated value on failure. Compare values without truncation
> using (unsigned long long)val == sys_val, and print sys_val with %llu on
> mismatch. Handling of 32-bit compat truncation for /proc/sys/kernel/shmall
> should be done in shmctl03.c instead of altering generic library assertions.

Hm, looking further into it, this really does a behavior change on 32 bit,
because tst_assert_ulong() now compares only the low 32 bits. E.g.
file which contains 4294967301 passes against an expected 5. I'm not really sure
we want this. If yes, it should be documented.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-09-25  8:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-24 11:25 [LTP] [PATCH v2 0/3] shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode Petr Vorel
2026-09-24 11:25 ` [LTP] [PATCH v2 1/3] tst_assert: Use 'long long' to fix 32bit compat mode truncation Petr Vorel
2026-09-24 13:24   ` [LTP] " linuxtestproject.agent
2026-09-25  6:55     ` Petr Vorel
2026-09-25  8:01     ` [LTP] [RFC] " Petr Vorel
2026-09-24 11:25 ` [LTP] [PATCH v2 2/3] shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode Petr Vorel
2026-09-24 11:25 ` [LTP] [PATCH v2 3/3] shmctl03: Use safe_shmctl(), TST_EXP_LE_LU() Petr Vorel
2026-09-25  6:49   ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox