Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf

Daniel Borkmann says:

====================
pull-request: bpf 2018-06-12

The following pull-request contains BPF updates for your *net* tree.

The main changes are:

1) Avoid an allocation warning in AF_XDP by adding __GFP_NOWARN for the
umem setup, from Björn.

2) Silence a warning in bpf fs when an application tries to open(2) a
pinned bpf obj due to missing fops. Add a dummy open fop that continues
to just bail out in such case, from Daniel.

3) Fix a BPF selftest urandom_read build issue where gcc complains that
it gets built twice, from Anders.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+15 -6
+12 -2
kernel/bpf/inode.c
··· 295 295 .release = bpffs_map_release, 296 296 }; 297 297 298 + static int bpffs_obj_open(struct inode *inode, struct file *file) 299 + { 300 + return -EIO; 301 + } 302 + 303 + static const struct file_operations bpffs_obj_fops = { 304 + .open = bpffs_obj_open, 305 + }; 306 + 298 307 static int bpf_mkobj_ops(struct dentry *dentry, umode_t mode, void *raw, 299 308 const struct inode_operations *iops, 300 309 const struct file_operations *fops) ··· 323 314 324 315 static int bpf_mkprog(struct dentry *dentry, umode_t mode, void *arg) 325 316 { 326 - return bpf_mkobj_ops(dentry, mode, arg, &bpf_prog_iops, NULL); 317 + return bpf_mkobj_ops(dentry, mode, arg, &bpf_prog_iops, 318 + &bpffs_obj_fops); 327 319 } 328 320 329 321 static int bpf_mkmap(struct dentry *dentry, umode_t mode, void *arg) ··· 332 322 struct bpf_map *map = arg; 333 323 334 324 return bpf_mkobj_ops(dentry, mode, arg, &bpf_map_iops, 335 - map->btf ? &bpffs_map_fops : NULL); 325 + map->btf ? &bpffs_map_fops : &bpffs_obj_fops); 336 326 } 337 327 338 328 static struct dentry *
+2 -1
net/xdp/xdp_umem.c
··· 204 204 long npgs; 205 205 int err; 206 206 207 - umem->pgs = kcalloc(umem->npgs, sizeof(*umem->pgs), GFP_KERNEL); 207 + umem->pgs = kcalloc(umem->npgs, sizeof(*umem->pgs), 208 + GFP_KERNEL | __GFP_NOWARN); 208 209 if (!umem->pgs) 209 210 return -ENOMEM; 210 211
+1 -3
tools/testing/selftests/bpf/Makefile
··· 16 16 TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read 17 17 all: $(TEST_CUSTOM_PROGS) 18 18 19 - $(TEST_CUSTOM_PROGS): urandom_read 20 - 21 - urandom_read: urandom_read.c 19 + $(TEST_CUSTOM_PROGS): $(OUTPUT)/%: %.c 22 20 $(CC) -o $(TEST_CUSTOM_PROGS) -static $< -Wl,--build-id 23 21 24 22 # Order correspond to 'make run_tests' order