Skip to content

Commit 103ff11

Browse files
committed
Merge remote-tracking branch 'linegae/lineage-20' into qcom_rio
2 parents c8016e9 + 7d4c64f commit 103ff11

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+825
-464
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9141,6 +9141,7 @@ F: include/linux/skmsg.h
91419141
F: net/core/skmsg.c
91429142
F: net/core/sock_map.c
91439143
F: net/ipv4/tcp_bpf.c
9144+
F: net/ipv4/udp_bpf.c
91449145

91459146
LANTIQ / INTEL Ethernet drivers
91469147
M: Hauke Mehrtens <hauke@hauke-m.de>

drivers/cdrom/cdrom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3495,7 +3495,7 @@ static int cdrom_print_info(const char *header, int val, char *info,
34953495
}
34963496

34973497
static int cdrom_sysctl_info(struct ctl_table *ctl, int write,
3498-
void __user *buffer, size_t *lenp, loff_t *ppos)
3498+
void *buffer, size_t *lenp, loff_t *ppos)
34993499
{
35003500
int pos;
35013501
char *info = cdrom_sysctl_settings.info;

drivers/char/random.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,7 @@ static int proc_do_uuid(struct ctl_table *table, int write, void *buf,
14771477
}
14781478

14791479
/* The same as proc_dointvec, but writes don't change anything. */
1480-
static int proc_do_rointvec(struct ctl_table *table, int write, void __user *buf,
1480+
static int proc_do_rointvec(struct ctl_table *table, int write, void *buf,
14811481
size_t *lenp, loff_t *ppos)
14821482
{
14831483
return write ? 0 : proc_dointvec(table, 0, buf, lenp, ppos);

fs/fs-writeback.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2208,7 +2208,7 @@ static int __init start_dirtytime_writeback(void)
22082208
__initcall(start_dirtytime_writeback);
22092209

22102210
int dirtytime_interval_handler(struct ctl_table *table, int write,
2211-
void __user *buffer, size_t *lenp, loff_t *ppos)
2211+
void *buffer, size_t *lenp, loff_t *ppos)
22122212
{
22132213
int ret;
22142214

fs/proc/proc_sysctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ static ssize_t proc_sys_call_handler(struct kiocb *iocb, struct iov_iter *iter,
604604
error = -ENOMEM;
605605
if (count >= KMALLOC_MAX_SIZE)
606606
goto out;
607-
kbuf = kzalloc(count + 1, GFP_KERNEL);
607+
kbuf = kvzalloc(count + 1, GFP_KERNEL);
608608
if (!kbuf)
609609
goto out;
610610

@@ -633,7 +633,7 @@ static ssize_t proc_sys_call_handler(struct kiocb *iocb, struct iov_iter *iter,
633633

634634
error = count;
635635
out_free_buf:
636-
kfree(kbuf);
636+
kvfree(kbuf);
637637
out:
638638
sysctl_head_finish(head);
639639

include/linux/bpf.h

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <linux/kallsyms.h>
2222
#include <linux/capability.h>
2323
#include <linux/percpu-refcount.h>
24+
#include <linux/android_kabi.h>
2425

2526
struct bpf_verifier_env;
2627
struct bpf_verifier_log;
@@ -132,6 +133,9 @@ struct bpf_map_ops {
132133

133134
/* bpf_iter info used to open a seq_file */
134135
const struct bpf_iter_seq_info *iter_seq_info;
136+
137+
ANDROID_KABI_RESERVE(1);
138+
ANDROID_KABI_RESERVE(2);
135139
};
136140

137141
struct bpf_map_memory {
@@ -218,6 +222,8 @@ struct bpf_map_dev_ops {
218222
int (*map_update_elem)(struct bpf_offloaded_map *map,
219223
void *key, void *value, u64 flags);
220224
int (*map_delete_elem)(struct bpf_offloaded_map *map, void *key);
225+
226+
ANDROID_KABI_RESERVE(1);
221227
};
222228

223229
struct bpf_offloaded_map {
@@ -459,6 +465,7 @@ struct bpf_verifier_ops {
459465
const struct btf_type *t, int off, int size,
460466
enum bpf_access_type atype,
461467
u32 *next_btf_id);
468+
ANDROID_KABI_RESERVE(1);
462469
};
463470

464471
struct bpf_prog_offload_ops {
@@ -474,6 +481,7 @@ struct bpf_prog_offload_ops {
474481
int (*prepare)(struct bpf_prog *prog);
475482
int (*translate)(struct bpf_prog *prog);
476483
void (*destroy)(struct bpf_prog *prog);
484+
ANDROID_KABI_RESERVE(1);
477485
};
478486

479487
struct bpf_prog_offload {
@@ -855,6 +863,7 @@ struct bpf_prog_aux {
855863
struct work_struct work;
856864
struct rcu_head rcu;
857865
};
866+
ANDROID_KABI_RESERVE(1);
858867
};
859868

860869
struct bpf_array_aux {
@@ -1774,7 +1783,7 @@ static inline void bpf_map_offload_map_free(struct bpf_map *map)
17741783
}
17751784
#endif /* CONFIG_NET && CONFIG_BPF_SYSCALL */
17761785

1777-
#if defined(CONFIG_BPF_STREAM_PARSER)
1786+
#if defined(CONFIG_INET) && defined(CONFIG_BPF_SYSCALL)
17781787
int sock_map_prog_update(struct bpf_map *map, struct bpf_prog *prog,
17791788
struct bpf_prog *old, u32 which);
17801789
int sock_map_get_from_fd(const union bpf_attr *attr, struct bpf_prog *prog);
@@ -1783,7 +1792,18 @@ int sock_map_update_elem_sys(struct bpf_map *map, void *key, void *value, u64 fl
17831792
void sock_map_unhash(struct sock *sk);
17841793
void sock_map_destroy(struct sock *sk);
17851794
void sock_map_close(struct sock *sk, long timeout);
1795+
1796+
void bpf_sk_reuseport_detach(struct sock *sk);
1797+
int bpf_fd_reuseport_array_lookup_elem(struct bpf_map *map, void *key,
1798+
void *value);
1799+
int bpf_fd_reuseport_array_update_elem(struct bpf_map *map, void *key,
1800+
void *value, u64 map_flags);
17861801
#else
1802+
static inline void bpf_sk_reuseport_detach(struct sock *sk)
1803+
{
1804+
}
1805+
1806+
#ifdef CONFIG_BPF_SYSCALL
17871807
static inline int sock_map_prog_update(struct bpf_map *map,
17881808
struct bpf_prog *prog,
17891809
struct bpf_prog *old, u32 which)
@@ -1808,20 +1828,7 @@ static inline int sock_map_update_elem_sys(struct bpf_map *map, void *key, void
18081828
{
18091829
return -EOPNOTSUPP;
18101830
}
1811-
#endif /* CONFIG_BPF_STREAM_PARSER */
18121831

1813-
#if defined(CONFIG_INET) && defined(CONFIG_BPF_SYSCALL)
1814-
void bpf_sk_reuseport_detach(struct sock *sk);
1815-
int bpf_fd_reuseport_array_lookup_elem(struct bpf_map *map, void *key,
1816-
void *value);
1817-
int bpf_fd_reuseport_array_update_elem(struct bpf_map *map, void *key,
1818-
void *value, u64 map_flags);
1819-
#else
1820-
static inline void bpf_sk_reuseport_detach(struct sock *sk)
1821-
{
1822-
}
1823-
1824-
#ifdef CONFIG_BPF_SYSCALL
18251832
static inline int bpf_fd_reuseport_array_lookup_elem(struct bpf_map *map,
18261833
void *key, void *value)
18271834
{

include/linux/bpf_types.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ BPF_MAP_TYPE(BPF_MAP_TYPE_HASH_OF_MAPS, htab_of_maps_map_ops)
103103
BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP, dev_map_ops)
104104
BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP_HASH, dev_map_hash_ops)
105105
BPF_MAP_TYPE(BPF_MAP_TYPE_SK_STORAGE, sk_storage_map_ops)
106-
#if defined(CONFIG_BPF_STREAM_PARSER)
107-
BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKMAP, sock_map_ops)
108-
BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKHASH, sock_hash_ops)
109-
#endif
110106
#ifdef CONFIG_BPF_LSM
111107
BPF_MAP_TYPE(BPF_MAP_TYPE_INODE_STORAGE, inode_storage_map_ops)
112108
#endif
@@ -115,6 +111,8 @@ BPF_MAP_TYPE(BPF_MAP_TYPE_CPUMAP, cpu_map_ops)
115111
BPF_MAP_TYPE(BPF_MAP_TYPE_XSKMAP, xsk_map_ops)
116112
#endif
117113
#ifdef CONFIG_INET
114+
BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKMAP, sock_map_ops)
115+
BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKHASH, sock_hash_ops)
118116
BPF_MAP_TYPE(BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, reuseport_array_ops)
119117
#endif
120118
#endif

include/linux/bpf_verifier.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/bpf.h> /* for enum bpf_reg_type */
88
#include <linux/filter.h> /* for MAX_BPF_STACK */
99
#include <linux/tnum.h>
10+
#include <linux/android_kabi.h>
1011

1112
/* Maximum variable offset umax_value permitted when resolving memory accesses.
1213
* In practice this is far bigger than any realistic pointer offset; this limit
@@ -347,7 +348,7 @@ struct bpf_insn_aux_data {
347348
};
348349
u64 map_key_state; /* constant (32 bit) key tracking for maps */
349350
int ctx_field_size; /* the ctx field size for load insn, maybe 0 */
350-
u32 seen; /* this insn was processed by the verifier */
351+
u32 seen; /* this insn was processed by the verifier at env->pass_cnt */
351352
bool sanitize_stack_spill; /* subject to Spectre v4 sanitation */
352353
bool zext_dst; /* this insn zero extends dst reg */
353354
u8 alu_state; /* used in combination with alu_limit */
@@ -405,6 +406,8 @@ struct bpf_subprog_info {
405406
bool has_tail_call;
406407
bool tail_call_reachable;
407408
bool has_ld_abs;
409+
410+
ANDROID_KABI_RESERVE(1);
408411
};
409412

410413
/* single container for all structs
@@ -462,6 +465,9 @@ struct bpf_verifier_env {
462465
u32 peak_states;
463466
/* longest register parentage chain walked for liveness marking */
464467
u32 longest_mark_read_walk;
468+
469+
ANDROID_KABI_RESERVE(1);
470+
ANDROID_KABI_RESERVE(2);
465471
};
466472

467473
__printf(2, 0) void bpf_verifier_vlog(struct bpf_verifier_log *log,

include/linux/bpfilter.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@
44

55
#include <uapi/linux/bpfilter.h>
66
#include <linux/usermode_driver.h>
7+
#include <linux/sockptr.h>
78

89
struct sock;
9-
int bpfilter_ip_set_sockopt(struct sock *sk, int optname, char __user *optval,
10+
int bpfilter_ip_set_sockopt(struct sock *sk, int optname, sockptr_t optval,
1011
unsigned int optlen);
1112
int bpfilter_ip_get_sockopt(struct sock *sk, int optname, char __user *optval,
1213
int __user *optlen);
14+
void bpfilter_umh_cleanup(struct umd_info *info);
15+
1316
struct bpfilter_umh_ops {
1417
struct umd_info info;
1518
/* since ip_getsockopt() can run in parallel, serialize access to umh */
1619
struct mutex lock;
17-
int (*sockopt)(struct sock *sk, int optname,
18-
char __user *optval,
20+
int (*sockopt)(struct sock *sk, int optname, sockptr_t optval,
1921
unsigned int optlen, bool is_set);
2022
int (*start)(void);
21-
bool stop;
2223
};
2324
extern struct bpfilter_umh_ops bpfilter_ops;
2425
#endif

include/linux/ftrace.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ static inline int ftrace_mod_get_kallsym(unsigned int symnum, unsigned long *val
8181
extern int ftrace_enabled;
8282
extern int
8383
ftrace_enable_sysctl(struct ctl_table *table, int write,
84-
void __user *buffer, size_t *lenp,
85-
loff_t *ppos);
84+
void *buffer, size_t *lenp, loff_t *ppos);
8685

8786
struct ftrace_ops;
8887

@@ -281,9 +280,8 @@ static inline void arch_ftrace_set_direct_caller(struct pt_regs *regs,
281280

282281
extern int stack_tracer_enabled;
283282

284-
int stack_trace_sysctl(struct ctl_table *table, int write,
285-
void __user *buffer, size_t *lenp,
286-
loff_t *ppos);
283+
int stack_trace_sysctl(struct ctl_table *table, int write, void *buffer,
284+
size_t *lenp, loff_t *ppos);
287285

288286
/* DO NOT MODIFY THIS VARIABLE DIRECTLY! */
289287
DECLARE_PER_CPU(int, disable_stack_tracer);

0 commit comments

Comments
 (0)