diff options
Diffstat (limited to 'net/core/sock.c')
| -rw-r--r-- | net/core/sock.c | 18 | 
1 files changed, 7 insertions, 11 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 75b1c950b49f..aa4a00d381e3 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later  /*   * INET		An implementation of the TCP/IP protocol suite for the LINUX   *		operating system.  INET is implemented using the  BSD Socket @@ -6,7 +7,6 @@   *		Generic socket support routines. Memory allocators, socket lock/release   *		handler for protocols to use and generic option handler.   * - *   * Authors:	Ross Biro   *		Fred N. van Kempen, <[email protected]>   *		Florian La Roche, <[email protected]> @@ -81,12 +81,6 @@   *		Arnaldo C. Melo :       cleanups, use skb_queue_purge   *   * To Fix: - * - * - *		This program is free software; you can redistribute it and/or - *		modify it under the terms of the GNU General Public License - *		as published by the Free Software Foundation; either version - *		2 of the License, or (at your option) any later version.   */  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt @@ -1483,9 +1477,6 @@ int sock_getsockopt(struct socket *sock, int level, int optname,  	{  		u32 meminfo[SK_MEMINFO_VARS]; -		if (get_user(len, optlen)) -			return -EFAULT; -  		sk_get_meminfo(sk, meminfo);  		len = min_t(unsigned int, len, sizeof(meminfo)); @@ -1856,6 +1847,9 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority)  			goto out;  		}  		RCU_INIT_POINTER(newsk->sk_reuseport_cb, NULL); +#ifdef CONFIG_BPF_SYSCALL +		RCU_INIT_POINTER(newsk->sk_bpf_storage, NULL); +#endif  		newsk->sk_err	   = 0;  		newsk->sk_err_soft = 0; @@ -2326,6 +2320,7 @@ static void sk_leave_memory_pressure(struct sock *sk)  /* On 32bit arches, an skb frag is limited to 2^15 */  #define SKB_FRAG_PAGE_ORDER	get_order(32768) +DEFINE_STATIC_KEY_FALSE(net_high_order_alloc_disable_key);  /**   * skb_page_frag_refill - check that a page_frag contains enough room @@ -2350,7 +2345,8 @@ bool skb_page_frag_refill(unsigned int sz, struct page_frag *pfrag, gfp_t gfp)  	}  	pfrag->offset = 0; -	if (SKB_FRAG_PAGE_ORDER) { +	if (SKB_FRAG_PAGE_ORDER && +	    !static_branch_unlikely(&net_high_order_alloc_disable_key)) {  		/* Avoid direct reclaim but allow kswapd to wake */  		pfrag->page = alloc_pages((gfp & ~__GFP_DIRECT_RECLAIM) |  					  __GFP_COMP | __GFP_NOWARN |  |