aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/compat.c3
-rw-r--r--net/core/scm.c3
-rw-r--r--net/socket.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/net/compat.c b/net/compat.c
index 9a0f5f2b90c8..d74d82155d78 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -276,7 +276,8 @@ void scm_detach_fds_compat(struct msghdr *kmsg, struct scm_cookie *scm)
276 err = security_file_receive(fp[i]); 276 err = security_file_receive(fp[i]);
277 if (err) 277 if (err)
278 break; 278 break;
279 err = get_unused_fd(); 279 err = get_unused_fd_flags(MSG_CMSG_CLOEXEC & kmsg->msg_flags
280 ? O_CLOEXEC : 0);
280 if (err < 0) 281 if (err < 0)
281 break; 282 break;
282 new_fd = err; 283 new_fd = err;
diff --git a/net/core/scm.c b/net/core/scm.c
index 292ad8d5ad76..44c4ec2c8769 100644
--- a/net/core/scm.c
+++ b/net/core/scm.c
@@ -228,7 +228,8 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
228 err = security_file_receive(fp[i]); 228 err = security_file_receive(fp[i]);
229 if (err) 229 if (err)
230 break; 230 break;
231 err = get_unused_fd(); 231 err = get_unused_fd_flags(MSG_CMSG_CLOEXEC & msg->msg_flags
232 ? O_CLOEXEC : 0);
232 if (err < 0) 233 if (err < 0)
233 break; 234 break;
234 new_fd = err; 235 new_fd = err;
diff --git a/net/socket.c b/net/socket.c
index f4530196a70a..b71114250046 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1939,9 +1939,7 @@ asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg,
1939 total_len = err; 1939 total_len = err;
1940 1940
1941 cmsg_ptr = (unsigned long)msg_sys.msg_control; 1941 cmsg_ptr = (unsigned long)msg_sys.msg_control;
1942 msg_sys.msg_flags = 0; 1942 msg_sys.msg_flags = flags & (MSG_CMSG_CLOEXEC|MSG_CMSG_COMPAT);
1943 if (MSG_CMSG_COMPAT & flags)
1944 msg_sys.msg_flags = MSG_CMSG_COMPAT;
1945 1943
1946 if (sock->file->f_flags & O_NONBLOCK) 1944 if (sock->file->f_flags & O_NONBLOCK)
1947 flags |= MSG_DONTWAIT; 1945 flags |= MSG_DONTWAIT;