mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
net: socket: move check for forbid_cmsg_compat to __sys_...msg()
The non-compat codepaths for sys_...msg() verify that MSG_CMSG_COMPAT is not set. By moving this check to the __sys_...msg() functions (and making it dependent on a static flag passed to this function), we can call the __sys...msg() functions instead of the syscall functions in all cases. __sys_recvmmsg() does not need this trickery, as the check is handled within the do_sys_recvmmsg() function internal to net/socket.c. This patch is part of a series which removes in-kernel calls to syscalls. On this basis, the syscall entry path can be streamlined. For details, see http://lkml.kernel.org/r/[email protected] Cc: David S. Miller <[email protected]> Cc: [email protected] Signed-off-by: Dominik Brodowski <[email protected]>
This commit is contained in:
parent
1255e26906
commit
e1834a329d
3 changed files with 37 additions and 22 deletions
|
|
@ -736,19 +736,21 @@ static unsigned char nas[21] = {
|
|||
|
||||
COMPAT_SYSCALL_DEFINE3(sendmsg, int, fd, struct compat_msghdr __user *, msg, unsigned int, flags)
|
||||
{
|
||||
return __sys_sendmsg(fd, (struct user_msghdr __user *)msg, flags | MSG_CMSG_COMPAT);
|
||||
return __sys_sendmsg(fd, (struct user_msghdr __user *)msg,
|
||||
flags | MSG_CMSG_COMPAT, false);
|
||||
}
|
||||
|
||||
COMPAT_SYSCALL_DEFINE4(sendmmsg, int, fd, struct compat_mmsghdr __user *, mmsg,
|
||||
unsigned int, vlen, unsigned int, flags)
|
||||
{
|
||||
return __sys_sendmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
|
||||
flags | MSG_CMSG_COMPAT);
|
||||
flags | MSG_CMSG_COMPAT, false);
|
||||
}
|
||||
|
||||
COMPAT_SYSCALL_DEFINE3(recvmsg, int, fd, struct compat_msghdr __user *, msg, unsigned int, flags)
|
||||
{
|
||||
return __sys_recvmsg(fd, (struct user_msghdr __user *)msg, flags | MSG_CMSG_COMPAT);
|
||||
return __sys_recvmsg(fd, (struct user_msghdr __user *)msg,
|
||||
flags | MSG_CMSG_COMPAT, false);
|
||||
}
|
||||
|
||||
COMPAT_SYSCALL_DEFINE4(recv, int, fd, void __user *, buf, compat_size_t, len, unsigned int, flags)
|
||||
|
|
|
|||
Loading…
Reference in a new issue