History

Merge 5.1-rc3 into char-misc-next

We want the char-misc fixes in here as well.

Greg Kroah-Hartman committed 7 years ago

Commit 62fa7842 parents ae21f41 79a3aaa558 files · +6042 −7184Browse files

Showing the changes to include/uapi/linux (3 of 558 files). Show all

Unified · Split

3 files
  1. include/uapi/linux/Kbuild +2 −0
  2. include/uapi/linux/bpf.h +127 −61
  3. include/uapi/linux/vbox_vmmdev_types.h +60 −0
include/uapi/linux/Kbuild+2−0
@@ -7,5 +7,7 @@ no-export-headers += kvm.h · 6 unmodified lines
7endif7endif
8 8
9ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),)9ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),)
10ifeq ($(wildcard $(objtree)/arch/$(SRCARCH)/include/generated/uapi/asm/kvm_para.h),)
10no-export-headers += kvm_para.h11no-export-headers += kvm_para.h
11endif12endif
13endif
include/uapi/linux/bpf.h+127−61
@@ -502,16 +502,6 @@ union bpf_attr { · 501 unmodified lines
502 * Return502 * Return
503 * 0 on success, or a negative error in case of failure.503 * 0 on success, or a negative error in case of failure.
504 *504 *
505 * int bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags)
506 * Description
507 * Push an element *value* in *map*. *flags* is one of:
508 *
509 * **BPF_EXIST**
510 * If the queue/stack is full, the oldest element is removed to
511 * make room for this.
512 * Return
513 * 0 on success, or a negative error in case of failure.
514 *
515 * int bpf_probe_read(void *dst, u32 size, const void *src)505 * int bpf_probe_read(void *dst, u32 size, const void *src)
516 * Description506 * Description
517 * For tracing programs, safely attempt to read *size* bytes from507 * For tracing programs, safely attempt to read *size* bytes from
@@ -1435,14 +1425,14 @@ union bpf_attr { · 917 unmodified lines
1435 * u64 bpf_get_socket_cookie(struct bpf_sock_addr *ctx)1425 * u64 bpf_get_socket_cookie(struct bpf_sock_addr *ctx)
1436 * Description1426 * Description
1437 * Equivalent to bpf_get_socket_cookie() helper that accepts1427 * Equivalent to bpf_get_socket_cookie() helper that accepts
1438 * *skb*, but gets socket from **struct bpf_sock_addr** contex.1428 * *skb*, but gets socket from **struct bpf_sock_addr** context.
1439 * Return1429 * Return
1440 * A 8-byte long non-decreasing number.1430 * A 8-byte long non-decreasing number.
1441 *1431 *
1442 * u64 bpf_get_socket_cookie(struct bpf_sock_ops *ctx)1432 * u64 bpf_get_socket_cookie(struct bpf_sock_ops *ctx)
1443 * Description1433 * Description
1444 * Equivalent to bpf_get_socket_cookie() helper that accepts1434 * Equivalent to bpf_get_socket_cookie() helper that accepts
1445 * *skb*, but gets socket from **struct bpf_sock_ops** contex.1435 * *skb*, but gets socket from **struct bpf_sock_ops** context.
1446 * Return1436 * Return
1447 * A 8-byte long non-decreasing number.1437 * A 8-byte long non-decreasing number.
1448 *1438 *
@@ -2098,52 +2088,52 @@ union bpf_attr { · 649 unmodified lines
2098 * Return2088 * Return
2099 * 0 on success, or a negative error in case of failure.2089 * 0 on success, or a negative error in case of failure.
2100 *2090 *
2101 * int bpf_rc_keydown(void *ctx, u32 protocol, u64 scancode, u32 toggle)2091 * int bpf_rc_repeat(void *ctx)
2102 * Description2092 * Description
2103 * This helper is used in programs implementing IR decoding, to2093 * This helper is used in programs implementing IR decoding, to
2104 * report a successfully decoded key press with *scancode*,2094 * report a successfully decoded repeat key message. This delays
2105 * *toggle* value in the given *protocol*. The scancode will be2095 * the generation of a key up event for previously generated
2106 * translated to a keycode using the rc keymap, and reported as2096 * key down event.
2107 * an input key down event. After a period a key up event is
2108 * generated. This period can be extended by calling either
2109 * **bpf_rc_keydown**\ () again with the same values, or calling
2110 * **bpf_rc_repeat**\ ().
2111 *2097 *
2112 * Some protocols include a toggle bit, in case the button was2098 * Some IR protocols like NEC have a special IR message for
2113 * released and pressed again between consecutive scancodes.2099 * repeating last button, for when a button is held down.
2114 *2100 *
2115 * The *ctx* should point to the lirc sample as passed into2101 * The *ctx* should point to the lirc sample as passed into
2116 * the program.2102 * the program.
2117 *2103 *
2118 * The *protocol* is the decoded protocol number (see
2119 * **enum rc_proto** for some predefined values).
2120 *
2121 * This helper is only available is the kernel was compiled with2104 * This helper is only available is the kernel was compiled with
2122 * the **CONFIG_BPF_LIRC_MODE2** configuration option set to2105 * the **CONFIG_BPF_LIRC_MODE2** configuration option set to
2123 * "**y**".2106 * "**y**".
2124 * Return2107 * Return
2125 * 02108 * 0
2126 *2109 *
2127 * int bpf_rc_repeat(void *ctx)2110 * int bpf_rc_keydown(void *ctx, u32 protocol, u64 scancode, u32 toggle)
2128 * Description2111 * Description
2129 * This helper is used in programs implementing IR decoding, to2112 * This helper is used in programs implementing IR decoding, to
2130 * report a successfully decoded repeat key message. This delays2113 * report a successfully decoded key press with *scancode*,
2131 * the generation of a key up event for previously generated2114 * *toggle* value in the given *protocol*. The scancode will be
2132 * key down event.2115 * translated to a keycode using the rc keymap, and reported as
2116 * an input key down event. After a period a key up event is
2117 * generated. This period can be extended by calling either
2118 * **bpf_rc_keydown**\ () again with the same values, or calling
2119 * **bpf_rc_repeat**\ ().
2133 *2120 *
2134 * Some IR protocols like NEC have a special IR message for2121 * Some protocols include a toggle bit, in case the button was
2135 * repeating last button, for when a button is held down.2122 * released and pressed again between consecutive scancodes.
2136 *2123 *
2137 * The *ctx* should point to the lirc sample as passed into2124 * The *ctx* should point to the lirc sample as passed into
2138 * the program.2125 * the program.
2139 *2126 *
2127 * The *protocol* is the decoded protocol number (see
2128 * **enum rc_proto** for some predefined values).
2129 *
2140 * This helper is only available is the kernel was compiled with2130 * This helper is only available is the kernel was compiled with
2141 * the **CONFIG_BPF_LIRC_MODE2** configuration option set to2131 * the **CONFIG_BPF_LIRC_MODE2** configuration option set to
2142 * "**y**".2132 * "**y**".
2143 * Return2133 * Return
2144 * 02134 * 0
2145 *2135 *
2146 * uint64_t bpf_skb_cgroup_id(struct sk_buff *skb)2136 * u64 bpf_skb_cgroup_id(struct sk_buff *skb)
2147 * Description2137 * Description
2148 * Return the cgroup v2 id of the socket associated with the *skb*.2138 * Return the cgroup v2 id of the socket associated with the *skb*.
2149 * This is roughly similar to the **bpf_get_cgroup_classid**\ ()2139 * This is roughly similar to the **bpf_get_cgroup_classid**\ ()
@@ -2159,30 +2149,12 @@ union bpf_attr { · 9 unmodified lines
2159 * Return2149 * Return
2160 * The id is returned or 0 in case the id could not be retrieved.2150 * The id is returned or 0 in case the id could not be retrieved.
2161 *2151 *
2162 * u64 bpf_skb_ancestor_cgroup_id(struct sk_buff *skb, int ancestor_level)
2163 * Description
2164 * Return id of cgroup v2 that is ancestor of cgroup associated
2165 * with the *skb* at the *ancestor_level*. The root cgroup is at
2166 * *ancestor_level* zero and each step down the hierarchy
2167 * increments the level. If *ancestor_level* == level of cgroup
2168 * associated with *skb*, then return value will be same as that
2169 * of **bpf_skb_cgroup_id**\ ().
2170 *
2171 * The helper is useful to implement policies based on cgroups
2172 * that are upper in hierarchy than immediate cgroup associated
2173 * with *skb*.
2174 *
2175 * The format of returned id and helper limitations are same as in
2176 * **bpf_skb_cgroup_id**\ ().
2177 * Return
2178 * The id is returned or 0 in case the id could not be retrieved.
2179 *
2180 * u64 bpf_get_current_cgroup_id(void)2152 * u64 bpf_get_current_cgroup_id(void)
2181 * Return2153 * Return
2182 * A 64-bit integer containing the current cgroup id based2154 * A 64-bit integer containing the current cgroup id based
2183 * on the cgroup within which the current task is running.2155 * on the cgroup within which the current task is running.
2184 *2156 *
2185 * void* get_local_storage(void *map, u64 flags)2157 * void *bpf_get_local_storage(void *map, u64 flags)
2186 * Description2158 * Description
2187 * Get the pointer to the local storage area.2159 * Get the pointer to the local storage area.
2188 * The type and the size of the local storage is defined2160 * The type and the size of the local storage is defined
@@ -2209,6 +2181,24 @@ union bpf_attr { · 20 unmodified lines
2209 * Return2181 * Return
2210 * 0 on success, or a negative error in case of failure.2182 * 0 on success, or a negative error in case of failure.
2211 *2183 *
2184 * u64 bpf_skb_ancestor_cgroup_id(struct sk_buff *skb, int ancestor_level)
2185 * Description
2186 * Return id of cgroup v2 that is ancestor of cgroup associated
2187 * with the *skb* at the *ancestor_level*. The root cgroup is at
2188 * *ancestor_level* zero and each step down the hierarchy
2189 * increments the level. If *ancestor_level* == level of cgroup
2190 * associated with *skb*, then return value will be same as that
2191 * of **bpf_skb_cgroup_id**\ ().
2192 *
2193 * The helper is useful to implement policies based on cgroups
2194 * that are upper in hierarchy than immediate cgroup associated
2195 * with *skb*.
2196 *
2197 * The format of returned id and helper limitations are same as in
2198 * **bpf_skb_cgroup_id**\ ().
2199 * Return
2200 * The id is returned or 0 in case the id could not be retrieved.
2201 *
2212 * struct bpf_sock *bpf_sk_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags)2202 * struct bpf_sock *bpf_sk_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags)
2213 * Description2203 * Description
2214 * Look for TCP socket matching *tuple*, optionally in a child2204 * Look for TCP socket matching *tuple*, optionally in a child
@@ -2289,6 +2279,16 @@ union bpf_attr { · 74 unmodified lines
2289 * Return2279 * Return
2290 * 0 on success, or a negative error in case of failure.2280 * 0 on success, or a negative error in case of failure.
2291 *2281 *
2282 * int bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags)
2283 * Description
2284 * Push an element *value* in *map*. *flags* is one of:
2285 *
2286 * **BPF_EXIST**
2287 * If the queue/stack is full, the oldest element is
2288 * removed to make room for this.
2289 * Return
2290 * 0 on success, or a negative error in case of failure.
2291 *
2292 * int bpf_map_pop_elem(struct bpf_map *map, void *value)2292 * int bpf_map_pop_elem(struct bpf_map *map, void *value)
2293 * Description2293 * Description
2294 * Pop an element from *map*.2294 * Pop an element from *map*.
@@ -2343,29 +2343,94 @@ union bpf_attr { · 48 unmodified lines
2343 * Return2343 * Return
2344 * 02344 * 0
2345 *2345 *
2346 * int bpf_spin_lock(struct bpf_spin_lock *lock)
2347 * Description
2348 * Acquire a spinlock represented by the pointer *lock*, which is
2349 * stored as part of a value of a map. Taking the lock allows to
2350 * safely update the rest of the fields in that value. The
2351 * spinlock can (and must) later be released with a call to
2352 * **bpf_spin_unlock**\ (\ *lock*\ ).
2353 *
2354 * Spinlocks in BPF programs come with a number of restrictions
2355 * and constraints:
2356 *
2357 * * **bpf_spin_lock** objects are only allowed inside maps of
2358 * types **BPF_MAP_TYPE_HASH** and **BPF_MAP_TYPE_ARRAY** (this
2359 * list could be extended in the future).
2360 * * BTF description of the map is mandatory.
2361 * * The BPF program can take ONE lock at a time, since taking two
2362 * or more could cause dead locks.
2363 * * Only one **struct bpf_spin_lock** is allowed per map element.
2364 * * When the lock is taken, calls (either BPF to BPF or helpers)
2365 * are not allowed.
2366 * * The **BPF_LD_ABS** and **BPF_LD_IND** instructions are not
2367 * allowed inside a spinlock-ed region.
2368 * * The BPF program MUST call **bpf_spin_unlock**\ () to release
2369 * the lock, on all execution paths, before it returns.
2370 * * The BPF program can access **struct bpf_spin_lock** only via
2371 * the **bpf_spin_lock**\ () and **bpf_spin_unlock**\ ()
2372 * helpers. Loading or storing data into the **struct
2373 * bpf_spin_lock** *lock*\ **;** field of a map is not allowed.
2374 * * To use the **bpf_spin_lock**\ () helper, the BTF description
2375 * of the map value must be a struct and have **struct
2376 * bpf_spin_lock** *anyname*\ **;** field at the top level.
2377 * Nested lock inside another struct is not allowed.
2378 * * The **struct bpf_spin_lock** *lock* field in a map value must
2379 * be aligned on a multiple of 4 bytes in that value.
2380 * * Syscall with command **BPF_MAP_LOOKUP_ELEM** does not copy
2381 * the **bpf_spin_lock** field to user space.
2382 * * Syscall with command **BPF_MAP_UPDATE_ELEM**, or update from
2383 * a BPF program, do not update the **bpf_spin_lock** field.
2384 * * **bpf_spin_lock** cannot be on the stack or inside a
2385 * networking packet (it can only be inside of a map values).
2386 * * **bpf_spin_lock** is available to root only.
2387 * * Tracing programs and socket filter programs cannot use
2388 * **bpf_spin_lock**\ () due to insufficient preemption checks
2389 * (but this may change in the future).
2390 * * **bpf_spin_lock** is not allowed in inner maps of map-in-map.
2391 * Return
2392 * 0
2393 *
2394 * int bpf_spin_unlock(struct bpf_spin_lock *lock)
2395 * Description
2396 * Release the *lock* previously locked by a call to
2397 * **bpf_spin_lock**\ (\ *lock*\ ).
2398 * Return
2399 * 0
2400 *
2346 * struct bpf_sock *bpf_sk_fullsock(struct bpf_sock *sk)2401 * struct bpf_sock *bpf_sk_fullsock(struct bpf_sock *sk)
2347 * Description2402 * Description
2348 * This helper gets a **struct bpf_sock** pointer such2403 * This helper gets a **struct bpf_sock** pointer such
2349 * that all the fields in bpf_sock can be accessed.2404 * that all the fields in this **bpf_sock** can be accessed.
2350 * Return2405 * Return
2351 * A **struct bpf_sock** pointer on success, or NULL in2406 * A **struct bpf_sock** pointer on success, or **NULL** in
2352 * case of failure.2407 * case of failure.
2353 *2408 *
2354 * struct bpf_tcp_sock *bpf_tcp_sock(struct bpf_sock *sk)2409 * struct bpf_tcp_sock *bpf_tcp_sock(struct bpf_sock *sk)
2355 * Description2410 * Description
2356 * This helper gets a **struct bpf_tcp_sock** pointer from a2411 * This helper gets a **struct bpf_tcp_sock** pointer from a
2357 * **struct bpf_sock** pointer.2412 * **struct bpf_sock** pointer.
2358 *
2359 * Return2413 * Return
2360 * A **struct bpf_tcp_sock** pointer on success, or NULL in2414 * A **struct bpf_tcp_sock** pointer on success, or **NULL** in
2361 * case of failure.2415 * case of failure.
2362 *2416 *
2363 * int bpf_skb_ecn_set_ce(struct sk_buf *skb)2417 * int bpf_skb_ecn_set_ce(struct sk_buf *skb)
2364 * Description2418 * Description
2365 * Sets ECN of IP header to ce (congestion encountered) if2419 * Set ECN (Explicit Congestion Notification) field of IP header
2366 * current value is ect (ECN capable). Works with IPv6 and IPv4.2420 * to **CE** (Congestion Encountered) if current value is **ECT**
2367 * Return2421 * (ECN Capable Transport). Otherwise, do nothing. Works with IPv6
2368 * 1 if set, 0 if not set.2422 * and IPv4.
2423 * Return
2424 * 1 if the **CE** flag is set (either by the current helper call
2425 * or because it was already present), 0 if it is not set.
2426 *
2427 * struct bpf_sock *bpf_get_listener_sock(struct bpf_sock *sk)
2428 * Description
2429 * Return a **struct bpf_sock** pointer in **TCP_LISTEN** state.
2430 * **bpf_sk_release**\ () is unnecessary and not allowed.
2431 * Return
2432 * A **struct bpf_sock** pointer on success, or **NULL** in
2433 * case of failure.
2369 */2434 */
2370#define __BPF_FUNC_MAPPER(FN) \2435#define __BPF_FUNC_MAPPER(FN) \
2371 FN(unspec), \2436 FN(unspec), \
@@ -2465,7 +2530,8 @@ union bpf_attr { · 93 unmodified lines
2465 FN(spin_unlock), \2530 FN(spin_unlock), \
2466 FN(sk_fullsock), \2531 FN(sk_fullsock), \
2467 FN(tcp_sock), \2532 FN(tcp_sock), \
2468 FN(skb_ecn_set_ce),2533 FN(skb_ecn_set_ce), \
2534 FN(get_listener_sock),
2469 2535
2470/* integer value in 'imm' field of BPF_CALL instruction selects which helper2536/* integer value in 'imm' field of BPF_CALL instruction selects which helper
2471 * function eBPF program intends to call2537 * function eBPF program intends to call
include/uapi/linux/vbox_vmmdev_types.h+60−0
@@ -102,6 +102,66 @@ enum vmmdev_request_type { · 101 unmodified lines
102#define VMMDEVREQ_HGCM_CALL VMMDEVREQ_HGCM_CALL32102#define VMMDEVREQ_HGCM_CALL VMMDEVREQ_HGCM_CALL32
103#endif103#endif
104 104
105/* vmmdev_request_header.requestor defines */
106
107/* Requestor user not given. */
108#define VMMDEV_REQUESTOR_USR_NOT_GIVEN 0x00000000
109/* The kernel driver (vboxguest) is the requestor. */
110#define VMMDEV_REQUESTOR_USR_DRV 0x00000001
111/* Some other kernel driver is the requestor. */
112#define VMMDEV_REQUESTOR_USR_DRV_OTHER 0x00000002
113/* The root or a admin user is the requestor. */
114#define VMMDEV_REQUESTOR_USR_ROOT 0x00000003
115/* Regular joe user is making the request. */
116#define VMMDEV_REQUESTOR_USR_USER 0x00000006
117/* User classification mask. */
118#define VMMDEV_REQUESTOR_USR_MASK 0x00000007
119
120/* Kernel mode request. Note this is 0, check for !USERMODE instead. */
121#define VMMDEV_REQUESTOR_KERNEL 0x00000000
122/* User mode request. */
123#define VMMDEV_REQUESTOR_USERMODE 0x00000008
124/* User or kernel mode classification mask. */
125#define VMMDEV_REQUESTOR_MODE_MASK 0x00000008
126
127/* Don't know the physical console association of the requestor. */
128#define VMMDEV_REQUESTOR_CON_DONT_KNOW 0x00000000
129/*
130 * The request originates with a process that is NOT associated with the
131 * physical console.
132 */
133#define VMMDEV_REQUESTOR_CON_NO 0x00000010
134/* Requestor process is associated with the physical console. */
135#define VMMDEV_REQUESTOR_CON_YES 0x00000020
136/* Console classification mask. */
137#define VMMDEV_REQUESTOR_CON_MASK 0x00000030
138
139/* Requestor is member of special VirtualBox user group. */
140#define VMMDEV_REQUESTOR_GRP_VBOX 0x00000080
141
142/* Note: trust level is for windows guests only, linux always uses not-given */
143/* Requestor trust level: Unspecified */
144#define VMMDEV_REQUESTOR_TRUST_NOT_GIVEN 0x00000000
145/* Requestor trust level: Untrusted (SID S-1-16-0) */
146#define VMMDEV_REQUESTOR_TRUST_UNTRUSTED 0x00001000
147/* Requestor trust level: Untrusted (SID S-1-16-4096) */
148#define VMMDEV_REQUESTOR_TRUST_LOW 0x00002000
149/* Requestor trust level: Medium (SID S-1-16-8192) */
150#define VMMDEV_REQUESTOR_TRUST_MEDIUM 0x00003000
151/* Requestor trust level: Medium plus (SID S-1-16-8448) */
152#define VMMDEV_REQUESTOR_TRUST_MEDIUM_PLUS 0x00004000
153/* Requestor trust level: High (SID S-1-16-12288) */
154#define VMMDEV_REQUESTOR_TRUST_HIGH 0x00005000
155/* Requestor trust level: System (SID S-1-16-16384) */
156#define VMMDEV_REQUESTOR_TRUST_SYSTEM 0x00006000
157/* Requestor trust level >= Protected (SID S-1-16-20480, S-1-16-28672) */
158#define VMMDEV_REQUESTOR_TRUST_PROTECTED 0x00007000
159/* Requestor trust level mask */
160#define VMMDEV_REQUESTOR_TRUST_MASK 0x00007000
161
162/* Requestor is using the less trusted user device node (/dev/vboxuser) */
163#define VMMDEV_REQUESTOR_USER_DEVICE 0x00008000
164
105/** HGCM service location types. */165/** HGCM service location types. */
106enum vmmdev_hgcm_service_location_type {166enum vmmdev_hgcm_service_location_type {
107 VMMDEV_HGCM_LOC_INVALID = 0,167 VMMDEV_HGCM_LOC_INVALID = 0,