diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2024-03-28 17:24:10 -0700 | 
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2024-03-28 17:25:57 -0700 | 
| commit | 5e47fbe5cefe5d25d1fa4481c1b9fbe602b4a69f (patch) | |
| tree | b86edc39098cca1d0e53e46dceec6ca856183642 /tools/lib/bpf/libbpf.c | |
| parent | 2a702c2e57908e7bb5c814afeac577a14815c2f2 (diff) | |
| parent | 50108c352db70405b3d71d8099d0b3adc3b3352c (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR.
No conflicts, or adjacent changes.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
| -rw-r--r-- | tools/lib/bpf/libbpf.c | 10 | 
1 files changed, 7 insertions, 3 deletions
| diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 8eb2cd4ef288..d7d8f78f8846 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -498,7 +498,7 @@ struct bpf_struct_ops {  #define KSYMS_SEC ".ksyms"  #define STRUCT_OPS_SEC ".struct_ops"  #define STRUCT_OPS_LINK_SEC ".struct_ops.link" -#define ARENA_SEC ".arena.1" +#define ARENA_SEC ".addr_space.1"  enum libbpf_map_type {  	LIBBPF_MAP_UNSPEC, @@ -1664,6 +1664,10 @@ static int sys_memfd_create(const char *name, unsigned flags)  	return syscall(__NR_memfd_create, name, flags);  } +#ifndef MFD_CLOEXEC +#define MFD_CLOEXEC 0x0001U +#endif +  static int create_placeholder_fd(void)  {  	int fd; @@ -5366,8 +5370,8 @@ retry:  					goto err_out;  			}  			if (map->def.type == BPF_MAP_TYPE_ARENA) { -				map->mmaped = mmap((void *)map->map_extra, bpf_map_mmap_sz(map), -						   PROT_READ | PROT_WRITE, +				map->mmaped = mmap((void *)(long)map->map_extra, +						   bpf_map_mmap_sz(map), PROT_READ | PROT_WRITE,  						   map->map_extra ? MAP_SHARED | MAP_FIXED : MAP_SHARED,  						   map->fd, 0);  				if (map->mmaped == MAP_FAILED) { | 
