mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
Merge tag 'v6.1.72' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-6.1.y
This is the 6.1.72 stable release Change-Id: Ia514a1913ea8a07077270c3f55dfdb2d8942850a
This commit is contained in:
@@ -702,10 +702,14 @@ bpf_ctx_record_field_size(struct bpf_insn_access_aux *aux, u32 size)
|
||||
aux->ctx_field_size = size;
|
||||
}
|
||||
|
||||
static bool bpf_is_ldimm64(const struct bpf_insn *insn)
|
||||
{
|
||||
return insn->code == (BPF_LD | BPF_IMM | BPF_DW);
|
||||
}
|
||||
|
||||
static inline bool bpf_pseudo_func(const struct bpf_insn *insn)
|
||||
{
|
||||
return insn->code == (BPF_LD | BPF_IMM | BPF_DW) &&
|
||||
insn->src_reg == BPF_PSEUDO_FUNC;
|
||||
return bpf_is_ldimm64(insn) && insn->src_reg == BPF_PSEUDO_FUNC;
|
||||
}
|
||||
|
||||
struct bpf_prog_ops {
|
||||
@@ -825,6 +829,11 @@ struct btf_func_model {
|
||||
*/
|
||||
#define BPF_TRAMP_F_SHARE_IPMODIFY BIT(6)
|
||||
|
||||
/* Indicate that current trampoline is in a tail call context. Then, it has to
|
||||
* cache and restore tail_call_cnt to avoid infinite tail call loop.
|
||||
*/
|
||||
#define BPF_TRAMP_F_TAIL_CALL_CTX BIT(7)
|
||||
|
||||
/* Each call __bpf_prog_enter + call bpf_func + call __bpf_prog_exit is ~50
|
||||
* bytes on x86.
|
||||
*/
|
||||
|
||||
@@ -429,6 +429,7 @@ struct bpf_insn_aux_data {
|
||||
/* below fields are initialized once */
|
||||
unsigned int orig_idx; /* original instruction index */
|
||||
bool prune_point;
|
||||
bool jmp_point;
|
||||
};
|
||||
|
||||
#define MAX_USED_MAPS 64 /* max number of maps accessed by one eBPF program */
|
||||
|
||||
@@ -40,9 +40,8 @@
|
||||
|
||||
#define F2FS_ENC_UTF8_12_1 1
|
||||
|
||||
#define F2FS_IO_SIZE(sbi) (1 << F2FS_OPTION(sbi).write_io_size_bits) /* Blocks */
|
||||
#define F2FS_IO_SIZE_KB(sbi) (1 << (F2FS_OPTION(sbi).write_io_size_bits + 2)) /* KB */
|
||||
#define F2FS_IO_SIZE_BYTES(sbi) (1 << (F2FS_OPTION(sbi).write_io_size_bits + 12)) /* B */
|
||||
#define F2FS_IO_SIZE(sbi) BIT(F2FS_OPTION(sbi).write_io_size_bits) /* Blocks */
|
||||
#define F2FS_IO_SIZE_KB(sbi) BIT(F2FS_OPTION(sbi).write_io_size_bits + 2) /* KB */
|
||||
#define F2FS_IO_SIZE_BITS(sbi) (F2FS_OPTION(sbi).write_io_size_bits) /* power of 2 */
|
||||
#define F2FS_IO_SIZE_MASK(sbi) (F2FS_IO_SIZE(sbi) - 1)
|
||||
#define F2FS_IO_ALIGNED(sbi) (F2FS_IO_SIZE(sbi) > 1)
|
||||
@@ -340,7 +339,7 @@ enum {
|
||||
OFFSET_BIT_SHIFT
|
||||
};
|
||||
|
||||
#define OFFSET_BIT_MASK (0x07) /* (0x01 << OFFSET_BIT_SHIFT) - 1 */
|
||||
#define OFFSET_BIT_MASK GENMASK(OFFSET_BIT_SHIFT - 1, 0)
|
||||
|
||||
struct node_footer {
|
||||
__le32 nid; /* node id */
|
||||
@@ -545,7 +544,7 @@ typedef __le32 f2fs_hash_t;
|
||||
#define MAX_DIR_HASH_DEPTH 63
|
||||
|
||||
/* MAX buckets in one level of dir */
|
||||
#define MAX_DIR_BUCKETS (1 << ((MAX_DIR_HASH_DEPTH / 2) - 1))
|
||||
#define MAX_DIR_BUCKETS BIT((MAX_DIR_HASH_DEPTH / 2) - 1)
|
||||
|
||||
/*
|
||||
* space utilization of regular dentry and inline dentry (w/o extra reservation)
|
||||
|
||||
@@ -2177,6 +2177,7 @@ struct file_operations {
|
||||
int (*flock) (struct file *, int, struct file_lock *);
|
||||
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
|
||||
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
|
||||
void (*splice_eof)(struct file *file);
|
||||
int (*setlease)(struct file *, long, struct file_lock **, void **);
|
||||
long (*fallocate)(struct file *file, int mode, loff_t offset,
|
||||
loff_t len);
|
||||
|
||||
14
include/linux/group_cpus.h
Normal file
14
include/linux/group_cpus.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (C) 2016 Thomas Gleixner.
|
||||
* Copyright (C) 2016-2017 Christoph Hellwig.
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_GROUP_CPUS_H
|
||||
#define __LINUX_GROUP_CPUS_H
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/cpu.h>
|
||||
|
||||
struct cpumask *group_cpus_evenly(unsigned int numgrps);
|
||||
|
||||
#endif
|
||||
@@ -209,6 +209,7 @@ struct proto_ops {
|
||||
int offset, size_t size, int flags);
|
||||
ssize_t (*splice_read)(struct socket *sock, loff_t *ppos,
|
||||
struct pipe_inode_info *pipe, size_t len, unsigned int flags);
|
||||
void (*splice_eof)(struct socket *sock);
|
||||
int (*set_peek_off)(struct sock *sk, int val);
|
||||
int (*peek_len)(struct socket *sock);
|
||||
|
||||
|
||||
@@ -199,6 +199,9 @@ enum mapping_flags {
|
||||
/* writeback related tags are not used */
|
||||
AS_NO_WRITEBACK_TAGS = 5,
|
||||
AS_LARGE_FOLIO_SUPPORT = 6,
|
||||
AS_RELEASE_ALWAYS, /* Call ->release_folio(), even if no private data */
|
||||
AS_STABLE_WRITES, /* must wait for writeback before modifying
|
||||
folio contents */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -269,6 +272,36 @@ static inline int mapping_use_writeback_tags(struct address_space *mapping)
|
||||
return !test_bit(AS_NO_WRITEBACK_TAGS, &mapping->flags);
|
||||
}
|
||||
|
||||
static inline bool mapping_release_always(const struct address_space *mapping)
|
||||
{
|
||||
return test_bit(AS_RELEASE_ALWAYS, &mapping->flags);
|
||||
}
|
||||
|
||||
static inline void mapping_set_release_always(struct address_space *mapping)
|
||||
{
|
||||
set_bit(AS_RELEASE_ALWAYS, &mapping->flags);
|
||||
}
|
||||
|
||||
static inline void mapping_clear_release_always(struct address_space *mapping)
|
||||
{
|
||||
clear_bit(AS_RELEASE_ALWAYS, &mapping->flags);
|
||||
}
|
||||
|
||||
static inline bool mapping_stable_writes(const struct address_space *mapping)
|
||||
{
|
||||
return test_bit(AS_STABLE_WRITES, &mapping->flags);
|
||||
}
|
||||
|
||||
static inline void mapping_set_stable_writes(struct address_space *mapping)
|
||||
{
|
||||
set_bit(AS_STABLE_WRITES, &mapping->flags);
|
||||
}
|
||||
|
||||
static inline void mapping_clear_stable_writes(struct address_space *mapping)
|
||||
{
|
||||
clear_bit(AS_STABLE_WRITES, &mapping->flags);
|
||||
}
|
||||
|
||||
static inline gfp_t mapping_gfp_mask(struct address_space * mapping)
|
||||
{
|
||||
return mapping->gfp_mask;
|
||||
|
||||
@@ -106,6 +106,7 @@ struct sk_psock {
|
||||
struct mutex work_mutex;
|
||||
struct sk_psock_work_state work_state;
|
||||
struct delayed_work work;
|
||||
struct sock *sk_pair;
|
||||
struct rcu_work rwork;
|
||||
};
|
||||
|
||||
|
||||
@@ -324,6 +324,7 @@ struct ucred {
|
||||
*/
|
||||
|
||||
#define MSG_ZEROCOPY 0x4000000 /* Use user data in kernel path */
|
||||
#define MSG_SPLICE_PAGES 0x8000000 /* Splice the pages from the iterator in sendmsg() */
|
||||
#define MSG_FASTOPEN 0x20000000 /* Send data in TCP SYN */
|
||||
#define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exec for file
|
||||
descriptor received through
|
||||
@@ -334,6 +335,8 @@ struct ucred {
|
||||
#define MSG_CMSG_COMPAT 0 /* We never have 32 bit fixups */
|
||||
#endif
|
||||
|
||||
/* Flags to be cleared on entry by sendmsg and sendmmsg syscalls */
|
||||
#define MSG_INTERNAL_SENDMSG_FLAGS (MSG_SPLICE_PAGES)
|
||||
|
||||
/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
|
||||
#define SOL_IP 0
|
||||
|
||||
@@ -38,6 +38,7 @@ struct splice_desc {
|
||||
struct file *file; /* file to read/write */
|
||||
void *data; /* cookie */
|
||||
} u;
|
||||
void (*splice_eof)(struct splice_desc *sd); /* Unexpected EOF handler */
|
||||
loff_t pos; /* file position */
|
||||
loff_t *opos; /* sendfile: output position */
|
||||
size_t num_spliced; /* number of bytes already spliced */
|
||||
|
||||
@@ -30,25 +30,33 @@ static inline u32 udp_hashfn(const struct net *net, u32 num, u32 mask)
|
||||
return (num + net_hash_mix(net)) & mask;
|
||||
}
|
||||
|
||||
enum {
|
||||
UDP_FLAGS_CORK, /* Cork is required */
|
||||
UDP_FLAGS_NO_CHECK6_TX, /* Send zero UDP6 checksums on TX? */
|
||||
UDP_FLAGS_NO_CHECK6_RX, /* Allow zero UDP6 checksums on RX? */
|
||||
UDP_FLAGS_GRO_ENABLED, /* Request GRO aggregation */
|
||||
UDP_FLAGS_ACCEPT_FRAGLIST,
|
||||
UDP_FLAGS_ACCEPT_L4,
|
||||
UDP_FLAGS_ENCAP_ENABLED, /* This socket enabled encap */
|
||||
};
|
||||
|
||||
struct udp_sock {
|
||||
/* inet_sock has to be the first member */
|
||||
struct inet_sock inet;
|
||||
#define udp_port_hash inet.sk.__sk_common.skc_u16hashes[0]
|
||||
#define udp_portaddr_hash inet.sk.__sk_common.skc_u16hashes[1]
|
||||
#define udp_portaddr_node inet.sk.__sk_common.skc_portaddr_node
|
||||
|
||||
unsigned long udp_flags;
|
||||
|
||||
int pending; /* Any pending frames ? */
|
||||
unsigned int corkflag; /* Cork is required */
|
||||
__u8 encap_type; /* Is this an Encapsulation socket? */
|
||||
unsigned char no_check6_tx:1,/* Send zero UDP6 checksums on TX? */
|
||||
no_check6_rx:1,/* Allow zero UDP6 checksums on RX? */
|
||||
encap_enabled:1, /* This socket enabled encap
|
||||
* processing; UDP tunnels and
|
||||
* different encapsulation layer set
|
||||
* this
|
||||
*/
|
||||
gro_enabled:1, /* Request GRO aggregation */
|
||||
accept_udp_l4:1,
|
||||
accept_udp_fraglist:1;
|
||||
|
||||
/* indicator bits used by pcflag: */
|
||||
#define UDPLITE_BIT 0x1 /* set by udplite proto init function */
|
||||
#define UDPLITE_SEND_CC 0x2 /* set via udplite setsockopt */
|
||||
#define UDPLITE_RECV_CC 0x4 /* set via udplite setsocktopt */
|
||||
__u8 pcflag; /* marks socket as UDP-Lite if > 0 */
|
||||
/*
|
||||
* Following member retains the information to create a UDP header
|
||||
* when the socket is uncorked.
|
||||
@@ -60,12 +68,6 @@ struct udp_sock {
|
||||
*/
|
||||
__u16 pcslen;
|
||||
__u16 pcrlen;
|
||||
/* indicator bits used by pcflag: */
|
||||
#define UDPLITE_BIT 0x1 /* set by udplite proto init function */
|
||||
#define UDPLITE_SEND_CC 0x2 /* set via udplite setsockopt */
|
||||
#define UDPLITE_RECV_CC 0x4 /* set via udplite setsocktopt */
|
||||
__u8 pcflag; /* marks socket as UDP-Lite if > 0 */
|
||||
__u8 unused[3];
|
||||
/*
|
||||
* For encapsulation sockets.
|
||||
*/
|
||||
@@ -89,6 +91,17 @@ struct udp_sock {
|
||||
int forward_deficit;
|
||||
};
|
||||
|
||||
#define udp_test_bit(nr, sk) \
|
||||
test_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags)
|
||||
#define udp_set_bit(nr, sk) \
|
||||
set_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags)
|
||||
#define udp_test_and_set_bit(nr, sk) \
|
||||
test_and_set_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags)
|
||||
#define udp_clear_bit(nr, sk) \
|
||||
clear_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags)
|
||||
#define udp_assign_bit(nr, sk, val) \
|
||||
assign_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags, val)
|
||||
|
||||
#define UDP_MAX_SEGMENTS (1 << 6UL)
|
||||
|
||||
static inline struct udp_sock *udp_sk(const struct sock *sk)
|
||||
@@ -98,22 +111,22 @@ static inline struct udp_sock *udp_sk(const struct sock *sk)
|
||||
|
||||
static inline void udp_set_no_check6_tx(struct sock *sk, bool val)
|
||||
{
|
||||
udp_sk(sk)->no_check6_tx = val;
|
||||
udp_assign_bit(NO_CHECK6_TX, sk, val);
|
||||
}
|
||||
|
||||
static inline void udp_set_no_check6_rx(struct sock *sk, bool val)
|
||||
{
|
||||
udp_sk(sk)->no_check6_rx = val;
|
||||
udp_assign_bit(NO_CHECK6_RX, sk, val);
|
||||
}
|
||||
|
||||
static inline bool udp_get_no_check6_tx(struct sock *sk)
|
||||
static inline bool udp_get_no_check6_tx(const struct sock *sk)
|
||||
{
|
||||
return udp_sk(sk)->no_check6_tx;
|
||||
return udp_test_bit(NO_CHECK6_TX, sk);
|
||||
}
|
||||
|
||||
static inline bool udp_get_no_check6_rx(struct sock *sk)
|
||||
static inline bool udp_get_no_check6_rx(const struct sock *sk)
|
||||
{
|
||||
return udp_sk(sk)->no_check6_rx;
|
||||
return udp_test_bit(NO_CHECK6_RX, sk);
|
||||
}
|
||||
|
||||
static inline void udp_cmsg_recv(struct msghdr *msg, struct sock *sk,
|
||||
@@ -132,10 +145,12 @@ static inline bool udp_unexpected_gso(struct sock *sk, struct sk_buff *skb)
|
||||
if (!skb_is_gso(skb))
|
||||
return false;
|
||||
|
||||
if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4 && !udp_sk(sk)->accept_udp_l4)
|
||||
if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4 &&
|
||||
!udp_test_bit(ACCEPT_L4, sk))
|
||||
return true;
|
||||
|
||||
if (skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST && !udp_sk(sk)->accept_udp_fraglist)
|
||||
if (skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST &&
|
||||
!udp_test_bit(ACCEPT_FRAGLIST, sk))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -143,8 +158,8 @@ static inline bool udp_unexpected_gso(struct sock *sk, struct sk_buff *skb)
|
||||
|
||||
static inline void udp_allow_gso(struct sock *sk)
|
||||
{
|
||||
udp_sk(sk)->accept_udp_l4 = 1;
|
||||
udp_sk(sk)->accept_udp_fraglist = 1;
|
||||
udp_set_bit(ACCEPT_L4, sk);
|
||||
udp_set_bit(ACCEPT_FRAGLIST, sk);
|
||||
}
|
||||
|
||||
#define udp_portaddr_for_each_entry(__sk, list) \
|
||||
|
||||
@@ -77,6 +77,7 @@ static inline struct unix_sock *unix_sk(const struct sock *sk)
|
||||
{
|
||||
return (struct unix_sock *)sk;
|
||||
}
|
||||
#define unix_peer(sk) (unix_sk(sk)->peer)
|
||||
|
||||
#define peer_wait peer_wq.wait
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ int inet_accept(struct socket *sock, struct socket *newsock, int flags,
|
||||
bool kern);
|
||||
int inet_send_prepare(struct sock *sk);
|
||||
int inet_sendmsg(struct socket *sock, struct msghdr *msg, size_t size);
|
||||
void inet_splice_eof(struct socket *sock);
|
||||
ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset,
|
||||
size_t size, int flags);
|
||||
int inet_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
|
||||
|
||||
@@ -95,7 +95,7 @@ static inline void ipcm_init_sk(struct ipcm_cookie *ipcm,
|
||||
ipcm_init(ipcm);
|
||||
|
||||
ipcm->sockc.mark = READ_ONCE(inet->sk.sk_mark);
|
||||
ipcm->sockc.tsflags = inet->sk.sk_tsflags;
|
||||
ipcm->sockc.tsflags = READ_ONCE(inet->sk.sk_tsflags);
|
||||
ipcm->oif = READ_ONCE(inet->sk.sk_bound_dev_if);
|
||||
ipcm->addr = inet->inet_saddr;
|
||||
ipcm->protocol = inet->inet_num;
|
||||
|
||||
@@ -20,21 +20,6 @@ static inline struct nf_conn_act_ct_ext *nf_conn_act_ct_ext_find(const struct nf
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline struct nf_conn_act_ct_ext *nf_conn_act_ct_ext_add(struct nf_conn *ct)
|
||||
{
|
||||
#if IS_ENABLED(CONFIG_NET_ACT_CT)
|
||||
struct nf_conn_act_ct_ext *act_ct = nf_ct_ext_find(ct, NF_CT_EXT_ACT_CT);
|
||||
|
||||
if (act_ct)
|
||||
return act_ct;
|
||||
|
||||
act_ct = nf_ct_ext_add(ct, NF_CT_EXT_ACT_CT, GFP_ATOMIC);
|
||||
return act_ct;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void nf_conn_act_ct_ext_fill(struct sk_buff *skb, struct nf_conn *ct,
|
||||
enum ip_conntrack_info ctinfo)
|
||||
{
|
||||
@@ -47,4 +32,23 @@ static inline void nf_conn_act_ct_ext_fill(struct sk_buff *skb, struct nf_conn *
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline struct
|
||||
nf_conn_act_ct_ext *nf_conn_act_ct_ext_add(struct sk_buff *skb,
|
||||
struct nf_conn *ct,
|
||||
enum ip_conntrack_info ctinfo)
|
||||
{
|
||||
#if IS_ENABLED(CONFIG_NET_ACT_CT)
|
||||
struct nf_conn_act_ct_ext *act_ct = nf_ct_ext_find(ct, NF_CT_EXT_ACT_CT);
|
||||
|
||||
if (act_ct)
|
||||
return act_ct;
|
||||
|
||||
act_ct = nf_ct_ext_add(ct, NF_CT_EXT_ACT_CT, GFP_ATOMIC);
|
||||
nf_conn_act_ct_ext_fill(skb, ct, ctinfo);
|
||||
return act_ct;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* _NF_CONNTRACK_ACT_CT_H */
|
||||
|
||||
@@ -53,14 +53,17 @@ struct nf_flowtable_type {
|
||||
struct list_head list;
|
||||
int family;
|
||||
int (*init)(struct nf_flowtable *ft);
|
||||
bool (*gc)(const struct flow_offload *flow);
|
||||
int (*setup)(struct nf_flowtable *ft,
|
||||
struct net_device *dev,
|
||||
enum flow_block_command cmd);
|
||||
int (*action)(struct net *net,
|
||||
const struct flow_offload *flow,
|
||||
struct flow_offload *flow,
|
||||
enum flow_offload_tuple_dir dir,
|
||||
struct nf_flow_rule *flow_rule);
|
||||
void (*free)(struct nf_flowtable *ft);
|
||||
void (*get)(struct nf_flowtable *ft);
|
||||
void (*put)(struct nf_flowtable *ft);
|
||||
nf_hookfn *hook;
|
||||
struct module *owner;
|
||||
};
|
||||
@@ -164,6 +167,8 @@ enum nf_flow_flags {
|
||||
NF_FLOW_HW_DYING,
|
||||
NF_FLOW_HW_DEAD,
|
||||
NF_FLOW_HW_PENDING,
|
||||
NF_FLOW_HW_BIDIRECTIONAL,
|
||||
NF_FLOW_HW_ESTABLISHED,
|
||||
};
|
||||
|
||||
enum flow_offload_type {
|
||||
@@ -237,6 +242,11 @@ nf_flow_table_offload_add_cb(struct nf_flowtable *flow_table,
|
||||
}
|
||||
|
||||
list_add_tail(&block_cb->list, &block->cb_list);
|
||||
up_write(&flow_table->flow_block_lock);
|
||||
|
||||
if (flow_table->type->get)
|
||||
flow_table->type->get(flow_table);
|
||||
return 0;
|
||||
|
||||
unlock:
|
||||
up_write(&flow_table->flow_block_lock);
|
||||
@@ -259,6 +269,9 @@ nf_flow_table_offload_del_cb(struct nf_flowtable *flow_table,
|
||||
WARN_ON(true);
|
||||
}
|
||||
up_write(&flow_table->flow_block_lock);
|
||||
|
||||
if (flow_table->type->put)
|
||||
flow_table->type->put(flow_table);
|
||||
}
|
||||
|
||||
int flow_offload_route_init(struct flow_offload *flow,
|
||||
@@ -266,7 +279,7 @@ int flow_offload_route_init(struct flow_offload *flow,
|
||||
|
||||
int flow_offload_add(struct nf_flowtable *flow_table, struct flow_offload *flow);
|
||||
void flow_offload_refresh(struct nf_flowtable *flow_table,
|
||||
struct flow_offload *flow);
|
||||
struct flow_offload *flow, bool force);
|
||||
|
||||
struct flow_offload_tuple_rhash *flow_offload_lookup(struct nf_flowtable *flow_table,
|
||||
struct flow_offload_tuple *tuple);
|
||||
@@ -312,10 +325,10 @@ void nf_flow_table_offload_flush_cleanup(struct nf_flowtable *flowtable);
|
||||
int nf_flow_table_offload_setup(struct nf_flowtable *flowtable,
|
||||
struct net_device *dev,
|
||||
enum flow_block_command cmd);
|
||||
int nf_flow_rule_route_ipv4(struct net *net, const struct flow_offload *flow,
|
||||
int nf_flow_rule_route_ipv4(struct net *net, struct flow_offload *flow,
|
||||
enum flow_offload_tuple_dir dir,
|
||||
struct nf_flow_rule *flow_rule);
|
||||
int nf_flow_rule_route_ipv6(struct net *net, const struct flow_offload *flow,
|
||||
int nf_flow_rule_route_ipv6(struct net *net, struct flow_offload *flow,
|
||||
enum flow_offload_tuple_dir dir,
|
||||
struct nf_flow_rule *flow_rule);
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ static inline int __nft_set_pktinfo_ipv4_validate(struct nft_pktinfo *pkt)
|
||||
if (iph->ihl < 5 || iph->version != 4)
|
||||
return -1;
|
||||
|
||||
len = ntohs(iph->tot_len);
|
||||
thoff = iph->ihl * 4;
|
||||
len = iph_totlen(pkt->skb, iph);
|
||||
thoff = skb_network_offset(pkt->skb) + (iph->ihl * 4);
|
||||
if (pkt->skb->len < len)
|
||||
return -1;
|
||||
else if (len < thoff)
|
||||
@@ -62,7 +62,7 @@ static inline int nft_set_pktinfo_ipv4_ingress(struct nft_pktinfo *pkt)
|
||||
if (iph->ihl < 5 || iph->version != 4)
|
||||
goto inhdr_error;
|
||||
|
||||
len = ntohs(iph->tot_len);
|
||||
len = iph_totlen(pkt->skb, iph);
|
||||
thoff = iph->ihl * 4;
|
||||
if (pkt->skb->len < len) {
|
||||
__IP_INC_STATS(nft_net(pkt), IPSTATS_MIB_INTRUNCATEDPKTS);
|
||||
|
||||
@@ -1279,6 +1279,7 @@ struct proto {
|
||||
size_t len, int flags, int *addr_len);
|
||||
int (*sendpage)(struct sock *sk, struct page *page,
|
||||
int offset, size_t size, int flags);
|
||||
void (*splice_eof)(struct socket *sock);
|
||||
int (*bind)(struct sock *sk,
|
||||
struct sockaddr *addr, int addr_len);
|
||||
int (*bind_add)(struct sock *sk,
|
||||
@@ -1928,7 +1929,9 @@ struct sockcm_cookie {
|
||||
static inline void sockcm_init(struct sockcm_cookie *sockc,
|
||||
const struct sock *sk)
|
||||
{
|
||||
*sockc = (struct sockcm_cookie) { .tsflags = sk->sk_tsflags };
|
||||
*sockc = (struct sockcm_cookie) {
|
||||
.tsflags = READ_ONCE(sk->sk_tsflags)
|
||||
};
|
||||
}
|
||||
|
||||
int __sock_cmsg_send(struct sock *sk, struct msghdr *msg, struct cmsghdr *cmsg,
|
||||
@@ -2741,9 +2744,9 @@ void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk,
|
||||
static inline void
|
||||
sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
|
||||
{
|
||||
ktime_t kt = skb->tstamp;
|
||||
struct skb_shared_hwtstamps *hwtstamps = skb_hwtstamps(skb);
|
||||
|
||||
u32 tsflags = READ_ONCE(sk->sk_tsflags);
|
||||
ktime_t kt = skb->tstamp;
|
||||
/*
|
||||
* generate control messages if
|
||||
* - receive time stamping in software requested
|
||||
@@ -2751,10 +2754,10 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
|
||||
* - hardware time stamps available and wanted
|
||||
*/
|
||||
if (sock_flag(sk, SOCK_RCVTSTAMP) ||
|
||||
(sk->sk_tsflags & SOF_TIMESTAMPING_RX_SOFTWARE) ||
|
||||
(kt && sk->sk_tsflags & SOF_TIMESTAMPING_SOFTWARE) ||
|
||||
(tsflags & SOF_TIMESTAMPING_RX_SOFTWARE) ||
|
||||
(kt && tsflags & SOF_TIMESTAMPING_SOFTWARE) ||
|
||||
(hwtstamps->hwtstamp &&
|
||||
(sk->sk_tsflags & SOF_TIMESTAMPING_RAW_HARDWARE)))
|
||||
(tsflags & SOF_TIMESTAMPING_RAW_HARDWARE)))
|
||||
__sock_recv_timestamp(msg, sk, skb);
|
||||
else
|
||||
sock_write_timestamp(sk, kt);
|
||||
@@ -2776,7 +2779,8 @@ static inline void sock_recv_cmsgs(struct msghdr *msg, struct sock *sk,
|
||||
#define TSFLAGS_ANY (SOF_TIMESTAMPING_SOFTWARE | \
|
||||
SOF_TIMESTAMPING_RAW_HARDWARE)
|
||||
|
||||
if (sk->sk_flags & FLAGS_RECV_CMSGS || sk->sk_tsflags & TSFLAGS_ANY)
|
||||
if (sk->sk_flags & FLAGS_RECV_CMSGS ||
|
||||
READ_ONCE(sk->sk_tsflags) & TSFLAGS_ANY)
|
||||
__sock_recv_cmsgs(msg, sk, skb);
|
||||
else if (unlikely(sock_flag(sk, SOCK_TIMESTAMP)))
|
||||
sock_write_timestamp(sk, skb->tstamp);
|
||||
@@ -2825,6 +2829,11 @@ static inline bool sk_is_tcp(const struct sock *sk)
|
||||
return sk->sk_type == SOCK_STREAM && sk->sk_protocol == IPPROTO_TCP;
|
||||
}
|
||||
|
||||
static inline bool sk_is_stream_unix(const struct sock *sk)
|
||||
{
|
||||
return sk->sk_family == AF_UNIX && sk->sk_type == SOCK_STREAM;
|
||||
}
|
||||
|
||||
/**
|
||||
* sk_eat_skb - Release a skb if it is no longer needed
|
||||
* @sk: socket to eat this skb from
|
||||
|
||||
@@ -332,6 +332,7 @@ int tcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size);
|
||||
int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size);
|
||||
int tcp_sendmsg_fastopen(struct sock *sk, struct msghdr *msg, int *copied,
|
||||
size_t size, struct ubuf_info *uarg);
|
||||
void tcp_splice_eof(struct socket *sock);
|
||||
int tcp_sendpage(struct sock *sk, struct page *page, int offset, size_t size,
|
||||
int flags);
|
||||
int tcp_sendpage_locked(struct sock *sk, struct page *page, int offset,
|
||||
|
||||
@@ -269,6 +269,7 @@ int udp_get_port(struct sock *sk, unsigned short snum,
|
||||
int udp_err(struct sk_buff *, u32);
|
||||
int udp_abort(struct sock *sk, int err);
|
||||
int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len);
|
||||
void udp_splice_eof(struct socket *sock);
|
||||
int udp_push_pending_frames(struct sock *sk);
|
||||
void udp_flush_pending_frames(struct sock *sk);
|
||||
int udp_cmsg_send(struct sock *sk, struct msghdr *msg, u16 *gso_size);
|
||||
|
||||
@@ -174,16 +174,13 @@ static inline int udp_tunnel_handle_offloads(struct sk_buff *skb, bool udp_csum)
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void udp_tunnel_encap_enable(struct socket *sock)
|
||||
static inline void udp_tunnel_encap_enable(struct sock *sk)
|
||||
{
|
||||
struct udp_sock *up = udp_sk(sock->sk);
|
||||
|
||||
if (up->encap_enabled)
|
||||
if (udp_test_and_set_bit(ENCAP_ENABLED, sk))
|
||||
return;
|
||||
|
||||
up->encap_enabled = 1;
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
if (sock->sk->sk_family == PF_INET6)
|
||||
if (READ_ONCE(sk->sk_family) == PF_INET6)
|
||||
ipv6_stub->udpv6_encap_enable();
|
||||
#endif
|
||||
udp_encap_enable();
|
||||
|
||||
Reference in New Issue
Block a user