* Re: [PATCH v1] Call prctl(2) with long integers, specify 5 arguments, and avoid casts
From: Alejandro Colomar @ 2024-06-01 19:32 UTC (permalink / raw)
To: Thomas Weißschuh; +Cc: util-linux, Xi Ruoyao, libc-alpha
In-Reply-To: <mbvtkssza7bvvu45wqivbfd2astvpsu3t7u223a222oizrqznm@rv4rxvvkxzct>
[-- Attachment #1: Type: text/plain, Size: 7673 bytes --]
On Sat, Jun 01, 2024 at 02:24:03PM GMT, Alejandro Colomar wrote:
> Hi Thomas,
>
> On Sat, Jun 01, 2024 at 01:05:02PM GMT, Thomas Weißschuh wrote:
> > On 2024-06-01 11:31:56+0000, Alejandro Colomar wrote:
> > > Since libc's prctl(2) wrapper is a variadic function, arguments must
> > > have the right width. Otherwise, the behavior is undefined.
> >
> > Ack.
> >
> > > Also, the 5 arguments must be specified always, or the behavior is also
> > > undefined. libc reads 5 values and passes them all to the kernel, so if
> > > one is uninitialized, the kernel will receive garbagge, which could
> > > result in EINVAL (most likely), or worse, a different action.
> >
> > This seems surprising.
> >
> > The kernel should only check the arguments it documents and not more.
>
> Hmmm, some prctl(2) calls don't document a need for passing 0 (probably
> for legacy compatibility; you're right. Only newer prctl(2)s check
> those args.
>
> And see for example these kernel commit:
>
> commit e9d1b4f3c60997fe197bf0243cb4a41a44387a88
> Author: Dave Hansen <dave.hansen@linux.intel.com>
> Date: Thu Jan 8 14:30:22 2015 -0800
>
> x86, mpx: Strictly enforce empty prctl() args
>
> Description from Michael Kerrisk. He suggested an identical patch
> to one I had already coded up and tested.
>
> commit fe3d197f8431 "x86, mpx: On-demand kernel allocation of bounds
> tables" added two new prctl() operations, PR_MPX_ENABLE_MANAGEMENT and
> PR_MPX_DISABLE_MANAGEMENT. However, no checks were included to ensure
> that unused arguments are zero, as is done in many existing prctl()s
> and as should be done for all new prctl()s. This patch adds the
> required checks.
>
> Suggested-by: Andy Lutomirski <luto@amacapital.net>
> Suggested-by: Michael Kerrisk <mtk.manpages@gmail.com>
> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Dave Hansen <dave@sr71.net>
> Link: http://lkml.kernel.org/r/20150108223022.7F56FD13@viggo.jf.intel.com
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
>
> diff --git a/kernel/sys.c b/kernel/sys.c
> index a8c9f5a7dda6..ea9c88109894 100644
> --- a/kernel/sys.c
> +++ b/kernel/sys.c
> @@ -2210,9 +2210,13 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
> up_write(&me->mm->mmap_sem);
> break;
> case PR_MPX_ENABLE_MANAGEMENT:
> + if (arg2 || arg3 || arg4 || arg5)
> + return -EINVAL;
> error = MPX_ENABLE_MANAGEMENT(me);
> break;
> case PR_MPX_DISABLE_MANAGEMENT:
> + if (arg2 || arg3 || arg4 || arg5)
> + return -EINVAL;
> error = MPX_DISABLE_MANAGEMENT(me);
> break;
> default:
>
> And this one too:
>
> commit 3e91ec89f527b9870fe42dcbdb74fd389d123a95
> Author: Catalin Marinas <catalin.marinas@arm.com>
> Date: Thu Aug 15 16:44:00 2019 +0100
>
> arm64: Tighten the PR_{SET, GET}_TAGGED_ADDR_CTRL prctl() unused arguments
>
> Require that arg{3,4,5} of the PR_{SET,GET}_TAGGED_ADDR_CTRL prctl and
> arg2 of the PR_GET_TAGGED_ADDR_CTRL prctl() are zero rather than ignored
> for future extensions.
>
> Acked-by: Andrey Konovalov <andreyknvl@google.com>
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> Signed-off-by: Will Deacon <will@kernel.org>
>
> diff --git a/kernel/sys.c b/kernel/sys.c
> index c6c4d5358bd3..ec48396b4943 100644
> --- a/kernel/sys.c
> +++ b/kernel/sys.c
> @@ -2499,9 +2499,13 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
> error = PAC_RESET_KEYS(me, arg2);
> break;
> case PR_SET_TAGGED_ADDR_CTRL:
> + if (arg3 || arg4 || arg5)
> + return -EINVAL;
> error = SET_TAGGED_ADDR_CTRL(arg2);
> break;
> case PR_GET_TAGGED_ADDR_CTRL:
> + if (arg2 || arg3 || arg4 || arg5)
> + return -EINVAL;
> error = GET_TAGGED_ADDR_CTRL();
> break;
> default:
>
> In the few calls that util-linux makes without specifying all 5 args,
> the kernel seems to not do the checks (in some old prctl(2)s they didn't
> have that check, and nobody seems to have cared enough to add it), so
> it's more like we're lucky (or unlucky, depending on how you see it).
>
> > glibc itself doesn't even specify all five arguments in its own calls to
> > prctl().
>
> glibc itself is wrong. I'm even surprised that the PR_* macros from the
> kernel UAPI for arg2 work without specifying the L suffix on them, but
> it's probably just luck.
>
> <https://lore.kernel.org/linux-api/20240528114750.106187-1-alx@kernel.org/T/#u>
>
> > If all five arguments are really required then prctl() wouldn't need to
> > be variadic.
>
> Indeed. I guess that's for historic reasons, rather than actual
> necessity; but I don't know for sure.
>
> > How is random non-zero data less valid than a essentially random zero?
> > And if the kernel actually validates this, how has it ever worked before?
>
> They only added validation for (all) new prctl(2) calls, plus maybe some
> old ones, but not all. In the ones used in util-linux that don't
> specify zero, I've checked now that the kernel doesn't validate.
>
> However, a call such as
>
> prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)
>
> (this call exists in util-linux)
> actually means
>
> prctl(PR_SET_NO_NEW_PRIVS, 1L, 0L, random, random)
>
> and it supposedly has been working so far. Those random bits are
> probably 0 most of the time, for some reason. And the kernel does check
> this one:
>
> $ sed -n /PR_SET_NO_NEW_PRIVS/,+2p <kernel/sys.c
> case PR_SET_NO_NEW_PRIVS:
> if (arg2 != 1 || arg3 || arg4 || arg5)
> return -EINVAL;
>
> > Other popular software like systemd or opendjk also don't specify unused arguments.
>
> I've also checked that the ones that systemd uses without specifying all
> 5 args, they are not checked by the kernel.
>
> > So it doesn't really seem "broken".
> > If the patch is more about "being on the safe side", then this should be
> > spelled out.
>
> Still, libc reads those values (on x32) which results in Undefined
> Behavior inside glibc. Which is a bad thing. Not broken, because the
> compiler has little information to exploit that UB, but not a good thing
> either.
>
> $ grepc __prctl .
> ./include/sys/prctl.h:extern int __prctl (int __option, ...);
> ./sysdeps/unix/sysv/linux/x86_64/x32/prctl.c:int
> __prctl (int option, ...)
> {
> va_list arg;
> va_start (arg, option);
> unsigned long int arg2 = va_arg (arg, unsigned long int);
> unsigned long int arg3 = va_arg (arg, unsigned long int);
> unsigned long int arg4 = va_arg (arg, unsigned long int);
> unsigned long int arg5 = va_arg (arg, unsigned long int);
> va_end (arg);
> return INLINE_SYSCALL_CALL (prctl, option, arg2, arg3, arg4, arg5);
> }
Or one could say this is not a user problem, and just an implementation
detail of libc. For those calls that the kernel ignores the argument,
omitting the argument sounds reasonable as a user. I guess the kernel
won't expand those APIs, since that would be dangerous (for this precise
reason).
>
> It's arguably less broken than the missing 'L', though.
>
> > (Plus the cases where documented, required arguments are missing)
>
> None of the cases where we omit the arguments are checked by the kernel.
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH v1] Call prctl(2) with long integers, specify 5 arguments, and avoid casts
From: Alejandro Colomar @ 2024-06-01 12:23 UTC (permalink / raw)
To: Thomas Weißschuh; +Cc: util-linux, Xi Ruoyao, libc-alpha
In-Reply-To: <460edfcb-4dc0-418c-9f4d-eb74261701c8@t-8ch.de>
[-- Attachment #1: Type: text/plain, Size: 6972 bytes --]
Hi Thomas,
On Sat, Jun 01, 2024 at 01:05:02PM GMT, Thomas Weißschuh wrote:
> On 2024-06-01 11:31:56+0000, Alejandro Colomar wrote:
> > Since libc's prctl(2) wrapper is a variadic function, arguments must
> > have the right width. Otherwise, the behavior is undefined.
>
> Ack.
>
> > Also, the 5 arguments must be specified always, or the behavior is also
> > undefined. libc reads 5 values and passes them all to the kernel, so if
> > one is uninitialized, the kernel will receive garbagge, which could
> > result in EINVAL (most likely), or worse, a different action.
>
> This seems surprising.
>
> The kernel should only check the arguments it documents and not more.
Hmmm, some prctl(2) calls don't document a need for passing 0 (probably
for legacy compatibility; you're right. Only newer prctl(2)s check
those args.
And see for example these kernel commit:
commit e9d1b4f3c60997fe197bf0243cb4a41a44387a88
Author: Dave Hansen <dave.hansen@linux.intel.com>
Date: Thu Jan 8 14:30:22 2015 -0800
x86, mpx: Strictly enforce empty prctl() args
Description from Michael Kerrisk. He suggested an identical patch
to one I had already coded up and tested.
commit fe3d197f8431 "x86, mpx: On-demand kernel allocation of bounds
tables" added two new prctl() operations, PR_MPX_ENABLE_MANAGEMENT and
PR_MPX_DISABLE_MANAGEMENT. However, no checks were included to ensure
that unused arguments are zero, as is done in many existing prctl()s
and as should be done for all new prctl()s. This patch adds the
required checks.
Suggested-by: Andy Lutomirski <luto@amacapital.net>
Suggested-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Dave Hansen <dave@sr71.net>
Link: http://lkml.kernel.org/r/20150108223022.7F56FD13@viggo.jf.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
diff --git a/kernel/sys.c b/kernel/sys.c
index a8c9f5a7dda6..ea9c88109894 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2210,9 +2210,13 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
up_write(&me->mm->mmap_sem);
break;
case PR_MPX_ENABLE_MANAGEMENT:
+ if (arg2 || arg3 || arg4 || arg5)
+ return -EINVAL;
error = MPX_ENABLE_MANAGEMENT(me);
break;
case PR_MPX_DISABLE_MANAGEMENT:
+ if (arg2 || arg3 || arg4 || arg5)
+ return -EINVAL;
error = MPX_DISABLE_MANAGEMENT(me);
break;
default:
And this one too:
commit 3e91ec89f527b9870fe42dcbdb74fd389d123a95
Author: Catalin Marinas <catalin.marinas@arm.com>
Date: Thu Aug 15 16:44:00 2019 +0100
arm64: Tighten the PR_{SET, GET}_TAGGED_ADDR_CTRL prctl() unused arguments
Require that arg{3,4,5} of the PR_{SET,GET}_TAGGED_ADDR_CTRL prctl and
arg2 of the PR_GET_TAGGED_ADDR_CTRL prctl() are zero rather than ignored
for future extensions.
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
diff --git a/kernel/sys.c b/kernel/sys.c
index c6c4d5358bd3..ec48396b4943 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2499,9 +2499,13 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
error = PAC_RESET_KEYS(me, arg2);
break;
case PR_SET_TAGGED_ADDR_CTRL:
+ if (arg3 || arg4 || arg5)
+ return -EINVAL;
error = SET_TAGGED_ADDR_CTRL(arg2);
break;
case PR_GET_TAGGED_ADDR_CTRL:
+ if (arg2 || arg3 || arg4 || arg5)
+ return -EINVAL;
error = GET_TAGGED_ADDR_CTRL();
break;
default:
In the few calls that util-linux makes without specifying all 5 args,
the kernel seems to not do the checks (in some old prctl(2)s they didn't
have that check, and nobody seems to have cared enough to add it), so
it's more like we're lucky (or unlucky, depending on how you see it).
> glibc itself doesn't even specify all five arguments in its own calls to
> prctl().
glibc itself is wrong. I'm even surprised that the PR_* macros from the
kernel UAPI for arg2 work without specifying the L suffix on them, but
it's probably just luck.
<https://lore.kernel.org/linux-api/20240528114750.106187-1-alx@kernel.org/T/#u>
> If all five arguments are really required then prctl() wouldn't need to
> be variadic.
Indeed. I guess that's for historic reasons, rather than actual
necessity; but I don't know for sure.
> How is random non-zero data less valid than a essentially random zero?
> And if the kernel actually validates this, how has it ever worked before?
They only added validation for (all) new prctl(2) calls, plus maybe some
old ones, but not all. In the ones used in util-linux that don't
specify zero, I've checked now that the kernel doesn't validate.
However, a call such as
prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)
(this call exists in util-linux)
actually means
prctl(PR_SET_NO_NEW_PRIVS, 1L, 0L, random, random)
and it supposedly has been working so far. Those random bits are
probably 0 most of the time, for some reason. And the kernel does check
this one:
$ sed -n /PR_SET_NO_NEW_PRIVS/,+2p <kernel/sys.c
case PR_SET_NO_NEW_PRIVS:
if (arg2 != 1 || arg3 || arg4 || arg5)
return -EINVAL;
> Other popular software like systemd or opendjk also don't specify unused arguments.
I've also checked that the ones that systemd uses without specifying all
5 args, they are not checked by the kernel.
> So it doesn't really seem "broken".
> If the patch is more about "being on the safe side", then this should be
> spelled out.
Still, libc reads those values (on x32) which results in Undefined
Behavior inside glibc. Which is a bad thing. Not broken, because the
compiler has little information to exploit that UB, but not a good thing
either.
$ grepc __prctl .
./include/sys/prctl.h:extern int __prctl (int __option, ...);
./sysdeps/unix/sysv/linux/x86_64/x32/prctl.c:int
__prctl (int option, ...)
{
va_list arg;
va_start (arg, option);
unsigned long int arg2 = va_arg (arg, unsigned long int);
unsigned long int arg3 = va_arg (arg, unsigned long int);
unsigned long int arg4 = va_arg (arg, unsigned long int);
unsigned long int arg5 = va_arg (arg, unsigned long int);
va_end (arg);
return INLINE_SYSCALL_CALL (prctl, option, arg2, arg3, arg4, arg5);
}
It's arguably less broken than the missing 'L', though.
> (Plus the cases where documented, required arguments are missing)
None of the cases where we omit the arguments are checked by the kernel.
Have a lovely day!
Alex
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH v1] Call prctl(2) with long integers, specify 5 arguments, and avoid casts
From: Thomas Weißschuh @ 2024-06-01 11:05 UTC (permalink / raw)
To: Alejandro Colomar; +Cc: util-linux, Xi Ruoyao
In-Reply-To: <20240601093150.16912-1-alx@kernel.org>
On 2024-06-01 11:31:56+0000, Alejandro Colomar wrote:
> Since libc's prctl(2) wrapper is a variadic function, arguments must
> have the right width. Otherwise, the behavior is undefined.
Ack.
> Also, the 5 arguments must be specified always, or the behavior is also
> undefined. libc reads 5 values and passes them all to the kernel, so if
> one is uninitialized, the kernel will receive garbagge, which could
> result in EINVAL (most likely), or worse, a different action.
This seems surprising.
The kernel should only check the arguments it documents and not more.
glibc itself doesn't even specify all five arguments in its own calls to
prctl().
If all five arguments are really required then prctl() wouldn't need to
be variadic.
How is random non-zero data less valid than a essentially random zero?
And if the kernel actually validates this, how has it ever worked before?
Other popular software like systemd or opendjk also don't specify unused arguments.
So it doesn't really seem "broken".
If the patch is more about "being on the safe side", then this should be
spelled out.
(Plus the cases where documented, required arguments are missing)
> Also, avoid some casts to unsigned long, by changing the type of the
> parameter to some local wrappers.
>
> And use consistently 0L. 0UL is basically the same, and uses one more
> character. Keep it short.
>
> Link: <https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/?id=6698b096a6f5342cb9b338c237ed875a8635497a>
> Link: <https://lore.kernel.org/linux-man/ddbdyaiptesjalgfmztxideej67e3yaob7ucsmbf6qvriwxiif@dohhxrqgwhrf/T/#med306b5b003f9cc7cc2de69fcdd7ee2d056d0954>
> Cc: Xi Ruoyao <xry111@xry111.site>
> Signed-off-by: Alejandro Colomar <alx@kernel.org>
> ---
> Range-diff against v0:
> -: --------- > 1: afd73139e Call prctl(2) with long integers, specify 5 arguments, and avoid casts
>
> include/seccomp.h | 2 +-
> lib/caputils.c | 4 ++--
> lib/env.c | 4 ++--
> misc-utils/enosys.c | 4 ++--
> schedutils/coresched.c | 6 +++---
> sys-utils/setpriv-landlock.c | 2 +-
> sys-utils/setpriv.c | 34 ++++++++++++++++------------------
> tests/helpers/test_mkfds.c | 2 +-
> 8 files changed, 28 insertions(+), 30 deletions(-)
<snip>
^ permalink raw reply
* [PATCH v1] Call prctl(2) with long integers, specify 5 arguments, and avoid casts
From: Alejandro Colomar @ 2024-06-01 9:31 UTC (permalink / raw)
To: util-linux; +Cc: Alejandro Colomar, Xi Ruoyao
[-- Attachment #1: Type: text/plain, Size: 11494 bytes --]
Since libc's prctl(2) wrapper is a variadic function, arguments must
have the right width. Otherwise, the behavior is undefined.
Also, the 5 arguments must be specified always, or the behavior is also
undefined. libc reads 5 values and passes them all to the kernel, so if
one is uninitialized, the kernel will receive garbagge, which could
result in EINVAL (most likely), or worse, a different action.
Also, avoid some casts to unsigned long, by changing the type of the
parameter to some local wrappers.
And use consistently 0L. 0UL is basically the same, and uses one more
character. Keep it short.
Link: <https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/?id=6698b096a6f5342cb9b338c237ed875a8635497a>
Link: <https://lore.kernel.org/linux-man/ddbdyaiptesjalgfmztxideej67e3yaob7ucsmbf6qvriwxiif@dohhxrqgwhrf/T/#med306b5b003f9cc7cc2de69fcdd7ee2d056d0954>
Cc: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
Range-diff against v0:
-: --------- > 1: afd73139e Call prctl(2) with long integers, specify 5 arguments, and avoid casts
include/seccomp.h | 2 +-
lib/caputils.c | 4 ++--
lib/env.c | 4 ++--
misc-utils/enosys.c | 4 ++--
schedutils/coresched.c | 6 +++---
sys-utils/setpriv-landlock.c | 2 +-
sys-utils/setpriv.c | 34 ++++++++++++++++------------------
tests/helpers/test_mkfds.c | 2 +-
8 files changed, 28 insertions(+), 30 deletions(-)
diff --git a/include/seccomp.h b/include/seccomp.h
index 2b211439e..8c65b5e8c 100644
--- a/include/seccomp.h
+++ b/include/seccomp.h
@@ -18,7 +18,7 @@ static int ul_set_seccomp_filter_spec_allow(const struct sock_fprog *prog)
return 0;
#endif
- return prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, prog);
+ return prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, prog, 0L, 0L);
}
#endif /* UL_SECCOMP_H */
diff --git a/lib/caputils.c b/lib/caputils.c
index 23866c071..fd7037ff9 100644
--- a/lib/caputils.c
+++ b/lib/caputils.c
@@ -29,7 +29,7 @@
static int test_cap(unsigned int cap)
{
/* prctl returns 0 or 1 for valid caps, -1 otherwise */
- return prctl(PR_CAPBSET_READ, cap, 0, 0, 0) >= 0;
+ return prctl(PR_CAPBSET_READ, cap, 0L, 0L, 0L) >= 0;
}
static int cap_last_by_bsearch(int *ret)
@@ -120,7 +120,7 @@ void cap_permitted_to_ambient(void)
continue;
if ((effective & (1ULL << cap))
- && prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, cap, 0, 0) < 0)
+ && prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, cap, 0L, 0L) < 0)
err(EXIT_FAILURE, _("prctl(PR_CAP_AMBIENT) failed"));
}
}
diff --git a/lib/env.c b/lib/env.c
index 2bdfe5697..5d9ab2456 100644
--- a/lib/env.c
+++ b/lib/env.c
@@ -191,11 +191,11 @@ char *safe_getenv(const char *arg)
if ((getuid() != geteuid()) || (getgid() != getegid()))
return NULL;
#ifdef HAVE_PRCTL
- if (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 0)
+ if (prctl(PR_GET_DUMPABLE, 0L, 0L, 0L, 0L) == 0)
return NULL;
#else
#if (defined(linux) && defined(SYS_prctl))
- if (syscall(SYS_prctl, PR_GET_DUMPABLE, 0, 0, 0, 0) == 0)
+ if (syscall(SYS_prctl, PR_GET_DUMPABLE, 0L, 0L, 0L, 0L) == 0)
return NULL;
#endif
#endif
diff --git a/misc-utils/enosys.c b/misc-utils/enosys.c
index 1410676dd..acf4428b6 100644
--- a/misc-utils/enosys.c
+++ b/misc-utils/enosys.c
@@ -290,10 +290,10 @@ int main(int argc, char **argv)
/* *SET* below will return EINVAL when either the filter is invalid or
* seccomp is not supported. To distinguish those cases do a *GET* here
*/
- if (prctl(PR_GET_SECCOMP) == -1 && errno == EINVAL)
+ if (prctl(PR_GET_SECCOMP, 0L, 0L, 0L, 0L) == -1 && errno == EINVAL)
err(EXIT_NOTSUPP, _("Seccomp non-functional"));
- if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0))
+ if (prctl(PR_SET_NO_NEW_PRIVS, 1L, 0L, 0L, 0L))
err_nosys(EXIT_FAILURE, _("Could not run prctl(PR_SET_NO_NEW_PRIVS)"));
if (ul_set_seccomp_filter_spec_allow(&prog))
diff --git a/schedutils/coresched.c b/schedutils/coresched.c
index 9d8be3e12..7844f98be 100644
--- a/schedutils/coresched.c
+++ b/schedutils/coresched.c
@@ -129,20 +129,20 @@ static sched_core_cookie core_sched_get_cookie(pid_t pid)
static void core_sched_create_cookie(pid_t pid, sched_core_scope type)
{
- if (prctl(PR_SCHED_CORE, PR_SCHED_CORE_CREATE, pid, type, 0))
+ if (prctl(PR_SCHED_CORE, PR_SCHED_CORE_CREATE, pid, type, 0L))
err(EXIT_FAILURE, _("Failed to create cookie for PID %d"), pid);
}
static void core_sched_pull_cookie(pid_t from)
{
if (prctl(PR_SCHED_CORE, PR_SCHED_CORE_SHARE_FROM, from,
- PR_SCHED_CORE_SCOPE_THREAD, 0))
+ PR_SCHED_CORE_SCOPE_THREAD, 0L))
err(EXIT_FAILURE, _("Failed to pull cookie from PID %d"), from);
}
static void core_sched_push_cookie(pid_t to, sched_core_scope type)
{
- if (prctl(PR_SCHED_CORE, PR_SCHED_CORE_SHARE_TO, to, type, 0))
+ if (prctl(PR_SCHED_CORE, PR_SCHED_CORE_SHARE_TO, to, type, 0L))
err(EXIT_FAILURE, _("Failed to push cookie to PID %d"), to);
}
diff --git a/sys-utils/setpriv-landlock.c b/sys-utils/setpriv-landlock.c
index 00ad38c61..18c698325 100644
--- a/sys-utils/setpriv-landlock.c
+++ b/sys-utils/setpriv-landlock.c
@@ -187,7 +187,7 @@ void do_landlock(const struct setpriv_landlock_opts *opts)
err(SETPRIV_EXIT_PRIVERR, _("adding landlock rule failed"));
}
- if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) == -1)
+ if (prctl(PR_SET_NO_NEW_PRIVS, 1L, 0L, 0L, 0L) == -1)
err(SETPRIV_EXIT_PRIVERR, _("disallow granting new privileges for landlock failed"));
if (landlock_restrict_self(fd, 0) == -1)
diff --git a/sys-utils/setpriv.c b/sys-utils/setpriv.c
index 4b0543101..0db09bf74 100644
--- a/sys-utils/setpriv.c
+++ b/sys-utils/setpriv.c
@@ -165,7 +165,7 @@ static void __attribute__((__noreturn__)) usage(void)
exit(EXIT_SUCCESS);
}
-static int has_cap(enum cap_type which, unsigned int i)
+static int has_cap(enum cap_type which, unsigned long i)
{
switch (which) {
case CAP_TYPE_EFFECTIVE:
@@ -174,8 +174,7 @@ static int has_cap(enum cap_type which, unsigned int i)
case CAP_TYPE_PERMITTED:
return capng_have_capability((capng_type_t)which, i);
case CAP_TYPE_AMBIENT:
- return prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_IS_SET,
- (unsigned long) i, 0UL, 0UL);
+ return prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_IS_SET, i, 0L, 0L);
default:
warnx(_("invalid capability type"));
return -1;
@@ -223,7 +222,7 @@ static void dump_one_secbit(int *first, int *bits, int bit, const char *name)
static void dump_securebits(void)
{
int first = 1;
- int bits = prctl(PR_GET_SECUREBITS, 0, 0, 0, 0);
+ int bits = prctl(PR_GET_SECUREBITS, 0L, 0L, 0L, 0L);
if (bits < 0) {
warnx(_("getting process secure bits failed"));
@@ -323,7 +322,7 @@ static void dump_pdeathsig(void)
{
int pdeathsig;
- if (prctl(PR_GET_PDEATHSIG, &pdeathsig) != 0) {
+ if (prctl(PR_GET_PDEATHSIG, &pdeathsig, 0L, 0L, 0L) != 0) {
warn(_("get pdeathsig failed"));
return;
}
@@ -363,7 +362,7 @@ static void dump(int dumplevel)
dump_groups();
- x = prctl(PR_GET_NO_NEW_PRIVS, 0, 0, 0, 0);
+ x = prctl(PR_GET_NO_NEW_PRIVS, 0L, 0L, 0L, 0L);
if (0 <= x)
printf("no_new_privs: %d\n", x);
else
@@ -449,7 +448,7 @@ static void parse_groups(struct privctx *opts, const char *str)
static void parse_pdeathsig(struct privctx *opts, const char *str)
{
if (!strcmp(str, "keep")) {
- if (prctl(PR_GET_PDEATHSIG, &opts->pdeathsig) != 0)
+ if (prctl(PR_GET_PDEATHSIG, &opts->pdeathsig, 0L, 0L, 0L) != 0)
errx(SETPRIV_EXIT_PRIVERR,
_("failed to get parent death signal"));
} else if (!strcmp(str, "clear")) {
@@ -495,8 +494,7 @@ static void bump_cap(unsigned int cap)
capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, cap);
}
-static int cap_update(capng_act_t action,
- enum cap_type type, unsigned int cap)
+static int cap_update(capng_act_t action, enum cap_type type, unsigned long cap)
{
switch (type) {
case CAP_TYPE_EFFECTIVE:
@@ -510,10 +508,10 @@ static int cap_update(capng_act_t action,
if (action == CAPNG_ADD)
ret = prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE,
- (unsigned long) cap, 0UL, 0UL);
+ cap, 0L, 0L);
else
ret = prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_LOWER,
- (unsigned long) cap, 0UL, 0UL);
+ cap, 0L, 0L);
return ret;
}
@@ -565,7 +563,7 @@ static void parse_securebits(struct privctx *opts, const char *arg)
char *c;
opts->have_securebits = 1;
- opts->securebits = prctl(PR_GET_SECUREBITS, 0, 0, 0, 0);
+ opts->securebits = prctl(PR_GET_SECUREBITS, 0L, 0L, 0L, 0L);
if (opts->securebits < 0)
err(SETPRIV_EXIT_PRIVERR, _("getting process secure bits failed"));
@@ -687,10 +685,10 @@ static void do_seccomp_filter(const char *file)
/* *SET* below will return EINVAL when either the filter is invalid or
* seccomp is not supported. To distinguish those cases do a *GET* here
*/
- if (prctl(PR_GET_SECCOMP) == -1 && errno == EINVAL)
+ if (prctl(PR_GET_SECCOMP, 0L, 0L, 0L, 0L) == -1 && errno == EINVAL)
err(SETPRIV_EXIT_PRIVERR, _("Seccomp non-functional"));
- if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0))
+ if (prctl(PR_SET_NO_NEW_PRIVS, 1L, 0L, 0L, 0L))
err(SETPRIV_EXIT_PRIVERR, _("Could not run prctl(PR_SET_NO_NEW_PRIVS)"));
if (ul_set_seccomp_filter_spec_allow(&prog))
@@ -1059,7 +1057,7 @@ int main(int argc, char **argv)
do_reset_environ(pw);
}
- if (opts.nnp && prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) == -1)
+ if (opts.nnp && prctl(PR_SET_NO_NEW_PRIVS, 1L, 0L, 0L, 0L) == -1)
err(EXIT_FAILURE, _("disallow granting new privileges failed"));
if (opts.selinux_label)
@@ -1069,7 +1067,7 @@ int main(int argc, char **argv)
if (opts.seccomp_filter)
do_seccomp_filter(opts.seccomp_filter);
- if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) == -1)
+ if (prctl(PR_SET_KEEPCAPS, 1L, 0L, 0L, 0L) == -1)
err(EXIT_FAILURE, _("keep process capabilities failed"));
/* We're going to want CAP_SETPCAP, CAP_SETUID, and CAP_SETGID if
@@ -1102,7 +1100,7 @@ int main(int argc, char **argv)
err(SETPRIV_EXIT_PRIVERR, _("setgroups failed"));
}
- if (opts.have_securebits && prctl(PR_SET_SECUREBITS, opts.securebits, 0, 0, 0) != 0)
+ if (opts.have_securebits && prctl(PR_SET_SECUREBITS, opts.securebits, 0L, 0L, 0L) != 0)
err(SETPRIV_EXIT_PRIVERR, _("set process securebits failed"));
if (opts.bounding_set) {
@@ -1123,7 +1121,7 @@ int main(int argc, char **argv)
}
/* Clear or set parent death signal */
- if (opts.pdeathsig && prctl(PR_SET_PDEATHSIG, opts.pdeathsig < 0 ? 0 : opts.pdeathsig) != 0)
+ if (opts.pdeathsig && prctl(PR_SET_PDEATHSIG, opts.pdeathsig < 0 ? 0L : opts.pdeathsig, 0L, 0L, 0L) != 0)
err(SETPRIV_EXIT_PRIVERR, _("set parent death signal failed"));
do_landlock(&opts.landlock);
diff --git a/tests/helpers/test_mkfds.c b/tests/helpers/test_mkfds.c
index 60ebdd676..cfaa1f2ac 100644
--- a/tests/helpers/test_mkfds.c
+++ b/tests/helpers/test_mkfds.c
@@ -4372,7 +4372,7 @@ static void list_parameters(const char *factory_name)
static void rename_self(const char *comm)
{
- if (prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0) < 0)
+ if (prctl(PR_SET_NAME, (unsigned long)comm, 0L, 0L, 0L) < 0)
err(EXIT_FAILURE, "failed to rename self via prctl: %s", comm);
}
--
2.45.1
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related
* Re: [PATCH] libmount: provide tree fd even when a mount helper is used
From: Linus Heckemann @ 2024-05-31 14:32 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
In-Reply-To: <20240531094125.r2nvmio47itrtzep@ws.net.home>
Karel Zak <kzak@redhat.com> writes:
> On Thu, May 30, 2024 at 08:00:34PM +0200, Linus Heckemann wrote:
>> Previously, the X-mount.subdir option would fail (mount exited with
>> code 0, but the target was not mounted) when a helper was used.
>
> Do you have any examples that can easily reproduce it?
I encountered this issue with bcachefs (create /foo in the root of a
bcachefs filesystem and then attempt to mount that same filesystem with
X-mount.subdir=foo) but the problem should be the same with any
other filesystem that uses a mount helper.
truncate -s 1G test.img
mkfs.bcachefs test.img
mount -o loop,X-mount.mkdir test.img /tmp/mnt
mkdir /tmp/mnt/foo
umount /tmp/mnt
mount -o loop,X-mount.subdir=foo test.img /tmp/mnt
Without my patch, this exits with status code 0 but does not result in
/tmp/mnt being mounted at all.
>> In addition to fixing X-mount.subdir, this allows dropping the
>> fallback behaviour previously implemented specifically by the
>> set_vfsflags and set_propagation hooks.
>>
>> I realise this patch is not acceptable as is, since I just exported
>> the previously private open_mount_tree symbol from hook_mount.c
>
> Perhaps it is unnecessary to only keep the API file descriptors in
> hook_mount.c. It is a generic feature and we may see more use
> cases where it would make sense to use it in other places.
>
> I can imagine having the file descriptors in the libmnt_context
> structure and initializing them through functions in context.c (which
> would involve renaming open_mount_tree() to something more
> appropriate). It could potentially be a public library function so
> that libmount applications can also utilize it.
>
> I will think about it :-)
Thanks! That sounds like it would make sense, though I'd expect (naively
-- I'm not super familiar with the overall code) it's generally not
desirable to use that function as opposed to using the mount fd from the
context once it's become available through the mount step? I don't see a
particularly strong case for using that and not open_tree directly.
^ permalink raw reply
* Re: [PATCH] libmount: provide tree fd even when a mount helper is used
From: Karel Zak @ 2024-05-31 9:41 UTC (permalink / raw)
To: Linus Heckemann; +Cc: util-linux
In-Reply-To: <20240530180041.3447273-1-git@sphalerite.org>
On Thu, May 30, 2024 at 08:00:34PM +0200, Linus Heckemann wrote:
> Previously, the X-mount.subdir option would fail (mount exited with
> code 0, but the target was not mounted) when a helper was used.
Do you have any examples that can easily reproduce it?
> In addition to fixing X-mount.subdir, this allows dropping the
> fallback behaviour previously implemented specifically by the
> set_vfsflags and set_propagation hooks.
>
> I realise this patch is not acceptable as is, since I just exported
> the previously private open_mount_tree symbol from hook_mount.c
Perhaps it is unnecessary to only keep the API file descriptors in
hook_mount.c. It is a generic feature and we may see more use
cases where it would make sense to use it in other places.
I can imagine having the file descriptors in the libmnt_context
structure and initializing them through functions in context.c (which
would involve renaming open_mount_tree() to something more
appropriate). It could potentially be a public library function so
that libmount applications can also utilize it.
I will think about it :-)
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* [PATCH] libmount: provide tree fd even when a mount helper is used
From: Linus Heckemann @ 2024-05-30 18:00 UTC (permalink / raw)
To: util-linux; +Cc: Linus Heckemann
Previously, the X-mount.subdir option would fail (mount exited with
code 0, but the target was not mounted) when a helper was used.
In addition to fixing X-mount.subdir, this allows dropping the
fallback behaviour previously implemented specifically by the
set_vfsflags and set_propagation hooks.
I realise this patch is not acceptable as is, since I just exported
the previously private open_mount_tree symbol from hook_mount.c
without even adding it to a header (so builds with sensible warning
configurations, with -Werror=implicit-function-declaration, won't even
compile this); but I'm submitting this as is in hopes that someone who
knows their way around libmount will suggest a sensible way to shuffle
the code around.
---
libmount/src/context_mount.c | 15 ++++++++++++++-
libmount/src/hook_mount.c | 20 +-------------------
2 files changed, 15 insertions(+), 20 deletions(-)
diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index 676287733..ef66f47af 100644
--- a/libmount/src/context_mount.c
+++ b/libmount/src/context_mount.c
@@ -482,8 +482,21 @@ static int exec_helper(struct libmnt_context *cxt)
DBG(CXT, ul_debugobj(cxt, "%s forked [status=%d, rc=%d]",
cxt->helper,
cxt->helper_status, rc));
+
+ struct libmnt_sysapi *api = mnt_context_get_sysapi(cxt);
+ assert(api);
+
+ /* a mount helper, unlike an internal mount, won't provide the mount fd.
+ * This is, however, needed by hooks like subdir -- so let's open the tree
+ * that was mounted by our helper child. */
+ if (api->fd_tree < 0 && mnt_fs_get_target(cxt->fs)) {
+ api->fd_tree = open_mount_tree(cxt, NULL, (unsigned long) -1);
+ if (api->fd_tree > 0) {
+ rc = 0;
+ }
+ }
+ break;
}
- break;
}
case -1:
diff --git a/libmount/src/hook_mount.c b/libmount/src/hook_mount.c
index 6b7caff85..b80fe4839 100644
--- a/libmount/src/hook_mount.c
+++ b/libmount/src/hook_mount.c
@@ -255,7 +255,7 @@ static int open_fs_configuration_context(struct libmnt_context *cxt,
return api->fd_fs;
}
-static int open_mount_tree(struct libmnt_context *cxt, const char *path, unsigned long mflg)
+int open_mount_tree(struct libmnt_context *cxt, const char *path, unsigned long mflg)
{
unsigned long oflg = OPEN_TREE_CLOEXEC;
int rc = 0, fd = -1;
@@ -416,15 +416,6 @@ static int set_vfsflags(struct libmnt_context *cxt,
api = get_sysapi(cxt);
assert(api);
- /* fallback only; necessary when init_sysapi() during preparation
- * cannot open the tree -- for example when we call /sbin/mount.<type> */
- if (api->fd_tree < 0 && mnt_fs_get_target(cxt->fs)) {
- rc = api->fd_tree = open_mount_tree(cxt, NULL, (unsigned long) -1);
- if (rc < 0)
- return rc;
- rc = 0;
- }
-
if (recursive)
callflags |= AT_RECURSIVE;
@@ -494,15 +485,6 @@ static int hook_set_propagation(struct libmnt_context *cxt,
api = get_sysapi(cxt);
assert(api);
- /* fallback only; necessary when init_sysapi() during preparation
- * cannot open the tree -- for example when we call /sbin/mount.<type> */
- if (api->fd_tree < 0 && mnt_fs_get_target(cxt->fs)) {
- rc = api->fd_tree = open_mount_tree(cxt, NULL, (unsigned long) -1);
- if (rc < 0)
- goto done;
- rc = 0;
- }
-
mnt_reset_iter(&itr, MNT_ITER_FORWARD);
while (mnt_optlist_next_opt(ol, &itr, &opt) == 0) {
--
2.42.0
^ permalink raw reply related
* Cannot mount overlay fs with long lowerdir paths
From: Vladimir Smelhaus @ 2024-05-22 20:07 UTC (permalink / raw)
To: util-linux
Hello,
mounting overlay fs doesn't work if the command line with referenced lowerdir paths is longer than "something". The change occurred somewhere between versions 2.38.1 and 2.40.1. Tested on Debian with kernel 6.7.12 and 6.8.9, kernel version has no effect. I
never encountered any limit before, until now.
Regards
Vladimír Šmelhaus
^ permalink raw reply
* Re: Parallel build failures with util-linux 2.40
From: Alyssa Ross @ 2024-05-19 8:13 UTC (permalink / raw)
To: Santiago Vila, util-linux; +Cc: Karel Zak
In-Reply-To: <3dfa7d03-f2bf-4d6f-8387-98ec999243bf@debian.org>
[-- Attachment #1: Type: text/plain, Size: 581 bytes --]
Santiago Vila <sanvila@debian.org> writes:
> Hello.
>
> In some cases, make --shuffle option (available in GNU make 4.4)
> "amplifies" the probability that a Makefile bug shows up.
> I suggest that you people give it a try.
>
> There is a blog entry from the author explaining --shuffle option:
>
> https://trofi.github.io/posts/238-new-make-shuffle-mode.html
>
> [ I'm just a long-time lurker in this list, but maybe this could help ]
Thanks for the suggestion, but I tried running with --shuffle for hours
before submitting my report, but wasn't able to reproduce that way. :(
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply
* From Financial Crimes Enforcement Network
From: Financial Crimes Enforcement Network @ 2024-05-19 0:28 UTC (permalink / raw)
To: Financial Crimes Enforcement Network
Notice...
Your fund that was stopped from completion has been released and ready to be transferred indicate if this email id is active for more details
Regards
Mr. Rowland Cole
^ permalink raw reply
* Re: Parallel build failures with util-linux 2.40
From: Santiago Vila @ 2024-05-18 20:15 UTC (permalink / raw)
To: util-linux; +Cc: Alyssa Ross, Karel Zak
In-Reply-To: <87v83auc95.fsf@alyssa.is>
Hello.
In some cases, make --shuffle option (available in GNU make 4.4)
"amplifies" the probability that a Makefile bug shows up.
I suggest that you people give it a try.
There is a blog entry from the author explaining --shuffle option:
https://trofi.github.io/posts/238-new-make-shuffle-mode.html
[ I'm just a long-time lurker in this list, but maybe this could help ]
Thanks.
^ permalink raw reply
* Re: Parallel build failures with util-linux 2.40
From: Alyssa Ross @ 2024-05-18 19:54 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
In-Reply-To: <87eda31219.fsf@alyssa.is>
[-- Attachment #1: Type: text/plain, Size: 5917 bytes --]
Alyssa Ross <hi@alyssa.is> writes:
> Karel Zak <kzak@redhat.com> writes:
>
>> On Tue, May 14, 2024 at 12:01:23PM +0200, Alyssa Ross wrote:
>>> Since updating from util-linux 2.39.3 to 2.40.1 in Nixpkgs, we've been
>>> seeing intermittent parallel build failures like the following:
>>
>> What does it mean "parallel build"? make -j ?
>
> Yeah.
>
>>> libtool: warning(B: relinking 'pam_lastlog2.la'(B libtool: install:
>>> (cd /build/util-linux-2.40.1;
>>> /nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/bin/bash
>>> "/build/util-linux-2.40.1/libtool" --silent --tag CC --mode=relink
>>> gcc -fsigned-char -fno-common -Wall -Wextra
>>> -Waddress-of-packed-member -Wdiscarded-qualifiers -Wformat-security
>>> -Wimplicit-function-declaration -Wmissing-declarations
>>> -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs
>>> -Wno-missing-field-initializers -Wold-style-definition
>>> -Wpointer-arith -Wredundant-decls -Wsign-compare -Wstrict-prototypes
>>> -Wtype-limits -Wuninitialized -Wunused-but-set-parameter
>>> -Wunused-but-set-variable -Wunused-parameter -Wunused-result
>>> -Wunused-variable -Wvla -Walloca -Werror=sequence-point
>>> -I./liblastlog2/src -g -O2 -module -avoid-version -shared
>>> pam_lastlog2_la_LDFLAGS +=
>>
>> I'm not sure, but it seems like you're being affected by an extra "+="
>> in the LDFLAGS. This should be fixed by...
>>
>> https://github.com/util-linux/util-linux/commit/290748729dc3edf9ea1c680c8954441a5e367a44
>> https://github.com/util-linux/util-linux/commit/597e8b246ae31366514ead6cca240a09fe5e1528
>>
>> Can you try your use case with the latest git tree?
>
> Thanks for pointing these out — I've applied the patches to our build,
> but since the failure only happened intermittently, I'm not going to be
> able to tell if it's fixed the issue right away. We'll just have to
> wait and see, and no news will be good news.
Hi, I'm afraid we're still seeing similar failures with those two
patches backported on top of 2.40.1:
/nix/store/3c54hwp1zji0h8yl66860cp8zp2vsrzv-bash-5.2p26/bin/bash ./libtool --mode=install /nix/store/dm0wz420s9n1nbp3731y9iqya0zswyy8-coreutils-9.5/bin/install -c login dmesg mount umount wdctl mountpoint lsblk findmnt kill lsfd pipesz '/nix/store/hxd66fx3rvq1km5hjq6dgx8a6yw7czyd-util-linux-minimal-2.40.1-bin/bin'
libtool: warning: relinking 'pam_lastlog2.la'
libtool: install: (cd /build/util-linux-2.40.1; /nix/store/3c54hwp1zji0h8yl66860cp8zp2vsrzv-bash-5.2p26/bin/bash "/build/util-linux-2.40.1/libtool" --silent --tag CC --mode=relink gcc -fsigned-char -fno-common -Wall -Wextra -Waddress-of-packed-member -Wdiscarded-qualifiers -Wformat-security -Wimplicit-function-declaration -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wno-missing-field-initializers -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wsign-compare -Wstrict-prototypes -Wtype-limits -Wuninitialized -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-parameter -Wunused-result -Wunused-variable -Wvla -Walloca -Werror=sequence-point -I./liblastlog2/src -g -O2 -module -avoid-version -shared -Wl,--version-script,./pam_lastlog2/src/pam_lastlog2.sym -o pam_lastlog2.la -rpath /nix/store/dsxjv3a5aj1f4pifv5a6rvpj7zk00vyx-util-linux-minimal-2.40.1-lib/lib/security pam_lastlog2/src/la-pam_lastlog2.lo liblastlog2.la )
libtool: install: /nix/store/dm0wz420s9n1nbp3731y9iqya0zswyy8-coreutils-9.5/bin/install -c login /nix/store/hxd66fx3rvq1km5hjq6dgx8a6yw7czyd-util-linux-minimal-2.40.1-bin/bin/login
libtool: install: /nix/store/dm0wz420s9n1nbp3731y9iqya0zswyy8-coreutils-9.5/bin/install -c dmesg /nix/store/hxd66fx3rvq1km5hjq6dgx8a6yw7czyd-util-linux-minimal-2.40.1-bin/bin/dmesg
libtool: warning: 'libmount.la' has not been installed in '/nix/store/dsxjv3a5aj1f4pifv5a6rvpj7zk00vyx-util-linux-minimal-2.40.1-lib/lib'
libtool: warning: '/build/util-linux-2.40.1/libblkid.la' has not been installed in '/nix/store/dsxjv3a5aj1f4pifv5a6rvpj7zk00vyx-util-linux-minimal-2.40.1-lib/lib'
libtool: install: /nix/store/dm0wz420s9n1nbp3731y9iqya0zswyy8-coreutils-9.5/bin/install -c .libs/mount /nix/store/hxd66fx3rvq1km5hjq6dgx8a6yw7czyd-util-linux-minimal-2.40.1-bin/bin/mount
libtool: warning: 'libmount.la' has not been installed in '/nix/store/dsxjv3a5aj1f4pifv5a6rvpj7zk00vyx-util-linux-minimal-2.40.1-lib/lib'
libtool: warning: '/build/util-linux-2.40.1/libblkid.la' has not been installed in '/nix/store/dsxjv3a5aj1f4pifv5a6rvpj7zk00vyx-util-linux-minimal-2.40.1-lib/lib'
libtool: install: /nix/store/dm0wz420s9n1nbp3731y9iqya0zswyy8-coreutils-9.5/bin/install -c .libs/umount /nix/store/hxd66fx3rvq1km5hjq6dgx8a6yw7czyd-util-linux-minimal-2.40.1-bin/bin/umount
libtool: warning: 'libsmartcols.la' has not been installed in '/nix/store/dsxjv3a5aj1f4pifv5a6rvpj7zk00vyx-util-linux-minimal-2.40.1-lib/lib'
libtool: install: /nix/store/dm0wz420s9n1nbp3731y9iqya0zswyy8-coreutils-9.5/bin/install -c .libs/wdctl /nix/store/hxd66fx3rvq1km5hjq6dgx8a6yw7czyd-util-linux-minimal-2.40.1-bin/bin/wdctl
/nix/store/8qjkvnam69dm0r9lhirxy1ngzbsh6a8z-binutils-2.41/bin/ld: cannot find -llastlog2: No such file or directory
libtool: warning: 'libmount.la' has not been installed in '/nix/store/dsxjv3a5aj1f4pifv5a6rvpj7zk00vyx-util-linux-minimal-2.40.1-lib/lib'
collect2: error: ld returned 1 exit status
libtool: warning: '/build/util-linux-2.40.1/libblkid.la' has not been installed in '/nix/store/dsxjv3a5aj1f4pifv5a6rvpj7zk00vyx-util-linux-minimal-2.40.1-lib/lib'
libtool: error: error: relink 'pam_lastlog2.la' with the above command before installing it
make[3]: *** [Makefile:7603: install-securelibLTLIBRARIES] Error 1
Full log:
https://hydra.nixos.org/build/260133082/nixlog/11/raw
I wish I could provide more helpful information, but since it doesn't
happen consistently it's hard to collect any.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply
* Re: Parallel build failures with util-linux 2.40
From: Alyssa Ross @ 2024-05-15 16:18 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
In-Reply-To: <20240515142226.oyp37o3fkajvpoal@ws.net.home>
[-- Attachment #1: Type: text/plain, Size: 1854 bytes --]
Karel Zak <kzak@redhat.com> writes:
> On Tue, May 14, 2024 at 12:01:23PM +0200, Alyssa Ross wrote:
>> Since updating from util-linux 2.39.3 to 2.40.1 in Nixpkgs, we've been
>> seeing intermittent parallel build failures like the following:
>
> What does it mean "parallel build"? make -j ?
Yeah.
>> libtool: warning(B: relinking 'pam_lastlog2.la'(B libtool: install:
>> (cd /build/util-linux-2.40.1;
>> /nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/bin/bash
>> "/build/util-linux-2.40.1/libtool" --silent --tag CC --mode=relink
>> gcc -fsigned-char -fno-common -Wall -Wextra
>> -Waddress-of-packed-member -Wdiscarded-qualifiers -Wformat-security
>> -Wimplicit-function-declaration -Wmissing-declarations
>> -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs
>> -Wno-missing-field-initializers -Wold-style-definition
>> -Wpointer-arith -Wredundant-decls -Wsign-compare -Wstrict-prototypes
>> -Wtype-limits -Wuninitialized -Wunused-but-set-parameter
>> -Wunused-but-set-variable -Wunused-parameter -Wunused-result
>> -Wunused-variable -Wvla -Walloca -Werror=sequence-point
>> -I./liblastlog2/src -g -O2 -module -avoid-version -shared
>> pam_lastlog2_la_LDFLAGS +=
>
> I'm not sure, but it seems like you're being affected by an extra "+="
> in the LDFLAGS. This should be fixed by...
>
> https://github.com/util-linux/util-linux/commit/290748729dc3edf9ea1c680c8954441a5e367a44
> https://github.com/util-linux/util-linux/commit/597e8b246ae31366514ead6cca240a09fe5e1528
>
> Can you try your use case with the latest git tree?
Thanks for pointing these out — I've applied the patches to our build,
but since the failure only happened intermittently, I'm not going to be
able to tell if it's fixed the issue right away. We'll just have to
wait and see, and no news will be good news.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply
* Re: Parallel build failures with util-linux 2.40
From: Karel Zak @ 2024-05-15 14:22 UTC (permalink / raw)
To: Alyssa Ross; +Cc: util-linux
In-Reply-To: <87le4c1zm4.fsf@alyssa.is>
On Tue, May 14, 2024 at 12:01:23PM +0200, Alyssa Ross wrote:
> Since updating from util-linux 2.39.3 to 2.40.1 in Nixpkgs, we've been
> seeing intermittent parallel build failures like the following:
What does it mean "parallel build"? make -j ?
> libtool: warning(B: relinking 'pam_lastlog2.la'(B libtool: install:
> (cd /build/util-linux-2.40.1;
> /nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/bin/bash
> "/build/util-linux-2.40.1/libtool" --silent --tag CC --mode=relink
> gcc -fsigned-char -fno-common -Wall -Wextra
> -Waddress-of-packed-member -Wdiscarded-qualifiers -Wformat-security
> -Wimplicit-function-declaration -Wmissing-declarations
> -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs
> -Wno-missing-field-initializers -Wold-style-definition
> -Wpointer-arith -Wredundant-decls -Wsign-compare -Wstrict-prototypes
> -Wtype-limits -Wuninitialized -Wunused-but-set-parameter
> -Wunused-but-set-variable -Wunused-parameter -Wunused-result
> -Wunused-variable -Wvla -Walloca -Werror=sequence-point
> -I./liblastlog2/src -g -O2 -module -avoid-version -shared
> pam_lastlog2_la_LDFLAGS +=
I'm not sure, but it seems like you're being affected by an extra "+="
in the LDFLAGS. This should be fixed by...
https://github.com/util-linux/util-linux/commit/290748729dc3edf9ea1c680c8954441a5e367a44
https://github.com/util-linux/util-linux/commit/597e8b246ae31366514ead6cca240a09fe5e1528
Can you try your use case with the latest git tree?
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* Parallel build failures with util-linux 2.40
From: Alyssa Ross @ 2024-05-14 10:01 UTC (permalink / raw)
To: util-linux
[-- Attachment #1: Type: text/plain, Size: 2417 bytes --]
Hi,
Since updating from util-linux 2.39.3 to 2.40.1 in Nixpkgs, we've been
seeing intermittent parallel build failures like the following:
libtool: warning(B: relinking 'pam_lastlog2.la'(B
libtool: install: (cd /build/util-linux-2.40.1; /nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/bin/bash "/build/util-linux-2.40.1/libtool" --silent --tag CC --mode=relink gcc -fsigned-char -fno-common -Wall -Wextra -Waddress-of-packed-member -Wdiscarded-qualifiers -Wformat-security -Wimplicit-function-declaration -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wno-missing-field-initializers -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wsign-compare -Wstrict-prototypes -Wtype-limits -Wuninitialized -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-parameter -Wunused-result -Wunused-variable -Wvla -Walloca -Werror=sequence-point -I./liblastlog2/src -g -O2 -module -avoid-version -shared pam_lastlog2_la_LDFLAGS += -Wl,--version-script,./pam_lastlog2/src/pam_lastlog2.sym -o pam_lastlog2.la -rpath /nix/store/ri9wphsskq6ygxigvlbahb9mz379qiz5-util-linux-2.40.1-lib/lib/security pam_lastlog2/src/la-pam_lastlog2.lo liblastlog2.la )
libtool: warning(B: 'libmount.la' has not been installed in '/nix/store/ri9wphsskq6ygxigvlbahb9mz379qiz5-util-linux-2.40.1-lib/lib'(B
libtool: warning(B: '/build/util-linux-2.40.1/libblkid.la' has not been installed in '/nix/store/ri9wphsskq6ygxigvlbahb9mz379qiz5-util-linux-2.40.1-lib/lib'(B
libtool: install: /nix/store/php4qidg2bxzmm79vpri025bqi0fa889-coreutils-9.5/bin/install -c .libs/mount /nix/store/v6ff7704fchg30kj4z422693lgnnmmbn-util-linux-2.40.1-bin/bin/mount
/nix/store/bgcaxhhxswzvmxjbbgvvaximm5hwghz1-binutils-2.41/bin/ld: cannot find -llastlog2: No such file or directory
collect2: error: ld returned 1 exit status
libtool: warning(B: 'libmount.la' has not been installed in '/nix/store/ri9wphsskq6ygxigvlbahb9mz379qiz5-util-linux-2.40.1-lib/lib'(B
libtool: warning(B: '/build/util-linux-2.40.1/libblkid.la' has not been installed in '/nix/store/ri9wphsskq6ygxigvlbahb9mz379qiz5-util-linux-2.40.1-lib/lib'(B
libtool: error(B: error: relink 'pam_lastlog2.la' with the above command before installing it(B
make[3]: *** [Makefile:7598: install-securelibLTLIBRARIES] Error 1
Full log:
https://cache.nixos.org/log/pp817g4wf18pn7hrn4a7377yxf06bprw-util-linux-2.40.1.drv
Alyssa Ross
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply
* Re: luks2: need to check the availability of a JSON area
From: Milan Broz @ 2024-05-09 10:00 UTC (permalink / raw)
To: Vitalii Hordii, util-linux
In-Reply-To: <DBBP194MB111315092E137148D78773F3B0E52@DBBP194MB1113.EURP194.PROD.OUTLOOK.COM>
On 5/8/24 6:07 PM, Vitalii Hordii wrote:
> Hello,
>
> I had some problems with restoring a luks2 partition after using, for
> example, mkfs.ntfs because it only leaves a 2nd JSON area without a
> secondary binary header, which I had to create myself. What if there was
> a function in libblkid that allows one to determine if there is a 2nd
> JSON and if there is a chance of recovery? Because as I see here,
> automatically repairing
> https://gitlab.com/cryptsetup/cryptsetup/-/issues/750 is apparently
> missing due to the lack of checking if there is an area here in
> libblkid. Also this seems to be a pretty popular problem on the internet
> when it comes to installing other operating systems. Would it be okay to
> add such a feature?
Hi,
Blkid already scans for *valid* 2nd LUKS2 header.
If the binary area for LUKS2 is missing, the header corrupted. Blkid
should not touch JSON metadata at all (JSON on-disk follows binary area).
Binary area was specifically designed for blkid use to be fast and do
not require any advanced metadata parsing.
So there is nothing to fix in blkid.
What we can add to cryptsetup repair command is to check
for specific case when wipefs marks LUKS2 binary area unusable
(this case can be easily recovered as it overwrites magic string only).
But I doubt mkfs format will touch only magic string, if the keyslot area
is (even partially) overwritten, the LUKS2 header is unusable anyway.
You should have a backup to recover data, not rely on a magic recovery.
Milan
^ permalink raw reply
* luks2: need to check the availability of a JSON area
From: Vitalii Hordii @ 2024-05-08 16:07 UTC (permalink / raw)
To: util-linux, gmazyland
Hello,
I had some problems with restoring a luks2 partition after using, for
example, mkfs.ntfs because it only leaves a 2nd JSON area without a
secondary binary header, which I had to create myself. What if there was
a function in libblkid that allows one to determine if there is a 2nd
JSON and if there is a chance of recovery? Because as I see here,
automatically repairing
https://gitlab.com/cryptsetup/cryptsetup/-/issues/750 is apparently
missing due to the lack of checking if there is an area here in
libblkid. Also this seems to be a pretty popular problem on the internet
when it comes to installing other operating systems. Would it be okay to
add such a feature?
Best regards, Vitalii
^ permalink raw reply
* [ANNOUNCE] util-linux stable v2.40.1
From: Karel Zak @ 2024-05-06 8:51 UTC (permalink / raw)
To: linux-kernel, linux-fsdevel, util-linux
The util-linux maintenance release v2.40.1 is now available at:
http://www.kernel.org/pub/linux/utils/util-linux/v2.40/
Feedback and bug reports, as always, are welcomed.
Karel
util-linux v2.40.1 Release Notes
================================
Changes between v2.40 and v2.40.1
---------------------------------
README.licensing/flock:
- Add MIT license mention [Richard Purdie]
agetty:
- Don't override TERM passed by the user [Daan De Meyer]
- fix resource leak [Karel Zak]
- make reload code more robust [Karel Zak]
all_syscalls:
- don't hardcode AWK invocation [Thomas Weißschuh]
- don't warn during cleanup [Thomas Weißschuh]
- fail if any step fails [Thomas Weißschuh]
- use sed to extract defines from headers [Thomas Weißschuh]
autotools:
- distribute pam_lastlog2/meson.build [Thomas Weißschuh]
bcachefs:
- Remove BCACHEFS_SB_MAX_SIZE & check [Tony Asleson]
build-sys:
- release++ (v2.40.1-rc1) [Karel Zak]
cal:
- use unsigned int to follow union with unsigned int [Karel Zak]
docs:
- add COPYING.MIT [Karel Zak]
- fix GPL name typo [Karel Zak]
- update AUTHORS file [Karel Zak]
- update v2.40.1-ReleaseNotes [Karel Zak]
findmnt:
- always zero-terminate SOURCES data [Thomas Weißschuh]
- revise the code for -I and -D option [Masatake YAMATO]
fsck.minix:
- fix possible overrun [Karel Zak]
getopt:
- remove free-before-exit [Karel Zak]
hwclock:
- free temporary variable before return [Karel Zak]
- initialize parser variables [Karel Zak]
lastlog2:
- begin descriptions of options with a lowercase letter [Benno Schulenberg]
lib/pager:
libblkid:
- Fix segfault when blkid.conf doesn't exist [Karel Zak]
- topology/ioctl correctly handle kernel types [Thomas Weißschuh]
- topology/ioctl simplify ioctl handling [Thomas Weißschuh]
libfdisk:
- add initializer to geometry [Karel Zak]
libmount:
- Fix access check for utab in context [Karel Zak]
- fix comment typo for mnt_fs_get_comment() [Tianjia Zhang]
- fix possible memory leak [Karel Zak]
- fix umount --read-only [Karel Zak]
libsmartcols:
- fix column reduction [Karel Zak]
- reset wrap after calculation [Karel Zak]
libuuid:
- (man) fix function declarations [CismonX]
losetup:
- losetup.8 Clarify --direct-io [Colin Walters]
lsblk:
- simplify SOURCES code [Karel Zak]
lsclocks:
- fix FD leak [Karel Zak]
lsfd:
- (man) fix license name [Jakub Wilk]
- add LSFD_DEBUG env var for debugging [Masatake YAMATO]
lslocks:
- don't abort gathering per-process information even if opening a /proc/[0-9]* fails [Masatake YAMATO]
- remove a unused local variable [Masatake YAMATO]
lsns:
- fix netns use [Karel Zak]
- report with warnx if a namespace related ioctl fails with ENOSYS [Masatake YAMATO]
- tolerate lsns_ioctl(fd, NS_GET_{PARENT,USERNS}) failing with ENOSYS [Masatake YAMATO]
meson:
- Add build-blkdiscard option [Jordan Williams]
- Add build-blkpr option [Jordan Williams]
- Add build-blkzone option [Jordan Williams]
- Add build-blockdev option [Jordan Williams]
- Add build-chcpu option [Jordan Williams]
- Add build-dmesg option [Jordan Williams]
- Add build-enosys option [Jordan Williams]
- Add build-fadvise option [Jordan Williams]
- Add build-fsfreeze option [Jordan Williams]
- Add build-ipcmk option [Jordan Williams]
- Add build-ldattach option [Jordan Williams]
- Add build-lsclocks option [Jordan Williams]
- Add build-lsfd option and make rt dependency optional [Jordan Williams]
- Add build-rtcwake option [Jordan Williams]
- Add build-script option [Jordan Williams]
- Add build-scriptlive option [Jordan Williams]
- Add build-setarch option [Jordan Williams]
- Add have_pty variable to check if pty is available [Jordan Williams]
- Add missing check for build-ipcrm option [Jordan Williams]
- Define _DARWIN_C_SOURCE on macOS as is done in Autotools [Jordan Williams]
- Don't define HAVE_ENVIRON_DECL when environ is unavailable [Jordan Williams]
- Fix build by default and install behavior for build-pipesz option [Jordan Williams]
- Fix false positive detection of mempcpy on macOS [Jordan Williams]
- Only build libmount when required [Jordan Williams]
- Only pick up the rt library once [Jordan Williams]
- Only require the crypt library when necessary [Jordan Williams]
- Only use the --version-script linker flag where it is supported [Jordan Williams]
- Remove libblkid dependency on libmount [Jordan Williams]
- Remove lingering mq_libs variable [Jordan Williams]
- Require pty for the su and runuser executables [Jordan Williams]
- Require the seminfo type for ipcmk, ipcrm, and ipcs [Jordan Williams]
- Use has_type instead of sizeof to detect cpu_set_t type [Jordan Williams]
- Use libblkid as a dependency [Jordan Williams]
- Use libmount as a dependency [Jordan Williams]
- respect c_args/CFLAGS when generating syscalls [Karel Zak]
pam_lastlog2:
- link against liblastlog [Thomas Weißschuh]
po:
- merge changes [Karel Zak]
- update cs.po (from translationproject.org) [Petr Písař]
- update fr.po (from translationproject.org) [Frédéric Marchal]
- update hr.po (from translationproject.org) [Božidar Putanec]
- update ja.po (from translationproject.org) [Takeshi Hamasaki]
- update ko.po (from translationproject.org) [Seong-ho Cho]
- update pl.po (from translationproject.org) [Jakub Bogusz]
- update ro.po (from translationproject.org) [Remus-Gabriel Chelu]
- update uk.po (from translationproject.org) [Yuri Chornoivan]
po-man:
- merge changes [Karel Zak]
- update de.po (from translationproject.org) [Mario Blättermann]
- update ko.po (from translationproject.org) [Seong-ho Cho]
- update ro.po (from translationproject.org) [Remus-Gabriel Chelu]
strutils.h:
- Include strings.h header for strncasecmp function [Jordan Williams]
tests:
- (lsfd mkfds-multiplexing) skip if /proc/$pid/syscall is broken [Masatake YAMATO]
- (lsns ioctl_ns) add more debug print [Masatake YAMATO]
- (lsns ioctl_ns) record stdout/stderr for debugging the case [Masatake YAMATO]
- (test_mkfds sockdiag) verify the recieved message to detect whether the socket is usable or not [Masatake YAMATO]
textual:
- fix some typos and inconsistencies in usage and error messages [Benno Schulenberg]
wall:
- check sysconf() returnvalue [Karel Zak]
- fix possible memory leak [Karel Zak]
- make sure unsigned variable not underflow [Karel Zak]
xalloc.h:
- Include stdio.h header for vasprintf function [Jordan Williams]
^ permalink raw reply
* Re: [PATCH 1/2] textual: fix some typos and inconsistencies in usage and error messages
From: Karel Zak @ 2024-05-01 20:53 UTC (permalink / raw)
To: Benno Schulenberg; +Cc: util-linux, Petr Pisar
In-Reply-To: <9397da62-de57-429c-9f3d-9be26ec1cd76@telfort.nl>
On Tue, Apr 30, 2024 at 04:07:28PM +0200, Benno Schulenberg wrote:
> Looking forward to the URL of the stable rc1 tarball
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/util-linux-2.40.1-rc1.tar.xz
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* [ANNOUNCE] util-linux v2.40.1-rc1
From: Karel Zak @ 2024-05-01 20:52 UTC (permalink / raw)
To: util-linux
The util-linux release v2.40.1-rc1 is available at
http://www.kernel.org/pub/linux/utils/util-linux/v2.40/
Feedback and bug reports, as always, are welcomed.
Karel
util-linux v2.40.1 Release Notes
================================
Changes between v2.40 and v2.40.1
---------------------------------
README.licensing/flock:
- Add MIT license mention [Richard Purdie]
agetty:
- Don't override TERM passed by the user [Daan De Meyer]
all_syscalls:
- don't hardcode AWK invocation [Thomas Weißschuh]
- don't warn during cleanup [Thomas Weißschuh]
- fail if any step fails [Thomas Weißschuh]
- use sed to extract defines from headers [Thomas Weißschuh]
autotools:
- distribute pam_lastlog2/meson.build [Thomas Weißschuh]
bcachefs:
- Remove BCACHEFS_SB_MAX_SIZE & check [Tony Asleson]
docs:
- add COPYING.MIT [Karel Zak]
- fix GPL name typo [Karel Zak]
- update AUTHORS file [Karel Zak]
findmnt:
- always zero-terminate SOURCES data [Thomas Weißschuh]
- revise the code for -I and -D option [Masatake YAMATO]
lastlog2:
- begin descriptions of options with a lowercase letter [Benno Schulenberg]
lib/pager:
libblkid:
- Fix segfault when blkid.conf doesn't exist [Karel Zak]
- topology/ioctl correctly handle kernel types [Thomas Weißschuh]
- topology/ioctl simplify ioctl handling [Thomas Weißschuh]
libmount:
- Fix access check for utab in context [Karel Zak]
- fix comment typo for mnt_fs_get_comment() [Tianjia Zhang]
- fix umount --read-only [Karel Zak]
libsmartcols:
- fix column reduction [Karel Zak]
- reset wrap after calculation [Karel Zak]
libuuid:
- (man) fix function declarations [CismonX]
losetup:
- losetup.8 Clarify --direct-io [Colin Walters]
lsblk:
- simplify SOURCES code [Karel Zak]
lsfd:
- (man) fix license name [Jakub Wilk]
- add LSFD_DEBUG env var for debugging [Masatake YAMATO]
lslocks:
- don't abort gathering per-process information even if opening a /proc/[0-9]* fails [Masatake YAMATO]
- remove a unused local variable [Masatake YAMATO]
lsns:
- fix netns use [Karel Zak]
- report with warnx if a namespace related ioctl fails with ENOSYS [Masatake YAMATO]
- tolerate lsns_ioctl(fd, NS_GET_{PARENT,USERNS}) failing with ENOSYS [Masatake YAMATO]
meson:
- Add build-blkdiscard option [Jordan Williams]
- Add build-blkpr option [Jordan Williams]
- Add build-blkzone option [Jordan Williams]
- Add build-blockdev option [Jordan Williams]
- Add build-chcpu option [Jordan Williams]
- Add build-dmesg option [Jordan Williams]
- Add build-enosys option [Jordan Williams]
- Add build-fadvise option [Jordan Williams]
- Add build-fsfreeze option [Jordan Williams]
- Add build-ipcmk option [Jordan Williams]
- Add build-ldattach option [Jordan Williams]
- Add build-lsclocks option [Jordan Williams]
- Add build-lsfd option and make rt dependency optional [Jordan Williams]
- Add build-rtcwake option [Jordan Williams]
- Add build-script option [Jordan Williams]
- Add build-scriptlive option [Jordan Williams]
- Add build-setarch option [Jordan Williams]
- Add have_pty variable to check if pty is available [Jordan Williams]
- Add missing check for build-ipcrm option [Jordan Williams]
- Define _DARWIN_C_SOURCE on macOS as is done in Autotools [Jordan Williams]
- Don't define HAVE_ENVIRON_DECL when environ is unavailable [Jordan Williams]
- Fix build by default and install behavior for build-pipesz option [Jordan Williams]
- Fix false positive detection of mempcpy on macOS [Jordan Williams]
- Only build libmount when required [Jordan Williams]
- Only pick up the rt library once [Jordan Williams]
- Only require the crypt library when necessary [Jordan Williams]
- Only use the --version-script linker flag where it is supported [Jordan Williams]
- Remove libblkid dependency on libmount [Jordan Williams]
- Remove lingering mq_libs variable [Jordan Williams]
- Require pty for the su and runuser executables [Jordan Williams]
- Require the seminfo type for ipcmk, ipcrm, and ipcs [Jordan Williams]
- Use has_type instead of sizeof to detect cpu_set_t type [Jordan Williams]
- Use libblkid as a dependency [Jordan Williams]
- Use libmount as a dependency [Jordan Williams]
- respect c_args/CFLAGS when generating syscalls [Karel Zak]
pam_lastlog2:
- link against liblastlog [Thomas Weißschuh]
po:
- merge changes [Karel Zak]
po-man:
- merge changes [Karel Zak]
strutils.h:
- Include strings.h header for strncasecmp function [Jordan Williams]
tests:
- (lsfd mkfds-multiplexing) skip if /proc/$pid/syscall is broken [Masatake YAMATO]
- (lsns ioctl_ns) add more debug print [Masatake YAMATO]
- (lsns ioctl_ns) record stdout/stderr for debugging the case [Masatake YAMATO]
- (test_mkfds sockdiag) verify the recieved message to detect whether the socket is usable or not [Masatake YAMATO]
textual:
- fix some typos and inconsistencies in usage and error messages [Benno Schulenberg]
xalloc.h:
- Include stdio.h header for vasprintf function [Jordan Williams]
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* Re: umount -r broken due to "mountinfo unnecessary"
From: Karel Zak @ 2024-05-01 19:30 UTC (permalink / raw)
To: Krzysztof Olędzki; +Cc: util-linux
In-Reply-To: <fa4da8a2-010c-4bed-9d62-a0fee7646bf3@ans.pl>
On Tue, Apr 30, 2024 at 09:31:54PM -0700, Krzysztof Olędzki wrote:
> On 24.04.2024 at 03:15, Karel Zak wrote:
> > On Tue, Apr 23, 2024 at 07:35:18AM -0700, Krzysztof Olędzki wrote:
> >> When is the next release planned?
> >
> > I plan to release v2.40.1 next week.
>
> Thanks you! However, the patch is still missing in the stable/v2.40
> branch. Sorry for the noise if this WAI, just don't want it to be
> accidentally missed.
Cherry-picked to the branch now.
> BTW: v2.39.4 tag seems to be missing? https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tag/?h=v2.39.4
Ah, fixed now.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* Re: umount -r broken due to "mountinfo unnecessary"
From: Krzysztof Olędzki @ 2024-05-01 4:31 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
In-Reply-To: <20240424101535.4tvyms63egfwlw46@ws.net.home>
On 24.04.2024 at 03:15, Karel Zak wrote:
> On Tue, Apr 23, 2024 at 07:35:18AM -0700, Krzysztof Olędzki wrote:
>> When is the next release planned?
>
> I plan to release v2.40.1 next week.
Thanks you! However, the patch is still missing in the stable/v2.40 branch. Sorry for the noise if this WAI, just don't want it to be accidentally missed.
>
>> Also, do you expect a backport to stable/v2.39 and v2.39.5?
>
> I have cherry-picked it to stable/v2.39. Currently, I have no plans
> for v2.39.5.
Understood, thanks!
BTW: v2.39.4 tag seems to be missing? https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tag/?h=v2.39.4
Krzysztof
^ permalink raw reply
* Re: [PATCH 1/2] textual: fix some typos and inconsistencies in usage and error messages
From: Benno Schulenberg @ 2024-04-30 14:07 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux, Petr Pisar
In-Reply-To: <20240429193802.cflzk47hgjrlsq5f@ws.net.home>
[-- Attachment #1.1: Type: text/plain, Size: 950 bytes --]
Op 29-04-2024 om 21:38 schreef Karel Zak:
> On Mon, Apr 29, 2024 at 04:58:35PM +0200, Benno Schulenberg wrote:
>> Hmm... I don't think it's a good idea to apply it to the stable/v2.40
>> branch, as it invalidates any translations that were made for these
>> strings. It would be okay if you first offer a new POT file to the
>> TP before making the next stable dot release.
>
> Good point. I believe we can begin implementing rc1 for stable
> releases, with a short period of time for translators to make any
> necessary changes. For instance, we could release rc1 on Wednesday and
> the final version on Monday.
That would be great. Five days is easily enough for a few adjustments.
> Since the stable/ branch is now being more actively maintained, it
> would be beneficial to involve TP in the process too.
>
> Does it make sense?
It does. Thanks.
Looking forward to the URL of the stable rc1 tarball
Benno
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply
* Re: [PATCH 1/2] textual: fix some typos and inconsistencies in usage and error messages
From: Karel Zak @ 2024-04-29 19:38 UTC (permalink / raw)
To: Benno Schulenberg; +Cc: util-linux, Petr Pisar
In-Reply-To: <4582ffa0-e5fb-42ca-9b4f-a6a0bc67bed2@telfort.nl>
On Mon, Apr 29, 2024 at 04:58:35PM +0200, Benno Schulenberg wrote:
>
> Op 29-04-2024 om 14:35 schreef Karel Zak:
> > Applied (to master and stable/v2.40), thanks!
>
> Hmm... I don't think it's a good idea to apply it to the stable/v2.40
> branch, as it invalidates any translations that were made for these
> strings. It would be okay if you first offer a new POT file to the
> TP before making the next stable dot release.
Good point. I believe we can begin implementing rc1 for stable
releases, with a short period of time for translators to make any
necessary changes. For instance, we could release rc1 on Wednesday and
the final version on Monday.
Since the stable/ branch is now being more actively maintained, it
would be beneficial to involve TP in the process too.
Does it make sense?
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* Re: [Pkg-utopia-maintainers] Bug#1070019: udisks2: autopkgtest failure: fsconfig system call failed: /dev/sr1: Can't open blockdev
From: Chris Hofstaedtler @ 2024-04-29 17:52 UTC (permalink / raw)
To: util-linux; +Cc: Michael Biebl, 1070019
In-Reply-To: <ngnnmq6rsi6ohuipejqw4ussgtbur3nab5nnvx3vqrfhlrvfvk@67u5ihxjhcri>
* Chris Hofstaedtler <zeha@debian.org> [240429 15:24]:
> > udisks2's autopkgtest fails when tried together with util-linux 2.40. An
> > example can be seen here:
> > https://ci.debian.net/packages/u/udisks2/testing/amd64/46012968/
> >
> > 537s ======================================================================
> > 537s FAIL: test_ext4 (__main__.FS.test_ext4)
> > 537s fs: ext4
> > 537s ----------------------------------------------------------------------
> > 537s Traceback (most recent call last):
> > 537s File "/tmp/autopkgtest.btnhgm/build.cz4/src/src/tests/integration-test", line 1107, in _do_udisks_check
> > 537s cd_fs.call_mount_sync(ro_options, None)
> > 537s gi.repository.GLib.GError: udisks-error-quark: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error mounting /dev/sr1 at /media/root/41b1acb1-744c-422a-9071-2dba5368a683: fsconfig system call failed: /dev/sr1: Can't open blockdev (0)
> > 537s
> > 537s During handling of the above exception, another exception occurred:
> > 537s
> > 537s Traceback (most recent call last):
> > 537s File "/tmp/autopkgtest.btnhgm/build.cz4/src/src/tests/integration-test", line 725, in test_ext4
> > 537s self._do_fs_check('ext4')
> > 537s File "/tmp/autopkgtest.btnhgm/build.cz4/src/src/tests/integration-test", line 894, in _do_fs_check
> > 537s self._do_udisks_check(fs_type)
> > 537s File "/tmp/autopkgtest.btnhgm/build.cz4/src/src/tests/integration-test", line 1112, in _do_udisks_check
> > 537s self.fail('Mounting read-only device with \'rw\' option failed'
> > 537s AssertionError: Mounting read-only device with 'rw' option failedwith an unexpected error.
> > 537s Got: udisks-error-quark: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error mounting /dev/sr1 at /media/root/41b1acb1-744c-422a-9071-2dba5368a683: fsconfig system call failed: /dev/sr1: Can't open blockdev (0)
> > 537s Expected: 'is write-protected but explicit read-write mode requested' or 'is write-protected but `rw' option given'
> I won't get to it this week (also re: stable v2.40.1), but maybe
> someone else has seen this failure already?
Having said that, it seems likely the test was broken by this
change in util-linux:
libmount: report kernel message from new API
https://github.com/util-linux/util-linux/commit/9da5644e414cdc318f0311260dabc6035c85b58e
I don't know if the error messages are supposed to be stable or not,
but it looks like a very intentional change :-)
Orthogonally, "/dev/sr1: Can't open blockdev" seems not very
informative if it's supposed to mean "write-protected but `rw'
option given".
Chris
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox