All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] xfrm: Skip on EOPNOTSUPP in compat mode
@ 2026-06-11  9:37 Andrea Cervesato
  2026-06-11 10:04 ` Cyril Hrubis
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Andrea Cervesato @ 2026-06-11  9:37 UTC (permalink / raw)
  To: Linux Test Project

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

A 32-bit binary running on a 64-bit kernel uses the XFRM netlink compat
layer, which is only available when CONFIG_XFRM_USER_COMPAT is enabled
(and its module loaded). Without it the kernel returns EOPNOTSUPP for
any XFRM netlink message, which is a configuration limitation rather
than a test failure.

Report TCONF instead of TBROK in that case for xfrm01, xfrm02 and
xfrm03.

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
 testcases/network/sockets/xfrm01.c | 3 +++
 testcases/network/sockets/xfrm02.c | 3 +++
 testcases/network/sockets/xfrm03.c | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/testcases/network/sockets/xfrm01.c b/testcases/network/sockets/xfrm01.c
index 5490d6b8a9f7fde79478ae0484e6ea8156d07cf3..22244032a521a42331b0c1411ae33f75622e64ce 100644
--- a/testcases/network/sockets/xfrm01.c
+++ b/testcases/network/sockets/xfrm01.c
@@ -126,6 +126,9 @@ static void setup(void)
 		if (TST_ERR == EPROTONOSUPPORT)
 			tst_brk(TCONF, "xfrm ESP is not supported by kernel");
 
+		if (tst_is_compat_mode() && TST_ERR == EOPNOTSUPP)
+			tst_brk(TCONF, "xfrm netlink unsupported in compat mode (missing CONFIG_XFRM_USER_COMPAT)");
+
 		tst_brk(TBROK | TTERRNO, "Failed to install xfrm ESP state");
 	}
 }
diff --git a/testcases/network/sockets/xfrm02.c b/testcases/network/sockets/xfrm02.c
index 43edb77d43c8c99e9883fc9922031d559ef31c40..376f6ebe551dd81fbc6a982503eacd68da636f93 100644
--- a/testcases/network/sockets/xfrm02.c
+++ b/testcases/network/sockets/xfrm02.c
@@ -126,6 +126,9 @@ static void setup(void)
 		if (TST_ERR == EPROTONOSUPPORT)
 			tst_brk(TCONF, "xfrm ESP is not supported by kernel");
 
+		if (tst_is_compat_mode() && TST_ERR == EOPNOTSUPP)
+			tst_brk(TCONF, "xfrm netlink unsupported in compat mode (missing CONFIG_XFRM_USER_COMPAT)");
+
 		tst_brk(TBROK | TTERRNO, "Failed to install xfrm ESP state");
 	}
 
diff --git a/testcases/network/sockets/xfrm03.c b/testcases/network/sockets/xfrm03.c
index 02ab95c6b7a87f8f206b30a39bb6feb097117998..fa5df9c285d540d5cad0e890a73d43ad9aeba1c2 100644
--- a/testcases/network/sockets/xfrm03.c
+++ b/testcases/network/sockets/xfrm03.c
@@ -202,6 +202,9 @@ static void setup(void)
 		if (TST_ERR == EPROTONOSUPPORT)
 			tst_brk(TCONF, "xfrm ESP is not supported by kernel");
 
+		if (tst_is_compat_mode() && TST_ERR == EOPNOTSUPP)
+			tst_brk(TCONF, "xfrm netlink unsupported in compat mode (missing CONFIG_XFRM_USER_COMPAT)");
+
 		tst_brk(TBROK | TTERRNO, "Failed to install xfrm ESP state");
 	}
 

---
base-commit: c685f1b774fab694c42dfb7522bc42d999904373
change-id: 20260611-fix_xfrm_compat_mode-0503f1f9bb8d

Best regards,
-- 
Andrea Cervesato <andrea.cervesato@suse.com>


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

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

* Re: [LTP] [PATCH] xfrm: Skip on EOPNOTSUPP in compat mode
  2026-06-11  9:37 [LTP] [PATCH] xfrm: Skip on EOPNOTSUPP in compat mode Andrea Cervesato
@ 2026-06-11 10:04 ` Cyril Hrubis
  2026-06-11 10:25 ` [LTP] " linuxtestproject.agent
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Cyril Hrubis @ 2026-06-11 10:04 UTC (permalink / raw)
  To: Andrea Cervesato; +Cc: Linux Test Project

Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

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

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

* Re: [LTP] xfrm: Skip on EOPNOTSUPP in compat mode
  2026-06-11  9:37 [LTP] [PATCH] xfrm: Skip on EOPNOTSUPP in compat mode Andrea Cervesato
  2026-06-11 10:04 ` Cyril Hrubis
@ 2026-06-11 10:25 ` linuxtestproject.agent
  2026-06-11 11:16 ` [LTP] [PATCH] " Avinesh Kumar via ltp
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: linuxtestproject.agent @ 2026-06-11 10:25 UTC (permalink / raw)
  To: Andrea Cervesato; +Cc: ltp

Hi Andrea,

On Thu, 11 Jun 2026 11:37:21 +0200, Andrea Cervesato wrote:
> xfrm: Skip on EOPNOTSUPP in compat mode

Verdict: Reviewed

---
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] 6+ messages in thread

* Re: [LTP] [PATCH] xfrm: Skip on EOPNOTSUPP in compat mode
  2026-06-11  9:37 [LTP] [PATCH] xfrm: Skip on EOPNOTSUPP in compat mode Andrea Cervesato
  2026-06-11 10:04 ` Cyril Hrubis
  2026-06-11 10:25 ` [LTP] " linuxtestproject.agent
@ 2026-06-11 11:16 ` Avinesh Kumar via ltp
  2026-06-11 12:55 ` Martin Doucha
  2026-06-11 13:49 ` Andrea Cervesato via ltp
  4 siblings, 0 replies; 6+ messages in thread
From: Avinesh Kumar via ltp @ 2026-06-11 11:16 UTC (permalink / raw)
  To: Andrea Cervesato, Linux Test Project

Hi,


On 6/11/26 11:37 AM, Andrea Cervesato wrote:
> From: Andrea Cervesato <andrea.cervesato@suse.com>
> 
> A 32-bit binary running on a 64-bit kernel uses the XFRM netlink compat
> layer, which is only available when CONFIG_XFRM_USER_COMPAT is enabled
> (and its module loaded). Without it the kernel returns EOPNOTSUPP for
> any XFRM netlink message, which is a configuration limitation rather
> than a test failure.
> 
> Report TCONF instead of TBROK in that case for xfrm01, xfrm02 and
> xfrm03.
> 
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
>   testcases/network/sockets/xfrm01.c | 3 +++
>   testcases/network/sockets/xfrm02.c | 3 +++
>   testcases/network/sockets/xfrm03.c | 3 +++
>   3 files changed, 9 insertions(+)
> 
> diff --git a/testcases/network/sockets/xfrm01.c b/testcases/network/sockets/xfrm01.c
> index 5490d6b8a9f7fde79478ae0484e6ea8156d07cf3..22244032a521a42331b0c1411ae33f75622e64ce 100644
> --- a/testcases/network/sockets/xfrm01.c
> +++ b/testcases/network/sockets/xfrm01.c
> @@ -126,6 +126,9 @@ static void setup(void)
>   		if (TST_ERR == EPROTONOSUPPORT)
>   			tst_brk(TCONF, "xfrm ESP is not supported by kernel");
>   
> +		if (tst_is_compat_mode() && TST_ERR == EOPNOTSUPP)
> +			tst_brk(TCONF, "xfrm netlink unsupported in compat mode (missing CONFIG_XFRM_USER_COMPAT)");
nit:
should the message be more explicit for
CONFIG_XFRM_USER_COMPAT=m


Reviewed-by: Avinesh Kumar <avinesh.kumar@suse.com>
Tested-by: Avinesh Kumar <avinesh.kumar@suse.com>


Thanks,
Avinesh

> +
>   		tst_brk(TBROK | TTERRNO, "Failed to install xfrm ESP state");
>   	}
>   }
> diff --git a/testcases/network/sockets/xfrm02.c b/testcases/network/sockets/xfrm02.c
> index 43edb77d43c8c99e9883fc9922031d559ef31c40..376f6ebe551dd81fbc6a982503eacd68da636f93 100644
> --- a/testcases/network/sockets/xfrm02.c
> +++ b/testcases/network/sockets/xfrm02.c
> @@ -126,6 +126,9 @@ static void setup(void)
>   		if (TST_ERR == EPROTONOSUPPORT)
>   			tst_brk(TCONF, "xfrm ESP is not supported by kernel");
>   
> +		if (tst_is_compat_mode() && TST_ERR == EOPNOTSUPP)
> +			tst_brk(TCONF, "xfrm netlink unsupported in compat mode (missing CONFIG_XFRM_USER_COMPAT)");
> +
>   		tst_brk(TBROK | TTERRNO, "Failed to install xfrm ESP state");
>   	}
>   
> diff --git a/testcases/network/sockets/xfrm03.c b/testcases/network/sockets/xfrm03.c
> index 02ab95c6b7a87f8f206b30a39bb6feb097117998..fa5df9c285d540d5cad0e890a73d43ad9aeba1c2 100644
> --- a/testcases/network/sockets/xfrm03.c
> +++ b/testcases/network/sockets/xfrm03.c
> @@ -202,6 +202,9 @@ static void setup(void)
>   		if (TST_ERR == EPROTONOSUPPORT)
>   			tst_brk(TCONF, "xfrm ESP is not supported by kernel");
>   
> +		if (tst_is_compat_mode() && TST_ERR == EOPNOTSUPP)
> +			tst_brk(TCONF, "xfrm netlink unsupported in compat mode (missing CONFIG_XFRM_USER_COMPAT)");
> +
>   		tst_brk(TBROK | TTERRNO, "Failed to install xfrm ESP state");
>   	}
>   
> 
> ---
> base-commit: c685f1b774fab694c42dfb7522bc42d999904373
> change-id: 20260611-fix_xfrm_compat_mode-0503f1f9bb8d
> 
> Best regards,


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

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

* Re: [LTP] [PATCH] xfrm: Skip on EOPNOTSUPP in compat mode
  2026-06-11  9:37 [LTP] [PATCH] xfrm: Skip on EOPNOTSUPP in compat mode Andrea Cervesato
                   ` (2 preceding siblings ...)
  2026-06-11 11:16 ` [LTP] [PATCH] " Avinesh Kumar via ltp
@ 2026-06-11 12:55 ` Martin Doucha
  2026-06-11 13:49 ` Andrea Cervesato via ltp
  4 siblings, 0 replies; 6+ messages in thread
From: Martin Doucha @ 2026-06-11 12:55 UTC (permalink / raw)
  To: Andrea Cervesato, Linux Test Project

Hi,
I would change the TCONF message a bit to something like "xfrm compat 
mode is not available". The compat module may be available but it 
doesn't load automatically. We could try loading it in setup() but then 
we'd either need to check insmod() result or add .needs_root. But since 
the bug is not compat-specific, this patch is good enough.

Reviewed-by: Martin Doucha <mdoucha@suse.cz>

On 6/11/26 11:37, Andrea Cervesato wrote:
> From: Andrea Cervesato <andrea.cervesato@suse.com>
> 
> A 32-bit binary running on a 64-bit kernel uses the XFRM netlink compat
> layer, which is only available when CONFIG_XFRM_USER_COMPAT is enabled
> (and its module loaded). Without it the kernel returns EOPNOTSUPP for
> any XFRM netlink message, which is a configuration limitation rather
> than a test failure.
> 
> Report TCONF instead of TBROK in that case for xfrm01, xfrm02 and
> xfrm03.
> 
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
>   testcases/network/sockets/xfrm01.c | 3 +++
>   testcases/network/sockets/xfrm02.c | 3 +++
>   testcases/network/sockets/xfrm03.c | 3 +++
>   3 files changed, 9 insertions(+)
> 
> diff --git a/testcases/network/sockets/xfrm01.c b/testcases/network/sockets/xfrm01.c
> index 5490d6b8a9f7fde79478ae0484e6ea8156d07cf3..22244032a521a42331b0c1411ae33f75622e64ce 100644
> --- a/testcases/network/sockets/xfrm01.c
> +++ b/testcases/network/sockets/xfrm01.c
> @@ -126,6 +126,9 @@ static void setup(void)
>   		if (TST_ERR == EPROTONOSUPPORT)
>   			tst_brk(TCONF, "xfrm ESP is not supported by kernel");
>   
> +		if (tst_is_compat_mode() && TST_ERR == EOPNOTSUPP)
> +			tst_brk(TCONF, "xfrm netlink unsupported in compat mode (missing CONFIG_XFRM_USER_COMPAT)");
> +
>   		tst_brk(TBROK | TTERRNO, "Failed to install xfrm ESP state");
>   	}
>   }
> diff --git a/testcases/network/sockets/xfrm02.c b/testcases/network/sockets/xfrm02.c
> index 43edb77d43c8c99e9883fc9922031d559ef31c40..376f6ebe551dd81fbc6a982503eacd68da636f93 100644
> --- a/testcases/network/sockets/xfrm02.c
> +++ b/testcases/network/sockets/xfrm02.c
> @@ -126,6 +126,9 @@ static void setup(void)
>   		if (TST_ERR == EPROTONOSUPPORT)
>   			tst_brk(TCONF, "xfrm ESP is not supported by kernel");
>   
> +		if (tst_is_compat_mode() && TST_ERR == EOPNOTSUPP)
> +			tst_brk(TCONF, "xfrm netlink unsupported in compat mode (missing CONFIG_XFRM_USER_COMPAT)");
> +
>   		tst_brk(TBROK | TTERRNO, "Failed to install xfrm ESP state");
>   	}
>   
> diff --git a/testcases/network/sockets/xfrm03.c b/testcases/network/sockets/xfrm03.c
> index 02ab95c6b7a87f8f206b30a39bb6feb097117998..fa5df9c285d540d5cad0e890a73d43ad9aeba1c2 100644
> --- a/testcases/network/sockets/xfrm03.c
> +++ b/testcases/network/sockets/xfrm03.c
> @@ -202,6 +202,9 @@ static void setup(void)
>   		if (TST_ERR == EPROTONOSUPPORT)
>   			tst_brk(TCONF, "xfrm ESP is not supported by kernel");
>   
> +		if (tst_is_compat_mode() && TST_ERR == EOPNOTSUPP)
> +			tst_brk(TCONF, "xfrm netlink unsupported in compat mode (missing CONFIG_XFRM_USER_COMPAT)");
> +
>   		tst_brk(TBROK | TTERRNO, "Failed to install xfrm ESP state");
>   	}
>   
> 
> ---
> base-commit: c685f1b774fab694c42dfb7522bc42d999904373
> change-id: 20260611-fix_xfrm_compat_mode-0503f1f9bb8d
> 
> Best regards,


-- 
Martin Doucha   mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

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

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

* Re: [LTP] [PATCH] xfrm: Skip on EOPNOTSUPP in compat mode
  2026-06-11  9:37 [LTP] [PATCH] xfrm: Skip on EOPNOTSUPP in compat mode Andrea Cervesato
                   ` (3 preceding siblings ...)
  2026-06-11 12:55 ` Martin Doucha
@ 2026-06-11 13:49 ` Andrea Cervesato via ltp
  4 siblings, 0 replies; 6+ messages in thread
From: Andrea Cervesato via ltp @ 2026-06-11 13:49 UTC (permalink / raw)
  To: Andrea Cervesato; +Cc: Linux Test Project

Added the suggested @Martin message.

Merged, Thanks!

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

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

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

end of thread, other threads:[~2026-06-11 13:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11  9:37 [LTP] [PATCH] xfrm: Skip on EOPNOTSUPP in compat mode Andrea Cervesato
2026-06-11 10:04 ` Cyril Hrubis
2026-06-11 10:25 ` [LTP] " linuxtestproject.agent
2026-06-11 11:16 ` [LTP] [PATCH] " Avinesh Kumar via ltp
2026-06-11 12:55 ` Martin Doucha
2026-06-11 13:49 ` Andrea Cervesato via ltp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.