mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Smooth Cong Wang's bug fix into 'net-next'. Basically put the bulk of the tcf_block_put() logic from 'net' into tcf_block_put_ext(), but after the offload unbind. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
ed29668d1a
47 changed files with 284 additions and 169 deletions
|
|
@ -104,13 +104,19 @@ static inline void bpf_compute_data_end_sk_skb(struct sk_buff *skb)
|
|||
TCP_SKB_CB(skb)->bpf.data_end = skb->data + skb_headlen(skb);
|
||||
}
|
||||
|
||||
enum __sk_action {
|
||||
__SK_DROP = 0,
|
||||
__SK_PASS,
|
||||
__SK_REDIRECT,
|
||||
};
|
||||
|
||||
static int smap_verdict_func(struct smap_psock *psock, struct sk_buff *skb)
|
||||
{
|
||||
struct bpf_prog *prog = READ_ONCE(psock->bpf_verdict);
|
||||
int rc;
|
||||
|
||||
if (unlikely(!prog))
|
||||
return SK_DROP;
|
||||
return __SK_DROP;
|
||||
|
||||
skb_orphan(skb);
|
||||
/* We need to ensure that BPF metadata for maps is also cleared
|
||||
|
|
@ -125,8 +131,10 @@ static int smap_verdict_func(struct smap_psock *psock, struct sk_buff *skb)
|
|||
preempt_enable();
|
||||
skb->sk = NULL;
|
||||
|
||||
/* Moving return codes from UAPI namespace into internal namespace */
|
||||
return rc == SK_PASS ?
|
||||
(TCP_SKB_CB(skb)->bpf.map ? SK_REDIRECT : SK_PASS) : SK_DROP;
|
||||
(TCP_SKB_CB(skb)->bpf.map ? __SK_REDIRECT : __SK_PASS) :
|
||||
__SK_DROP;
|
||||
}
|
||||
|
||||
static void smap_do_verdict(struct smap_psock *psock, struct sk_buff *skb)
|
||||
|
|
@ -136,7 +144,7 @@ static void smap_do_verdict(struct smap_psock *psock, struct sk_buff *skb)
|
|||
|
||||
rc = smap_verdict_func(psock, skb);
|
||||
switch (rc) {
|
||||
case SK_REDIRECT:
|
||||
case __SK_REDIRECT:
|
||||
sk = do_sk_redirect_map(skb);
|
||||
if (likely(sk)) {
|
||||
struct smap_psock *peer = smap_psock_sk(sk);
|
||||
|
|
@ -152,7 +160,7 @@ static void smap_do_verdict(struct smap_psock *psock, struct sk_buff *skb)
|
|||
}
|
||||
}
|
||||
/* Fall through and free skb otherwise */
|
||||
case SK_DROP:
|
||||
case __SK_DROP:
|
||||
default:
|
||||
kfree_skb(skb);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2698,7 +2698,7 @@ enum siginfo_layout siginfo_layout(int sig, int si_code)
|
|||
[SIGSEGV] = { NSIGSEGV, SIL_FAULT },
|
||||
[SIGBUS] = { NSIGBUS, SIL_FAULT },
|
||||
[SIGTRAP] = { NSIGTRAP, SIL_FAULT },
|
||||
#if defined(SIGMET) && defined(NSIGEMT)
|
||||
#if defined(SIGEMT) && defined(NSIGEMT)
|
||||
[SIGEMT] = { NSIGEMT, SIL_FAULT },
|
||||
#endif
|
||||
[SIGCHLD] = { NSIGCHLD, SIL_CHLD },
|
||||
|
|
|
|||
Loading…
Reference in a new issue