]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/linux/filter.h
regulator: ab8500: Remove AB8505 USB regulator
[mirror_ubuntu-bionic-kernel.git] / include / linux / filter.h
index 80b5b482cb4617ef0fc7f762edf93921ce562cf2..baec2c2696021f24bf1550d1b63958e566ffca5f 100644 (file)
@@ -46,14 +46,10 @@ struct bpf_prog_aux;
 #define BPF_REG_X      BPF_REG_7
 #define BPF_REG_TMP    BPF_REG_8
 
-/* Kernel hidden auxiliary/helper register for hardening step.
- * Only used by eBPF JITs. It's nothing more than a temporary
- * register that JITs use internally, only that here it's part
- * of eBPF instructions that have been rewritten for blinding
- * constants. See JIT pre-step in bpf_jit_blind_constants().
- */
+/* Kernel hidden auxiliary/helper register. */
 #define BPF_REG_AX             MAX_BPF_REG
-#define MAX_BPF_JIT_REG                (MAX_BPF_REG + 1)
+#define MAX_BPF_EXT_REG                (MAX_BPF_REG + 1)
+#define MAX_BPF_JIT_REG                MAX_BPF_EXT_REG
 
 /* unused opcode to mark special call to bpf_tail_call() helper */
 #define BPF_TAIL_CALL  0xf0
@@ -449,7 +445,9 @@ struct sock_fprog_kern {
 
 struct bpf_binary_header {
        unsigned int pages;
-       u8 image[];
+
+       /* Some arches need word alignment for their instructions */
+       u8 image[] __aligned(4);
 };
 
 struct bpf_prog {
@@ -636,6 +634,7 @@ static inline void bpf_prog_unlock_ro(struct bpf_prog *fp)
 static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr)
 {
        WARN_ON_ONCE(set_memory_ro((unsigned long)hdr, hdr->pages));
+       set_memory_x((unsigned long)hdr, hdr->pages);
 }
 
 static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr)
@@ -753,6 +752,7 @@ struct sock *do_sk_redirect_map(struct sk_buff *skb);
 extern int bpf_jit_enable;
 extern int bpf_jit_harden;
 extern int bpf_jit_kallsyms;
+extern long bpf_jit_limit;
 
 typedef void (*bpf_jit_fill_hole_t)(void *area, unsigned int size);
 
@@ -761,7 +761,9 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
                     unsigned int alignment,
                     bpf_jit_fill_hole_t bpf_fill_ill_insns);
 void bpf_jit_binary_free(struct bpf_binary_header *hdr);
-
+u64 bpf_jit_alloc_exec_limit(void);
+void *bpf_jit_alloc_exec(unsigned long size);
+void bpf_jit_free_exec(void *addr);
 void bpf_jit_free(struct bpf_prog *fp);
 
 struct bpf_prog *bpf_jit_blind_constants(struct bpf_prog *fp);