Skip to content

Commit ca2c405

Browse files
committed
kexec/compat: convert to COMPAT_SYSCALL_DEFINE with changing parameter types
In order to allow the COMPAT_SYSCALL_DEFINE macro generate code that performs proper zero and sign extension convert all 64 bit parameters to their corresponding 32 bit compat counterparts. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
1 parent 3a49a0f commit ca2c405

3 files changed

Lines changed: 7 additions & 13 deletions

File tree

‎include/linux/compat.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -641,10 +641,10 @@ asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val,
641641
u32 val3);
642642
asmlinkage long compat_sys_getsockopt(int fd, int level, int optname,
643643
char __user *optval, int __user *optlen);
644-
asmlinkage long compat_sys_kexec_load(unsigned long entry,
645-
unsigned long nr_segments,
644+
asmlinkage long compat_sys_kexec_load(compat_ulong_t entry,
645+
compat_ulong_t nr_segments,
646646
struct compat_kexec_segment __user *,
647-
unsigned long flags);
647+
compat_ulong_t flags);
648648
asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes,
649649
const struct compat_mq_attr __user *u_mqstat,
650650
struct compat_mq_attr __user *u_omqstat);

‎include/linux/kexec.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,6 @@ extern asmlinkage long sys_kexec_load(unsigned long entry,
127127
struct kexec_segment __user *segments,
128128
unsigned long flags);
129129
extern int kernel_kexec(void);
130-
#ifdef CONFIG_COMPAT
131-
extern asmlinkage long compat_sys_kexec_load(unsigned long entry,
132-
unsigned long nr_segments,
133-
struct compat_kexec_segment __user *segments,
134-
unsigned long flags);
135-
#endif
136130
extern struct page *kimage_alloc_control_pages(struct kimage *image,
137131
unsigned int order);
138132
extern void crash_kexec(struct pt_regs *);

‎kernel/kexec.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,10 +1039,10 @@ void __weak crash_unmap_reserved_pages(void)
10391039
{}
10401040

10411041
#ifdef CONFIG_COMPAT
1042-
asmlinkage long compat_sys_kexec_load(unsigned long entry,
1043-
unsigned long nr_segments,
1044-
struct compat_kexec_segment __user *segments,
1045-
unsigned long flags)
1042+
COMPAT_SYSCALL_DEFINE4(kexec_load, compat_ulong_t, entry,
1043+
compat_ulong_t, nr_segments,
1044+
struct compat_kexec_segment __user *, segments,
1045+
compat_ulong_t, flags)
10461046
{
10471047
struct compat_kexec_segment in;
10481048
struct kexec_segment out, __user *ksegments;

0 commit comments

Comments
 (0)