lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 05 May 2015 15:11:08 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	linux-arm-kernel@...ts.infradead.org
Cc:	Andreas Kraschitzer <andreas.kraschitzer@...obroma-systems.com>,
	Benedikt Huber <benedikt.huber@...obroma-systems.com>,
	"Pinski, Andrew" <Andrew.Pinski@...iumnetworks.com>,
	Catalin Marinas <catalin.marinas@....com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"agraf@...e.de" <agraf@...e.de>,
	Andrew Pinski <apinski@...ium.com>,
	Andreas Schwab <schwab@...e.de>,
	Kumar Sankaran <ksankaran@....com>,
	"Dr. Philipp Tomsich" <philipp.tomsich@...obroma-systems.com>,
	Christoph Muellner <christoph.muellner@...obroma-systems.com>
Subject: Re: [PATCH v4 00/24] ILP32 for ARM64

On Monday 04 May 2015 12:29:52 Arnd Bergmann wrote:
> 
> For 'struct stat', I ended up introducing a new structure on arm32 that
> matches the layout of arm64 (and I did the same for all other 32-bit
> architectures that have a 64-bit counterpart). This means we can share
> the same system calls between arm64-lp64, arm64-ilp32 and arm32 with
> 64-bit time_t and arm64-aarch32 emulation for 32-bit time_t, while
> using the existing compat handling for the original 'struct stat'
> emulation in both arm32 and arm64-aarch32.
> 
> However, for ipc, the situation is different: I found a way to use
> extra padding fields in semid64_ds/shmid64_ds/msqid64_ds, so the
> ipc system calls will still use normal 32-bit data structures
> on arm32 and arm64-aarch64, but you cannot use them arm64-ilp32,
> and will have to #ifdef the three header files there to choose between
> the two implementations.

I realized that this may need some more clarification. What I meant is
that we can extend the current 32-bit version of struct semid64_ds
and the others on arm32, and in the same way extend compat_semid64_ds
on arm64, but you cannot use that on arm64-ilp32 for other reasons.


The solution here is to redefine the normal arm64 semid64_ds so ilp32
see a structure with the same layout as lp64, and then use sys_semctl()
for arm64-ilp32 but use compat_sys_semctl() for aarch32-compat.

The definition would be something like

#ifdef __LP64__
#include <asm-generic/sembuf.h>
#else
struct semid64_ds {
        struct ipc64_perm sem_perm;     /* permissions .. see ipc.h */
        __kernel_time_t sem_otime;      /* last semop time */
        __kernel_time_t sem_ctime;      /* last change time */
        __u64		sem_nsems;      /* no. of semaphores in array */
        __u64 		__unused3;
        __u64		__unused4;
};
#endif

Alternatively, we could use the same definition for both lp64 and ilp32,
which would change the type mangling but not the binary structure.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ