aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-05-01 17:41:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-05-01 17:41:04 -0400
commit5db6db0d400edd8bec274e34960cfa22838e1df5 (patch)
tree3d7934f2eb27a2b72b87eae3c2918cf2e635d814 /fs
parent5fab10041b4389b61de7e7a49893190bae686241 (diff)
parent2fefc97b2180518bac923fba3f79fdca1f41dc15 (diff)
Merge branch 'work.uaccess' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull uaccess unification updates from Al Viro: "This is the uaccess unification pile. It's _not_ the end of uaccess work, but the next batch of that will go into the next cycle. This one mostly takes copy_from_user() and friends out of arch/* and gets the zero-padding behaviour in sync for all architectures. Dealing with the nocache/writethrough mess is for the next cycle; fortunately, that's x86-only. Same for cleanups in iov_iter.c (I am sold on access_ok() in there, BTW; just not in this pile), same for reducing __copy_... callsites, strn*... stuff, etc. - there will be a pile about as large as this one in the next merge window. This one sat in -next for weeks. -3KLoC" * 'work.uaccess' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (96 commits) HAVE_ARCH_HARDENED_USERCOPY is unconditional now CONFIG_ARCH_HAS_RAW_COPY_USER is unconditional now m32r: switch to RAW_COPY_USER hexagon: switch to RAW_COPY_USER microblaze: switch to RAW_COPY_USER get rid of padding, switch to RAW_COPY_USER ia64: get rid of copy_in_user() ia64: sanitize __access_ok() ia64: get rid of 'segment' argument of __do_{get,put}_user() ia64: get rid of 'segment' argument of __{get,put}_user_check() ia64: add extable.h powerpc: get rid of zeroing, switch to RAW_COPY_USER esas2r: don't open-code memdup_user() alpha: fix stack smashing in old_adjtimex(2) don't open-code kernel_setsockopt() mips: switch to RAW_COPY_USER mips: get rid of tail-zeroing in primitives mips: make copy_from_user() zero tail explicitly mips: clean and reorder the forest of macros... mips: consolidate __invoke_... wrappers ...
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/cluster/tcp.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index d0ab7e56d0b4..5b51c31c892d 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -1460,27 +1460,10 @@ static void o2net_rx_until_empty(struct work_struct *work)
1460 1460
1461static int o2net_set_nodelay(struct socket *sock) 1461static int o2net_set_nodelay(struct socket *sock)
1462{ 1462{
1463 int ret, val = 1; 1463 int val = 1;
1464 mm_segment_t oldfs;
1465 1464
1466 oldfs = get_fs(); 1465 return kernel_setsockopt(sock, SOL_TCP, TCP_NODELAY,
1467 set_fs(KERNEL_DS); 1466 (void *)&val, sizeof(val));
1468
1469 /*
1470 * Dear unsuspecting programmer,
1471 *
1472 * Don't use sock_setsockopt() for SOL_TCP. It doesn't check its level
1473 * argument and assumes SOL_SOCKET so, say, your TCP_NODELAY will
1474 * silently turn into SO_DEBUG.
1475 *
1476 * Yours,
1477 * Keeper of hilariously fragile interfaces.
1478 */
1479 ret = sock->ops->setsockopt(sock, SOL_TCP, TCP_NODELAY,
1480 (char __user *)&val, sizeof(val));
1481
1482 set_fs(oldfs);
1483 return ret;
1484} 1467}
1485 1468
1486static int o2net_set_usertimeout(struct socket *sock) 1469static int o2net_set_usertimeout(struct socket *sock)
@@ -1488,7 +1471,7 @@ static int o2net_set_usertimeout(struct socket *sock)
1488 int user_timeout = O2NET_TCP_USER_TIMEOUT; 1471 int user_timeout = O2NET_TCP_USER_TIMEOUT;
1489 1472
1490 return kernel_setsockopt(sock, SOL_TCP, TCP_USER_TIMEOUT, 1473 return kernel_setsockopt(sock, SOL_TCP, TCP_USER_TIMEOUT,
1491 (char *)&user_timeout, sizeof(user_timeout)); 1474 (void *)&user_timeout, sizeof(user_timeout));
1492} 1475}
1493 1476
1494static void o2net_initialize_handshake(void) 1477static void o2net_initialize_handshake(void)