Bug#954294: linux: __X32_SYSCALL_BIT being defined as UL constant breaks userspace (was Re: libseccomp-dev: API break: SCMP_SYS() is unsigned long (was Re: Bug#954294: systemd: FTBFS on x32 due to for

2020-04-08 Thread Thorsten Glaser
On Wed, 8 Apr 2020, Ben Hutchings wrote:

> You should not expect me to spend time talking to upstream about non-
> release architectures.  That is way down the priority list.

DevRef §5.8.3.(6) is a “must”, but you’re lucky: it turns out that
this is a recent isolated change, so I can write to the persons in
that commit. (Will do so in a follow-up mail, so they’re not confu‐
sed by Debian specifics.)

The rationale for DevRef §5.8.3.(6) is that I, as user, would not
know whom to contact on the upstream side: especially with the
Linux kernel, there’s tons of maintainers, subsystems, mailing
lists, etc. and I’d not have an idea where to contact. (Luckily,
I *was* able to isolate it… this time. But I expect you to do at
least the talking, generally.)

bye,
//mirabilos
-- 
tarent solutions GmbH
Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/
Tel: +49 228 54881-393 • Fax: +49 228 54881-235
HRB 5168 (AG Bonn) • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

**

Mit der tarent Academy bieten wir auch Trainings und Schulungen in den
Bereichen Softwareentwicklung, Agiles Arbeiten und Zukunftstechnologien an.

Besuchen Sie uns auf www.tarent.de/academy. Wir freuen uns auf Ihren Kontakt.

**



Bug#954294: linux: __X32_SYSCALL_BIT being defined as UL constant breaks userspace (was Re: libseccomp-dev: API break: SCMP_SYS() is unsigned long (was Re: Bug#954294: systemd: FTBFS on x32 due to for

2020-04-08 Thread Ben Hutchings
On Tue, 2020-04-07 at 14:40 +0200, Thorsten Glaser wrote:
> Dear kernel team,
> 
> libseccomp uses the __NR_* constants from  in its
> macro SCMP_SYS() which is designed to return int.
> 
> However, on x32 some codes return unsigned long instead, breaking this.
> The cause is that this…
> 
> > /usr/include/x86_64-linux-gnux32/asm/unistd.h:#define __X32_SYSCALL_BIT 
> > 0x4000UL
> 
> … is OR’d into the numbers.
> 
> I’d like to propose the change…
> -#define __X32_SYSCALL_BIT 0x4000UL
> +#define __X32_SYSCALL_BIT 0x4000
> … which should be safe to do as the number fits into signed int,
> but must be checked against other users (especially in the kernel
> itself I’d guess).
> 
> This should also technically be correct, since on all(?) other
> architectures syscall numbers are int constants.
> 
> Please forward this to upstream.

You should not expect me to spend time talking to upstream about non-
release architectures.  That is way down the priority list.

Ben.

-- 
Ben Hutchings
It's easier to fight for one's principles than to live up to them.




signature.asc
Description: This is a digitally signed message part


Bug#954294: linux: __X32_SYSCALL_BIT being defined as UL constant breaks userspace (was Re: libseccomp-dev: API break: SCMP_SYS() is unsigned long (was Re: Bug#954294: systemd: FTBFS on x32 due to for

2020-04-07 Thread Thorsten Glaser
Dear kernel team,

libseccomp uses the __NR_* constants from  in its
macro SCMP_SYS() which is designed to return int.

However, on x32 some codes return unsigned long instead, breaking this.
The cause is that this…

> /usr/include/x86_64-linux-gnux32/asm/unistd.h:#define __X32_SYSCALL_BIT 
> 0x4000UL

… is OR’d into the numbers.

I’d like to propose the change…
-#define __X32_SYSCALL_BIT 0x4000UL
+#define __X32_SYSCALL_BIT 0x4000
… which should be safe to do as the number fits into signed int,
but must be checked against other users (especially in the kernel
itself I’d guess).

This should also technically be correct, since on all(?) other
architectures syscall numbers are int constants.

Please forward this to upstream.

Thanks,
//mirabilos
-- 
tarent solutions GmbH
Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/
Tel: +49 228 54881-393 • Fax: +49 228 54881-235
HRB 5168 (AG Bonn) • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

**

Mit der tarent Academy bieten wir auch Trainings und Schulungen in den
Bereichen Softwareentwicklung, Agiles Arbeiten und Zukunftstechnologien an.

Besuchen Sie uns auf www.tarent.de/academy. Wir freuen uns auf Ihren Kontakt.

**