Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a214c047
Commit
a214c047
authored
Jul 01, 2003
by
Martin Schwidefsky
Committed by
Linus Torvalds
Jul 01, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] s390: semtimedop.
Fix SEMTIMEDOP operation in sys_ipc. Patch by Ernie Petrides.
parent
c5838f46
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
13 deletions
+61
-13
arch/s390/kernel/compat_linux.c
arch/s390/kernel/compat_linux.c
+58
-9
arch/s390/kernel/sys_s390.c
arch/s390/kernel/sys_s390.c
+3
-4
No files found.
arch/s390/kernel/compat_linux.c
View file @
a214c047
...
...
@@ -373,12 +373,45 @@ struct shmid64_ds32 {
unsigned
int
__unused5
;
};
extern
int
sem_ctls
[];
#define sc_semopm (sem_ctls[2])
#define SEMOPM_FAST 64
/* ~ 372 bytes on stack */
static
long
do_sys32_semtimedop
(
int
semid
,
struct
sembuf
*
tsops
,
int
nsops
,
struct
compat_timespec
*
timeout32
)
{
struct
sembuf
*
sops
,
fast_sops
[
SEMOPM_FAST
];
struct
timespec
t
;
mm_segment_t
oldfs
;
long
ret
;
/* parameter checking precedence should mirror sys_semtimedop() */
if
(
nsops
<
1
||
semid
<
0
)
return
-
EINVAL
;
if
(
nsops
>
sc_semopm
)
return
-
E2BIG
;
if
(
nsops
<=
SEMOPM_FAST
)
sops
=
fast_sops
;
else
{
sops
=
kmalloc
(
nsops
*
sizeof
(
*
sops
),
GFP_KERNEL
);
if
(
sops
==
NULL
)
return
-
ENOMEM
;
}
if
(
copy_from_user
(
sops
,
tsops
,
nsops
*
sizeof
(
*
tsops
))
||
get_compat_timespec
(
&
t
,
timeout32
))
ret
=
-
EFAULT
;
else
{
oldfs
=
get_fs
();
set_fs
(
KERNEL_DS
);
ret
=
sys_semtimedop
(
semid
,
sops
,
nsops
,
&
t
);
set_fs
(
oldfs
);
}
if
(
sops
!=
fast_sops
)
kfree
(
sops
);
return
ret
;
}
/*
* sys32_ipc() is the de-multiplexer for the SysV IPC calls in 32bit emulation..
*
* This is really horribly ugly.
*/
#define IPCOP_MASK(__x) (1UL << (__x))
static
int
do_sys32_semctl
(
int
first
,
int
second
,
int
third
,
void
*
uptr
)
{
...
...
@@ -763,7 +796,12 @@ static int do_sys32_shmctl (int first, int second, void *uptr)
return
err
;
}
asmlinkage
int
sys32_ipc
(
u32
call
,
int
first
,
int
second
,
int
third
,
u32
ptr
,
u32
fifth
)
/*
* sys32_ipc() is the de-multiplexer for the SysV IPC calls in 32bit emulation.
*
* This is really horribly ugly.
*/
asmlinkage
int
sys32_ipc
(
u32
call
,
int
first
,
int
second
,
int
third
,
u32
ptr
)
{
int
version
,
err
;
...
...
@@ -773,11 +811,22 @@ asmlinkage int sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u
if
(
version
)
return
-
EINVAL
;
if
(
call
<=
SEM
CTL
)
if
(
call
<=
SEM
TIMEDOP
)
switch
(
call
)
{
case
SEMTIMEDOP
:
if
(
third
)
{
err
=
do_sys32_semtimedop
(
first
,
(
struct
sembuf
*
)
AA
(
ptr
),
second
,
(
struct
compat_timespec
*
)
AA
((
u32
)
third
));
goto
out
;
}
/* else fall through for normal semop() */
case
SEMOP
:
/* struct sembuf is the same on 32 and 64bit :)) */
err
=
sys_semop
(
first
,
(
struct
sembuf
*
)
AA
(
ptr
),
second
);
err
=
sys_semtimedop
(
first
,
(
struct
sembuf
*
)
AA
(
ptr
),
second
,
NULL
);
goto
out
;
case
SEMGET
:
err
=
sys_semget
(
first
,
second
,
third
);
...
...
arch/s390/kernel/sys_s390.c
View file @
a214c047
...
...
@@ -184,8 +184,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
* This is really horribly ugly.
*/
asmlinkage
__SYS_RETTYPE
sys_ipc
(
uint
call
,
int
first
,
int
second
,
unsigned
long
third
,
void
*
ptr
,
unsigned
long
fifth
)
unsigned
long
third
,
void
*
ptr
)
{
struct
ipc_kludge
tmp
;
int
ret
;
...
...
@@ -195,8 +194,8 @@ asmlinkage __SYS_RETTYPE sys_ipc (uint call, int first, int second,
return
sys_semtimedop
(
first
,
(
struct
sembuf
*
)
ptr
,
second
,
NULL
);
case
SEMTIMEDOP
:
return
sys_semtimedop
(
first
,
(
struct
sembuf
*
)
ptr
,
second
,
(
const
struct
timespec
*
)
fifth
);
return
sys_semtimedop
(
first
,
(
struct
sembuf
*
)
ptr
,
second
,
(
const
struct
timespec
*
)
third
);
case
SEMGET
:
return
sys_semget
(
first
,
second
,
third
);
case
SEMCTL
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment