Skip to content

Commit 0ca69d1

Browse files
committed
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 <[email protected]>
2 parents 93ba168 + a343993 commit 0ca69d1

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

kernel/bpf/inode.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,15 @@ static const struct file_operations bpffs_map_fops = {
295295
.release = bpffs_map_release,
296296
};
297297

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+
298307
static int bpf_mkobj_ops(struct dentry *dentry, umode_t mode, void *raw,
299308
const struct inode_operations *iops,
300309
const struct file_operations *fops)
@@ -314,15 +323,16 @@ static int bpf_mkobj_ops(struct dentry *dentry, umode_t mode, void *raw,
314323

315324
static int bpf_mkprog(struct dentry *dentry, umode_t mode, void *arg)
316325
{
317-
return bpf_mkobj_ops(dentry, mode, arg, &bpf_prog_iops, NULL);
326+
return bpf_mkobj_ops(dentry, mode, arg, &bpf_prog_iops,
327+
&bpffs_obj_fops);
318328
}
319329

320330
static int bpf_mkmap(struct dentry *dentry, umode_t mode, void *arg)
321331
{
322332
struct bpf_map *map = arg;
323333

324334
return bpf_mkobj_ops(dentry, mode, arg, &bpf_map_iops,
325-
map->btf ? &bpffs_map_fops : NULL);
335+
map->btf ? &bpffs_map_fops : &bpffs_obj_fops);
326336
}
327337

328338
static struct dentry *

net/xdp/xdp_umem.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ static int xdp_umem_pin_pages(struct xdp_umem *umem)
204204
long npgs;
205205
int err;
206206

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);
208209
if (!umem->pgs)
209210
return -ENOMEM;
210211

tools/testing/selftests/bpf/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ LDLIBS += -lcap -lelf -lrt -lpthread
1616
TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read
1717
all: $(TEST_CUSTOM_PROGS)
1818

19-
$(TEST_CUSTOM_PROGS): urandom_read
20-
21-
urandom_read: urandom_read.c
19+
$(TEST_CUSTOM_PROGS): $(OUTPUT)/%: %.c
2220
$(CC) -o $(TEST_CUSTOM_PROGS) -static $< -Wl,--build-id
2321

2422
# Order correspond to 'make run_tests' order

0 commit comments

Comments
 (0)