diff options
| author | Thomas Gleixner <[email protected]> | 2019-05-06 12:04:12 +0200 | 
|---|---|---|
| committer | Thomas Gleixner <[email protected]> | 2019-05-06 12:04:12 +0200 | 
| commit | fb4e0592654adb31bc6f3a738d6499b816a655d6 (patch) | |
| tree | e6edaf18cf3a7f49e93fb51de5a47f4b9e786f53 /include/linux/bpf_verifier.h | |
| parent | 471ba0e686cb13752bc1ff3216c54b69a2d250ea (diff) | |
| parent | 16e32c3cde7763ab875b9030b443ecbc8e352d8a (diff) | |
Merge tag 'irqchip-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core
Pull irqchip updates from Marc Zyngier
- The huge (and terrifying) TI INTR/INTA set of drivers
- Rewrite of the stm32mp1-exti driver as a platform driver
- Update the IOMMU MSI mapping API to be RT friendly
- A number of cleanups and other low impact fixes
Diffstat (limited to 'include/linux/bpf_verifier.h')
| -rw-r--r-- | include/linux/bpf_verifier.h | 40 | 
1 files changed, 40 insertions, 0 deletions
| diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h index 69f7a3449eda..7d8228d1c898 100644 --- a/include/linux/bpf_verifier.h +++ b/include/linux/bpf_verifier.h @@ -66,6 +66,46 @@ struct bpf_reg_state {  	 * same reference to the socket, to determine proper reference freeing.  	 */  	u32 id; +	/* PTR_TO_SOCKET and PTR_TO_TCP_SOCK could be a ptr returned +	 * from a pointer-cast helper, bpf_sk_fullsock() and +	 * bpf_tcp_sock(). +	 * +	 * Consider the following where "sk" is a reference counted +	 * pointer returned from "sk = bpf_sk_lookup_tcp();": +	 * +	 * 1: sk = bpf_sk_lookup_tcp(); +	 * 2: if (!sk) { return 0; } +	 * 3: fullsock = bpf_sk_fullsock(sk); +	 * 4: if (!fullsock) { bpf_sk_release(sk); return 0; } +	 * 5: tp = bpf_tcp_sock(fullsock); +	 * 6: if (!tp) { bpf_sk_release(sk); return 0; } +	 * 7: bpf_sk_release(sk); +	 * 8: snd_cwnd = tp->snd_cwnd;  // verifier will complain +	 * +	 * After bpf_sk_release(sk) at line 7, both "fullsock" ptr and +	 * "tp" ptr should be invalidated also.  In order to do that, +	 * the reg holding "fullsock" and "sk" need to remember +	 * the original refcounted ptr id (i.e. sk_reg->id) in ref_obj_id +	 * such that the verifier can reset all regs which have +	 * ref_obj_id matching the sk_reg->id. +	 * +	 * sk_reg->ref_obj_id is set to sk_reg->id at line 1. +	 * sk_reg->id will stay as NULL-marking purpose only. +	 * After NULL-marking is done, sk_reg->id can be reset to 0. +	 * +	 * After "fullsock = bpf_sk_fullsock(sk);" at line 3, +	 * fullsock_reg->ref_obj_id is set to sk_reg->ref_obj_id. +	 * +	 * After "tp = bpf_tcp_sock(fullsock);" at line 5, +	 * tp_reg->ref_obj_id is set to fullsock_reg->ref_obj_id +	 * which is the same as sk_reg->ref_obj_id. +	 * +	 * From the verifier perspective, if sk, fullsock and tp +	 * are not NULL, they are the same ptr with different +	 * reg->type.  In particular, bpf_sk_release(tp) is also +	 * allowed and has the same effect as bpf_sk_release(sk). +	 */ +	u32 ref_obj_id;  	/* For scalar types (SCALAR_VALUE), this represents our knowledge of  	 * the actual value.  	 * For pointer types, this represents the variable part of the offset |