linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the bpf-next tree with Linus' tree
@ 2019-11-19  0:43 Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2019-11-19  0:43 UTC (permalink / raw)
  To: Daniel Borkmann, Alexei Starovoitov, Networking
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Björn Töpel, Andrii Nakryiko

[-- Attachment #1: Type: text/plain, Size: 3035 bytes --]

Hi all,

Today's linux-next merge of the bpf-next tree got conflicts in:

  include/linux/bpf.h
  kernel/bpf/syscall.c

between commit:

  ff1c08e1f74b ("bpf: Change size to u64 for bpf_map_{area_alloc, charge_init}()")

from Linus' tree and commit:

  fc9702273e2e ("bpf: Add mmap() support for BPF_MAP_TYPE_ARRAY")

from the bpf-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc include/linux/bpf.h
index 464f3f7e0b7a,e913dd5946ae..000000000000
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@@ -688,7 -798,8 +798,8 @@@ int bpf_map_charge_init(struct bpf_map_
  void bpf_map_charge_finish(struct bpf_map_memory *mem);
  void bpf_map_charge_move(struct bpf_map_memory *dst,
  			 struct bpf_map_memory *src);
 -void *bpf_map_area_alloc(size_t size, int numa_node);
 -void *bpf_map_area_mmapable_alloc(size_t size, int numa_node);
 +void *bpf_map_area_alloc(u64 size, int numa_node);
++void *bpf_map_area_mmapable_alloc(u64 size, int numa_node);
  void bpf_map_area_free(void *base);
  void bpf_map_init_from_attr(struct bpf_map *map, union bpf_attr *attr);
  
diff --cc kernel/bpf/syscall.c
index d447b5e343bf,bac3becf9f90..000000000000
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@@ -127,7 -127,7 +127,7 @@@ static struct bpf_map *find_and_alloc_m
  	return map;
  }
  
- void *bpf_map_area_alloc(u64 size, int numa_node)
 -static void *__bpf_map_area_alloc(size_t size, int numa_node, bool mmapable)
++static void *__bpf_map_area_alloc(u64 size, int numa_node, bool mmapable)
  {
  	/* We really just want to fail instead of triggering OOM killer
  	 * under memory pressure, therefore we set __GFP_NORETRY to kmalloc,
@@@ -142,10 -142,8 +142,11 @@@
  	const gfp_t flags = __GFP_NOWARN | __GFP_ZERO;
  	void *area;
  
 +	if (size >= SIZE_MAX)
 +		return NULL;
 +
- 	if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) {
+ 	/* kmalloc()'ed memory can't be mmap()'ed */
+ 	if (!mmapable && size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) {
  		area = kmalloc_node(size, GFP_USER | __GFP_NORETRY | flags,
  				    numa_node);
  		if (area != NULL)
@@@ -157,6 -159,16 +162,16 @@@
  					   flags, __builtin_return_address(0));
  }
  
 -void *bpf_map_area_alloc(size_t size, int numa_node)
++void *bpf_map_area_alloc(u64 size, int numa_node)
+ {
+ 	return __bpf_map_area_alloc(size, numa_node, false);
+ }
+ 
 -void *bpf_map_area_mmapable_alloc(size_t size, int numa_node)
++void *bpf_map_area_mmapable_alloc(u64 size, int numa_node)
+ {
+ 	return __bpf_map_area_alloc(size, numa_node, true);
+ }
+ 
  void bpf_map_area_free(void *area)
  {
  	kvfree(area);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: linux-next: manual merge of the bpf-next tree with Linus' tree
  2023-01-23 22:44 Stephen Rothwell
@ 2023-01-23 22:58 ` Stanislav Fomichev
  0 siblings, 0 replies; 12+ messages in thread
From: Stanislav Fomichev @ 2023-01-23 22:58 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Daniel Borkmann, Alexei Starovoitov, Andrii Nakryiko, bpf,
	Networking, Linux Kernel Mailing List, Linux Next Mailing List,
	Martin KaFai Lau, Paul Moore

On Mon, Jan 23, 2023 at 2:44 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> Today's linux-next merge of the bpf-next tree got a conflict in:
>
>   kernel/bpf/offload.c
>
> between commit:
>
>   ef01f4e25c17 ("bpf: restore the ebpf program ID for BPF_AUDIT_UNLOAD and PERF_BPF_EVENT_PROG_UNLOAD")
>
> from Linus' tree and commit:
>
>   89bbc53a4dbb ("bpf: Reshuffle some parts of bpf/offload.c")
>
> from the bpf-next tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

Yeah, that looks like a correct resolution, thank you!
Not sure what would've been the correct way to handle it in bpf-next
(except waiting for bpf tree to be merged)?

> --
> Cheers,
> Stephen Rothwell
>
> diff --cc kernel/bpf/offload.c
> index 190d9f9dc987,e87cab2ed710..000000000000
> --- a/kernel/bpf/offload.c
> +++ b/kernel/bpf/offload.c
> @@@ -75,20 -74,124 +74,121 @@@ bpf_offload_find_netdev(struct net_devi
>         return rhashtable_lookup_fast(&offdevs, &netdev, offdevs_params);
>   }
>
> - int bpf_prog_offload_init(struct bpf_prog *prog, union bpf_attr *attr)
> + static int __bpf_offload_dev_netdev_register(struct bpf_offload_dev *offdev,
> +                                            struct net_device *netdev)
>   {
>         struct bpf_offload_netdev *ondev;
> -       struct bpf_prog_offload *offload;
>         int err;
>
> -       if (attr->prog_type != BPF_PROG_TYPE_SCHED_CLS &&
> -           attr->prog_type != BPF_PROG_TYPE_XDP)
> -               return -EINVAL;
> +       ondev = kzalloc(sizeof(*ondev), GFP_KERNEL);
> +       if (!ondev)
> +               return -ENOMEM;
>
> -       if (attr->prog_flags)
> -               return -EINVAL;
> +       ondev->netdev = netdev;
> +       ondev->offdev = offdev;
> +       INIT_LIST_HEAD(&ondev->progs);
> +       INIT_LIST_HEAD(&ondev->maps);
> +
> +       err = rhashtable_insert_fast(&offdevs, &ondev->l, offdevs_params);
> +       if (err) {
> +               netdev_warn(netdev, "failed to register for BPF offload\n");
> +               goto err_free;
> +       }
> +
> +       if (offdev)
> +               list_add(&ondev->offdev_netdevs, &offdev->netdevs);
> +       return 0;
> +
> + err_free:
> +       kfree(ondev);
> +       return err;
> + }
> +
> + static void __bpf_prog_offload_destroy(struct bpf_prog *prog)
> + {
> +       struct bpf_prog_offload *offload = prog->aux->offload;
> +
> +       if (offload->dev_state)
> +               offload->offdev->ops->destroy(prog);
> +
>  -      /* Make sure BPF_PROG_GET_NEXT_ID can't find this dead program */
>  -      bpf_prog_free_id(prog, true);
>  -
> +       list_del_init(&offload->offloads);
> +       kfree(offload);
> +       prog->aux->offload = NULL;
> + }
> +
> + static int bpf_map_offload_ndo(struct bpf_offloaded_map *offmap,
> +                              enum bpf_netdev_command cmd)
> + {
> +       struct netdev_bpf data = {};
> +       struct net_device *netdev;
> +
> +       ASSERT_RTNL();
> +
> +       data.command = cmd;
> +       data.offmap = offmap;
> +       /* Caller must make sure netdev is valid */
> +       netdev = offmap->netdev;
> +
> +       return netdev->netdev_ops->ndo_bpf(netdev, &data);
> + }
> +
> + static void __bpf_map_offload_destroy(struct bpf_offloaded_map *offmap)
> + {
> +       WARN_ON(bpf_map_offload_ndo(offmap, BPF_OFFLOAD_MAP_FREE));
> +       /* Make sure BPF_MAP_GET_NEXT_ID can't find this dead map */
> +       bpf_map_free_id(&offmap->map, true);
> +       list_del_init(&offmap->offloads);
> +       offmap->netdev = NULL;
> + }
> +
> + static void __bpf_offload_dev_netdev_unregister(struct bpf_offload_dev *offdev,
> +                                               struct net_device *netdev)
> + {
> +       struct bpf_offload_netdev *ondev, *altdev = NULL;
> +       struct bpf_offloaded_map *offmap, *mtmp;
> +       struct bpf_prog_offload *offload, *ptmp;
> +
> +       ASSERT_RTNL();
> +
> +       ondev = rhashtable_lookup_fast(&offdevs, &netdev, offdevs_params);
> +       if (WARN_ON(!ondev))
> +               return;
> +
> +       WARN_ON(rhashtable_remove_fast(&offdevs, &ondev->l, offdevs_params));
> +
> +       /* Try to move the objects to another netdev of the device */
> +       if (offdev) {
> +               list_del(&ondev->offdev_netdevs);
> +               altdev = list_first_entry_or_null(&offdev->netdevs,
> +                                                 struct bpf_offload_netdev,
> +                                                 offdev_netdevs);
> +       }
> +
> +       if (altdev) {
> +               list_for_each_entry(offload, &ondev->progs, offloads)
> +                       offload->netdev = altdev->netdev;
> +               list_splice_init(&ondev->progs, &altdev->progs);
> +
> +               list_for_each_entry(offmap, &ondev->maps, offloads)
> +                       offmap->netdev = altdev->netdev;
> +               list_splice_init(&ondev->maps, &altdev->maps);
> +       } else {
> +               list_for_each_entry_safe(offload, ptmp, &ondev->progs, offloads)
> +                       __bpf_prog_offload_destroy(offload->prog);
> +               list_for_each_entry_safe(offmap, mtmp, &ondev->maps, offloads)
> +                       __bpf_map_offload_destroy(offmap);
> +       }
> +
> +       WARN_ON(!list_empty(&ondev->progs));
> +       WARN_ON(!list_empty(&ondev->maps));
> +       kfree(ondev);
> + }
> +
> + static int __bpf_prog_dev_bound_init(struct bpf_prog *prog, struct net_device *netdev)
> + {
> +       struct bpf_offload_netdev *ondev;
> +       struct bpf_prog_offload *offload;
> +       int err;
>
>         offload = kzalloc(sizeof(*offload), GFP_USER);
>         if (!offload)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the bpf-next tree with Linus' tree
@ 2023-01-23 22:44 Stephen Rothwell
  2023-01-23 22:58 ` Stanislav Fomichev
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Rothwell @ 2023-01-23 22:44 UTC (permalink / raw)
  To: Daniel Borkmann, Alexei Starovoitov, Andrii Nakryiko
  Cc: bpf, Networking, Linux Kernel Mailing List,
	Linux Next Mailing List, Martin KaFai Lau, Paul Moore,
	Stanislav Fomichev

[-- Attachment #1: Type: text/plain, Size: 4880 bytes --]

Hi all,

Today's linux-next merge of the bpf-next tree got a conflict in:

  kernel/bpf/offload.c

between commit:

  ef01f4e25c17 ("bpf: restore the ebpf program ID for BPF_AUDIT_UNLOAD and PERF_BPF_EVENT_PROG_UNLOAD")

from Linus' tree and commit:

  89bbc53a4dbb ("bpf: Reshuffle some parts of bpf/offload.c")

from the bpf-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc kernel/bpf/offload.c
index 190d9f9dc987,e87cab2ed710..000000000000
--- a/kernel/bpf/offload.c
+++ b/kernel/bpf/offload.c
@@@ -75,20 -74,124 +74,121 @@@ bpf_offload_find_netdev(struct net_devi
  	return rhashtable_lookup_fast(&offdevs, &netdev, offdevs_params);
  }
  
- int bpf_prog_offload_init(struct bpf_prog *prog, union bpf_attr *attr)
+ static int __bpf_offload_dev_netdev_register(struct bpf_offload_dev *offdev,
+ 					     struct net_device *netdev)
  {
  	struct bpf_offload_netdev *ondev;
- 	struct bpf_prog_offload *offload;
  	int err;
  
- 	if (attr->prog_type != BPF_PROG_TYPE_SCHED_CLS &&
- 	    attr->prog_type != BPF_PROG_TYPE_XDP)
- 		return -EINVAL;
+ 	ondev = kzalloc(sizeof(*ondev), GFP_KERNEL);
+ 	if (!ondev)
+ 		return -ENOMEM;
  
- 	if (attr->prog_flags)
- 		return -EINVAL;
+ 	ondev->netdev = netdev;
+ 	ondev->offdev = offdev;
+ 	INIT_LIST_HEAD(&ondev->progs);
+ 	INIT_LIST_HEAD(&ondev->maps);
+ 
+ 	err = rhashtable_insert_fast(&offdevs, &ondev->l, offdevs_params);
+ 	if (err) {
+ 		netdev_warn(netdev, "failed to register for BPF offload\n");
+ 		goto err_free;
+ 	}
+ 
+ 	if (offdev)
+ 		list_add(&ondev->offdev_netdevs, &offdev->netdevs);
+ 	return 0;
+ 
+ err_free:
+ 	kfree(ondev);
+ 	return err;
+ }
+ 
+ static void __bpf_prog_offload_destroy(struct bpf_prog *prog)
+ {
+ 	struct bpf_prog_offload *offload = prog->aux->offload;
+ 
+ 	if (offload->dev_state)
+ 		offload->offdev->ops->destroy(prog);
+ 
 -	/* Make sure BPF_PROG_GET_NEXT_ID can't find this dead program */
 -	bpf_prog_free_id(prog, true);
 -
+ 	list_del_init(&offload->offloads);
+ 	kfree(offload);
+ 	prog->aux->offload = NULL;
+ }
+ 
+ static int bpf_map_offload_ndo(struct bpf_offloaded_map *offmap,
+ 			       enum bpf_netdev_command cmd)
+ {
+ 	struct netdev_bpf data = {};
+ 	struct net_device *netdev;
+ 
+ 	ASSERT_RTNL();
+ 
+ 	data.command = cmd;
+ 	data.offmap = offmap;
+ 	/* Caller must make sure netdev is valid */
+ 	netdev = offmap->netdev;
+ 
+ 	return netdev->netdev_ops->ndo_bpf(netdev, &data);
+ }
+ 
+ static void __bpf_map_offload_destroy(struct bpf_offloaded_map *offmap)
+ {
+ 	WARN_ON(bpf_map_offload_ndo(offmap, BPF_OFFLOAD_MAP_FREE));
+ 	/* Make sure BPF_MAP_GET_NEXT_ID can't find this dead map */
+ 	bpf_map_free_id(&offmap->map, true);
+ 	list_del_init(&offmap->offloads);
+ 	offmap->netdev = NULL;
+ }
+ 
+ static void __bpf_offload_dev_netdev_unregister(struct bpf_offload_dev *offdev,
+ 						struct net_device *netdev)
+ {
+ 	struct bpf_offload_netdev *ondev, *altdev = NULL;
+ 	struct bpf_offloaded_map *offmap, *mtmp;
+ 	struct bpf_prog_offload *offload, *ptmp;
+ 
+ 	ASSERT_RTNL();
+ 
+ 	ondev = rhashtable_lookup_fast(&offdevs, &netdev, offdevs_params);
+ 	if (WARN_ON(!ondev))
+ 		return;
+ 
+ 	WARN_ON(rhashtable_remove_fast(&offdevs, &ondev->l, offdevs_params));
+ 
+ 	/* Try to move the objects to another netdev of the device */
+ 	if (offdev) {
+ 		list_del(&ondev->offdev_netdevs);
+ 		altdev = list_first_entry_or_null(&offdev->netdevs,
+ 						  struct bpf_offload_netdev,
+ 						  offdev_netdevs);
+ 	}
+ 
+ 	if (altdev) {
+ 		list_for_each_entry(offload, &ondev->progs, offloads)
+ 			offload->netdev = altdev->netdev;
+ 		list_splice_init(&ondev->progs, &altdev->progs);
+ 
+ 		list_for_each_entry(offmap, &ondev->maps, offloads)
+ 			offmap->netdev = altdev->netdev;
+ 		list_splice_init(&ondev->maps, &altdev->maps);
+ 	} else {
+ 		list_for_each_entry_safe(offload, ptmp, &ondev->progs, offloads)
+ 			__bpf_prog_offload_destroy(offload->prog);
+ 		list_for_each_entry_safe(offmap, mtmp, &ondev->maps, offloads)
+ 			__bpf_map_offload_destroy(offmap);
+ 	}
+ 
+ 	WARN_ON(!list_empty(&ondev->progs));
+ 	WARN_ON(!list_empty(&ondev->maps));
+ 	kfree(ondev);
+ }
+ 
+ static int __bpf_prog_dev_bound_init(struct bpf_prog *prog, struct net_device *netdev)
+ {
+ 	struct bpf_offload_netdev *ondev;
+ 	struct bpf_prog_offload *offload;
+ 	int err;
  
  	offload = kzalloc(sizeof(*offload), GFP_USER);
  	if (!offload)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 484 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the bpf-next tree with Linus' tree
@ 2022-01-24 21:56 Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2022-01-24 21:56 UTC (permalink / raw)
  To: Daniel Borkmann, Alexei Starovoitov, Andrii Nakryiko, bpf, Networking
  Cc: Linux Kernel Mailing List, Linux Next Mailing List,
	Toke Høiland-Jørgensen

[-- Attachment #1: Type: text/plain, Size: 4688 bytes --]

Hi all,

Today's linux-next merge of the bpf-next tree got a conflict in:

  tools/testing/selftests/bpf/prog_tests/xdp_link.c

between commit:

  4b27480dcaa7 ("bpf/selftests: convert xdp_link test to ASSERT_* macros")

from Linus' tree and commit:

  544356524dd6 ("selftests/bpf: switch to new libbpf XDP APIs")

from the bpf-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc tools/testing/selftests/bpf/prog_tests/xdp_link.c
index b2b357f8c74c,0c5e4ea8eaae..000000000000
--- a/tools/testing/selftests/bpf/prog_tests/xdp_link.c
+++ b/tools/testing/selftests/bpf/prog_tests/xdp_link.c
@@@ -8,9 -8,9 +8,9 @@@
  
  void serial_test_xdp_link(void)
  {
- 	DECLARE_LIBBPF_OPTS(bpf_xdp_set_link_opts, opts, .old_fd = -1);
 -	__u32 duration = 0, id1, id2, id0 = 0, prog_fd1, prog_fd2, err;
  	struct test_xdp_link *skel1 = NULL, *skel2 = NULL;
 +	__u32 id1, id2, id0 = 0, prog_fd1, prog_fd2;
+ 	LIBBPF_OPTS(bpf_xdp_attach_opts, opts);
  	struct bpf_link_info link_info;
  	struct bpf_prog_info prog_info;
  	struct bpf_link *link;
@@@ -41,14 -40,14 +41,14 @@@
  	id2 = prog_info.id;
  
  	/* set initial prog attachment */
- 	err = bpf_set_link_xdp_fd_opts(IFINDEX_LO, prog_fd1, XDP_FLAGS_REPLACE, &opts);
+ 	err = bpf_xdp_attach(IFINDEX_LO, prog_fd1, XDP_FLAGS_REPLACE, &opts);
 -	if (CHECK(err, "fd_attach", "initial prog attach failed: %d\n", err))
 +	if (!ASSERT_OK(err, "fd_attach"))
  		goto cleanup;
  
  	/* validate prog ID */
- 	err = bpf_get_link_xdp_id(IFINDEX_LO, &id0, 0);
+ 	err = bpf_xdp_query_id(IFINDEX_LO, 0, &id0);
 -	CHECK(err || id0 != id1, "id1_check",
 -	      "loaded prog id %u != id1 %u, err %d", id0, id1, err);
 +	if (!ASSERT_OK(err, "id1_check_err") || !ASSERT_EQ(id0, id1, "id1_check_val"))
 +		goto cleanup;
  
  	/* BPF link is not allowed to replace prog attachment */
  	link = bpf_program__attach_xdp(skel1->progs.xdp_handler, IFINDEX_LO);
@@@ -61,9 -60,9 +61,9 @@@
  	}
  
  	/* detach BPF program */
- 	opts.old_fd = prog_fd1;
- 	err = bpf_set_link_xdp_fd_opts(IFINDEX_LO, -1, XDP_FLAGS_REPLACE, &opts);
+ 	opts.old_prog_fd = prog_fd1;
+ 	err = bpf_xdp_detach(IFINDEX_LO, XDP_FLAGS_REPLACE, &opts);
 -	if (CHECK(err, "prog_detach", "failed %d\n", err))
 +	if (!ASSERT_OK(err, "prog_detach"))
  		goto cleanup;
  
  	/* now BPF link should attach successfully */
@@@ -73,24 -72,25 +73,24 @@@
  	skel1->links.xdp_handler = link;
  
  	/* validate prog ID */
- 	err = bpf_get_link_xdp_id(IFINDEX_LO, &id0, 0);
+ 	err = bpf_xdp_query_id(IFINDEX_LO, 0, &id0);
 -	if (CHECK(err || id0 != id1, "id1_check",
 -		  "loaded prog id %u != id1 %u, err %d", id0, id1, err))
 +	if (!ASSERT_OK(err, "id1_check_err") || !ASSERT_EQ(id0, id1, "id1_check_val"))
  		goto cleanup;
  
  	/* BPF prog attach is not allowed to replace BPF link */
- 	opts.old_fd = prog_fd1;
- 	err = bpf_set_link_xdp_fd_opts(IFINDEX_LO, prog_fd2, XDP_FLAGS_REPLACE, &opts);
+ 	opts.old_prog_fd = prog_fd1;
+ 	err = bpf_xdp_attach(IFINDEX_LO, prog_fd2, XDP_FLAGS_REPLACE, &opts);
 -	if (CHECK(!err, "prog_attach_fail", "unexpected success\n"))
 +	if (!ASSERT_ERR(err, "prog_attach_fail"))
  		goto cleanup;
  
  	/* Can't force-update when BPF link is active */
- 	err = bpf_set_link_xdp_fd(IFINDEX_LO, prog_fd2, 0);
+ 	err = bpf_xdp_attach(IFINDEX_LO, prog_fd2, 0, NULL);
 -	if (CHECK(!err, "prog_update_fail", "unexpected success\n"))
 +	if (!ASSERT_ERR(err, "prog_update_fail"))
  		goto cleanup;
  
  	/* Can't force-detach when BPF link is active */
- 	err = bpf_set_link_xdp_fd(IFINDEX_LO, -1, 0);
+ 	err = bpf_xdp_detach(IFINDEX_LO, 0, NULL);
 -	if (CHECK(!err, "prog_detach_fail", "unexpected success\n"))
 +	if (!ASSERT_ERR(err, "prog_detach_fail"))
  		goto cleanup;
  
  	/* BPF link is not allowed to replace another BPF link */
@@@ -109,8 -109,9 +109,8 @@@
  		goto cleanup;
  	skel2->links.xdp_handler = link;
  
- 	err = bpf_get_link_xdp_id(IFINDEX_LO, &id0, 0);
+ 	err = bpf_xdp_query_id(IFINDEX_LO, 0, &id0);
 -	if (CHECK(err || id0 != id2, "id2_check",
 -		  "loaded prog id %u != id2 %u, err %d", id0, id1, err))
 +	if (!ASSERT_OK(err, "id2_check_err") || !ASSERT_EQ(id0, id2, "id2_check_val"))
  		goto cleanup;
  
  	/* updating program under active BPF link works as expected */

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the bpf-next tree with Linus' tree
@ 2022-01-24 21:43 Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2022-01-24 21:43 UTC (permalink / raw)
  To: Daniel Borkmann, Alexei Starovoitov, Andrii Nakryiko, bpf, Networking
  Cc: Kumar Kartikeya Dwivedi, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1527 bytes --]

Hi all,

Today's linux-next merge of the bpf-next tree got a conflict in:

  include/linux/bpf_verifier.h

between commit:

  be80a1d3f9db ("bpf: Generalize check_ctx_reg for reuse with other types")

from Linus' tree and commit:

  d583691c47dc ("bpf: Introduce mem, size argument pair support for kfunc")

from the bpf-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc include/linux/bpf_verifier.h
index e9993172f892,ac4797155412..000000000000
--- a/include/linux/bpf_verifier.h
+++ b/include/linux/bpf_verifier.h
@@@ -519,8 -519,10 +519,10 @@@ bpf_prog_offload_replace_insn(struct bp
  void
  bpf_prog_offload_remove_insns(struct bpf_verifier_env *env, u32 off, u32 cnt);
  
 -int check_ctx_reg(struct bpf_verifier_env *env,
 -		  const struct bpf_reg_state *reg, int regno);
 +int check_ptr_off_reg(struct bpf_verifier_env *env,
 +		      const struct bpf_reg_state *reg, int regno);
+ int check_kfunc_mem_size_reg(struct bpf_verifier_env *env, struct bpf_reg_state *reg,
+ 			     u32 regno);
  int check_mem_reg(struct bpf_verifier_env *env, struct bpf_reg_state *reg,
  		   u32 regno, u32 mem_size);
  

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the bpf-next tree with Linus' tree
@ 2020-08-24  0:56 Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2020-08-24  0:56 UTC (permalink / raw)
  To: Daniel Borkmann, Alexei Starovoitov, Networking
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Toke Høiland-Jørgensen, Andrii Nakryiko

[-- Attachment #1: Type: text/plain, Size: 777 bytes --]

Hi all,

Today's linux-next merge of the bpf-next tree got a conflict in:

  tools/lib/bpf/libbpf.c

between commit:

  1e891e513e16 ("libbpf: Fix map index used in error message")

from Linus' tree and commit:

  88a82120282b ("libbpf: Factor out common ELF operations and improve logging")

from the bpf-next tree.

I fixed it up (the latter included the fix from the former) and can
carry the fix as necessary. This is now fixed as far as linux-next is
concerned, but any non trivial conflicts should be mentioned to your
upstream maintainer when your tree is submitted for merging.  You may
also want to consider cooperating with the maintainer of the conflicting
tree to minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the bpf-next tree with Linus' tree
@ 2020-03-31  0:40 Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2020-03-31  0:40 UTC (permalink / raw)
  To: Daniel Borkmann, Alexei Starovoitov, Networking
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, Andrii Nakryiko

[-- Attachment #1: Type: text/plain, Size: 1698 bytes --]

Hi all,

Today's linux-next merge of the bpf-next tree got a conflict in:

  kernel/bpf/cgroup.c

between commit:

  62039c30c19d ("bpf: Initialize storage pointers to NULL to prevent freeing garbage pointer")

from Linus' tree and commits:

  00c4eddf7ee5 ("bpf: Factor out cgroup storages operations")
  72ae26452e77 ("bpf: Implement bpf_link-based cgroup BPF program attachment")

from the bpf-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc kernel/bpf/cgroup.c
index 4f1472409ef8,80676fc00d81..000000000000
--- a/kernel/bpf/cgroup.c
+++ b/kernel/bpf/cgroup.c
@@@ -305,10 -418,9 +421,9 @@@ int __cgroup_bpf_attach(struct cgroup *
  	u32 saved_flags = (flags & (BPF_F_ALLOW_OVERRIDE | BPF_F_ALLOW_MULTI));
  	struct list_head *progs = &cgrp->bpf.progs[type];
  	struct bpf_prog *old_prog = NULL;
 -	struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE],
 -		*old_storage[MAX_BPF_CGROUP_STORAGE_TYPE] = {NULL};
 +	struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE] = {};
 +	struct bpf_cgroup_storage *old_storage[MAX_BPF_CGROUP_STORAGE_TYPE] = {};
- 	struct bpf_prog_list *pl, *replace_pl = NULL;
- 	enum bpf_cgroup_storage_type stype;
+ 	struct bpf_prog_list *pl;
  	int err;
  
  	if (((flags & BPF_F_ALLOW_OVERRIDE) && (flags & BPF_F_ALLOW_MULTI)) ||

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the bpf-next tree with Linus' tree
@ 2019-12-15 23:26 Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2019-12-15 23:26 UTC (permalink / raw)
  To: Daniel Borkmann, Alexei Starovoitov, Networking
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Pankaj Bharadiya, Kees Cook, Stanislav Fomichev

[-- Attachment #1: Type: text/plain, Size: 820 bytes --]

Hi all,

Today's linux-next merge of the bpf-next tree got a conflict in:

  net/bpf/test_run.c

between commit:

  c593642c8be0 ("treewide: Use sizeof_field() macro")

from Linus' tree and commits:

  b590cb5f802d ("bpf: Switch to offsetofend in BPF_PROG_TEST_RUN")
  850a88cc4096 ("bpf: Expose __sk_buff wire_len/gso_segs to BPF_PROG_TEST_RUN")

from the bpf-next tree.

I fixed it up (I just used the latter version) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the bpf-next tree with Linus' tree
@ 2019-08-08  2:53 Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2019-08-08  2:53 UTC (permalink / raw)
  To: Daniel Borkmann, Alexei Starovoitov, Networking
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, Andrii Nakryiko

[-- Attachment #1: Type: text/plain, Size: 2054 bytes --]

Hi all,

Today's linux-next merge of the bpf-next tree got a conflict in:

  tools/lib/bpf/libbpf.c

between commit:

  1d4126c4e119 ("libbpf: sanitize VAR to conservative 1-byte INT")

from Linus' tree and commit:

  b03bc6853c0e ("libbpf: convert libbpf code to use new btf helpers")

from the bpf-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc tools/lib/bpf/libbpf.c
index 2b57d7ea7836,3abf2dd1b3b5..000000000000
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@@ -1370,22 -1374,16 +1372,21 @@@ static void bpf_object__sanitize_btf(st
  
  	for (i = 1; i <= btf__get_nr_types(btf); i++) {
  		t = (struct btf_type *)btf__type_by_id(btf, i);
- 		kind = BTF_INFO_KIND(t->info);
  
- 		if (!has_datasec && kind == BTF_KIND_VAR) {
+ 		if (!has_datasec && btf_is_var(t)) {
  			/* replace VAR with INT */
  			t->info = BTF_INFO_ENC(BTF_KIND_INT, 0, 0);
 -			t->size = sizeof(int);
 -			*(int *)(t + 1) = BTF_INT_ENC(0, 0, 32);
 +			/*
 +			 * using size = 1 is the safest choice, 4 will be too
 +			 * big and cause kernel BTF validation failure if
 +			 * original variable took less than 4 bytes
 +			 */
 +			t->size = 1;
- 			*(int *)(t+1) = BTF_INT_ENC(0, 0, 8);
- 		} else if (!has_datasec && kind == BTF_KIND_DATASEC) {
++			*(int *)(t + 1) = BTF_INT_ENC(0, 0, 8);
+ 		} else if (!has_datasec && btf_is_datasec(t)) {
  			/* replace DATASEC with STRUCT */
- 			struct btf_var_secinfo *v = (void *)(t + 1);
- 			struct btf_member *m = (void *)(t + 1);
+ 			const struct btf_var_secinfo *v = btf_var_secinfos(t);
+ 			struct btf_member *m = btf_members(t);
  			struct btf_type *vt;
  			char *name;
  

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the bpf-next tree with Linus' tree
@ 2018-12-21  2:36 Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2018-12-21  2:36 UTC (permalink / raw)
  To: Daniel Borkmann, Alexei Starovoitov, Networking
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, Jakub Kicinski

[-- Attachment #1: Type: text/plain, Size: 7845 bytes --]

Hi all,

Today's linux-next merge of the bpf-next tree got a conflict in:

  tools/testing/selftests/bpf/test_verifier.c

between commits:

  7640ead93924 ("bpf: verifier: make sure callees don't prune with caller differences")
  14507e35bd9d ("selftests: bpf: verifier: add tests for JSET interpretation")

from Linus' tree and commit:

  5a8d5209ac02 ("selftests: bpf: add trivial JSET tests")

from the bpf-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc tools/testing/selftests/bpf/test_verifier.c
index c3b799c1ee97,dbd31750b214..000000000000
--- a/tools/testing/selftests/bpf/test_verifier.c
+++ b/tools/testing/selftests/bpf/test_verifier.c
@@@ -14098,34 -14169,198 +14169,225 @@@ static struct bpf_test tests[] = 
  		.errstr = "invalid bpf_context access",
  		.errstr_unpriv = "R1 leaks addr",
  		.result = REJECT,
 +	},
 +		"calls: cross frame pruning",
 +		.insns = {
 +			/* r8 = !!random();
 +			 * call pruner()
 +			 * if (r8)
 +			 *     do something bad;
 +			 */
 +			BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
 +				     BPF_FUNC_get_prandom_u32),
 +			BPF_MOV64_IMM(BPF_REG_8, 0),
 +			BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 1),
 +			BPF_MOV64_IMM(BPF_REG_8, 1),
 +			BPF_MOV64_REG(BPF_REG_1, BPF_REG_8),
 +			BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 4),
 +			BPF_JMP_IMM(BPF_JEQ, BPF_REG_8, 1, 1),
 +			BPF_LDX_MEM(BPF_B, BPF_REG_9, BPF_REG_1, 0),
 +			BPF_MOV64_IMM(BPF_REG_0, 0),
 +			BPF_EXIT_INSN(),
 +			BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, 0),
 +			BPF_EXIT_INSN(),
 +		},
 +		.prog_type = BPF_PROG_TYPE_SOCKET_FILTER,
 +		.errstr_unpriv = "function calls to other bpf functions are allowed for root only",
 +		.result_unpriv = REJECT,
 +		.errstr = "!read_ok",
 +		.result = REJECT,
  	},
+ 	{
+ 		"jset: functional",
+ 		.insns = {
+ 			/* r0 = 0 */
+ 			BPF_MOV64_IMM(BPF_REG_0, 0),
+ 			/* prep for direct packet access via r2 */
+ 			BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
+ 				    offsetof(struct __sk_buff, data)),
+ 			BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
+ 				    offsetof(struct __sk_buff, data_end)),
+ 			BPF_MOV64_REG(BPF_REG_4, BPF_REG_2),
+ 			BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, 8),
+ 			BPF_JMP_REG(BPF_JLE, BPF_REG_4, BPF_REG_3, 1),
+ 			BPF_EXIT_INSN(),
+ 
+ 			BPF_LDX_MEM(BPF_DW, BPF_REG_7, BPF_REG_2, 0),
+ 
+ 			/* reg, bit 63 or bit 0 set, taken */
+ 			BPF_LD_IMM64(BPF_REG_8, 0x8000000000000001),
+ 			BPF_JMP_REG(BPF_JSET, BPF_REG_7, BPF_REG_8, 1),
+ 			BPF_EXIT_INSN(),
+ 
+ 			/* reg, bit 62, not taken */
+ 			BPF_LD_IMM64(BPF_REG_8, 0x4000000000000000),
+ 			BPF_JMP_REG(BPF_JSET, BPF_REG_7, BPF_REG_8, 1),
+ 			BPF_JMP_IMM(BPF_JA, 0, 0, 1),
+ 			BPF_EXIT_INSN(),
+ 
+ 			/* imm, any bit set, taken */
+ 			BPF_JMP_IMM(BPF_JSET, BPF_REG_7, -1, 1),
+ 			BPF_EXIT_INSN(),
+ 
+ 			/* imm, bit 31 set, taken */
+ 			BPF_JMP_IMM(BPF_JSET, BPF_REG_7, 0x80000000, 1),
+ 			BPF_EXIT_INSN(),
+ 
+ 			/* all good - return r0 == 2 */
+ 			BPF_MOV64_IMM(BPF_REG_0, 2),
+ 			BPF_EXIT_INSN(),
+ 		},
+ 		.prog_type = BPF_PROG_TYPE_SCHED_CLS,
+ 		.result = ACCEPT,
+ 		.runs = 7,
+ 		.retvals = {
+ 			{ .retval = 2,
+ 			  .data64 = { (1ULL << 63) | (1U << 31) | (1U << 0), }
+ 			},
+ 			{ .retval = 2,
+ 			  .data64 = { (1ULL << 63) | (1U << 31), }
+ 			},
+ 			{ .retval = 2,
+ 			  .data64 = { (1ULL << 31) | (1U << 0), }
+ 			},
+ 			{ .retval = 2,
+ 			  .data64 = { (__u32)-1, }
+ 			},
+ 			{ .retval = 2,
+ 			  .data64 = { ~0x4000000000000000ULL, }
+ 			},
+ 			{ .retval = 0,
+ 			  .data64 = { 0, }
+ 			},
+ 			{ .retval = 0,
+ 			  .data64 = { ~0ULL, }
+ 			},
+ 		},
+ 	},
+ 	{
+ 		"jset: sign-extend",
+ 		.insns = {
+ 			/* r0 = 0 */
+ 			BPF_MOV64_IMM(BPF_REG_0, 0),
+ 			/* prep for direct packet access via r2 */
+ 			BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
+ 				    offsetof(struct __sk_buff, data)),
+ 			BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
+ 				    offsetof(struct __sk_buff, data_end)),
+ 			BPF_MOV64_REG(BPF_REG_4, BPF_REG_2),
+ 			BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, 8),
+ 			BPF_JMP_REG(BPF_JLE, BPF_REG_4, BPF_REG_3, 1),
+ 			BPF_EXIT_INSN(),
+ 
+ 			BPF_LDX_MEM(BPF_DW, BPF_REG_7, BPF_REG_2, 0),
+ 
+ 			BPF_JMP_IMM(BPF_JSET, BPF_REG_7, 0x80000000, 1),
+ 			BPF_EXIT_INSN(),
+ 
+ 			BPF_MOV64_IMM(BPF_REG_0, 2),
+ 			BPF_EXIT_INSN(),
+ 		},
+ 		.prog_type = BPF_PROG_TYPE_SCHED_CLS,
+ 		.result = ACCEPT,
+ 		.retval = 2,
+ 		.data = { 1, 0, 0, 0, 0, 0, 0, 1, },
+ 	},
+ 	{
+ 		"jset: known const compare",
+ 		.insns = {
+ 			BPF_MOV64_IMM(BPF_REG_0, 1),
+ 			BPF_JMP_IMM(BPF_JSET, BPF_REG_0, 1, 1),
+ 			BPF_LDX_MEM(BPF_B, BPF_REG_8, BPF_REG_9, 0),
+ 			BPF_EXIT_INSN(),
+ 		},
+ 		.prog_type = BPF_PROG_TYPE_SOCKET_FILTER,
+ 		.retval_unpriv = 1,
+ 		.result_unpriv = ACCEPT,
+ 		.retval = 1,
+ 		.result = ACCEPT,
+ 	},
+ 	{
+ 		"jset: known const compare bad",
+ 		.insns = {
+ 			BPF_MOV64_IMM(BPF_REG_0, 0),
+ 			BPF_JMP_IMM(BPF_JSET, BPF_REG_0, 1, 1),
+ 			BPF_LDX_MEM(BPF_B, BPF_REG_8, BPF_REG_9, 0),
+ 			BPF_EXIT_INSN(),
+ 		},
+ 		.prog_type = BPF_PROG_TYPE_SOCKET_FILTER,
+ 		.errstr_unpriv = "!read_ok",
+ 		.result_unpriv = REJECT,
+ 		.errstr = "!read_ok",
+ 		.result = REJECT,
+ 	},
+ 	{
+ 		"jset: unknown const compare taken",
+ 		.insns = {
+ 			BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
+ 				     BPF_FUNC_get_prandom_u32),
+ 			BPF_JMP_IMM(BPF_JSET, BPF_REG_0, 1, 1),
+ 			BPF_JMP_IMM(BPF_JA, 0, 0, 1),
+ 			BPF_LDX_MEM(BPF_B, BPF_REG_8, BPF_REG_9, 0),
+ 			BPF_EXIT_INSN(),
+ 		},
+ 		.prog_type = BPF_PROG_TYPE_SOCKET_FILTER,
+ 		.errstr_unpriv = "!read_ok",
+ 		.result_unpriv = REJECT,
+ 		.errstr = "!read_ok",
+ 		.result = REJECT,
+ 	},
+ 	{
+ 		"jset: unknown const compare not taken",
+ 		.insns = {
+ 			BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
+ 				     BPF_FUNC_get_prandom_u32),
+ 			BPF_JMP_IMM(BPF_JSET, BPF_REG_0, 1, 1),
+ 			BPF_LDX_MEM(BPF_B, BPF_REG_8, BPF_REG_9, 0),
+ 			BPF_EXIT_INSN(),
+ 		},
+ 		.prog_type = BPF_PROG_TYPE_SOCKET_FILTER,
+ 		.errstr_unpriv = "!read_ok",
+ 		.result_unpriv = REJECT,
+ 		.errstr = "!read_ok",
+ 		.result = REJECT,
+ 	},
+ 	{
+ 		"jset: half-known const compare",
+ 		.insns = {
+ 			BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
+ 				     BPF_FUNC_get_prandom_u32),
+ 			BPF_ALU64_IMM(BPF_OR, BPF_REG_0, 2),
+ 			BPF_JMP_IMM(BPF_JSET, BPF_REG_0, 3, 1),
+ 			BPF_LDX_MEM(BPF_B, BPF_REG_8, BPF_REG_9, 0),
+ 			BPF_MOV64_IMM(BPF_REG_0, 0),
+ 			BPF_EXIT_INSN(),
+ 		},
+ 		.prog_type = BPF_PROG_TYPE_SOCKET_FILTER,
+ 		.result_unpriv = ACCEPT,
+ 		.result = ACCEPT,
+ 	},
+ 	{
+ 		"jset: range",
+ 		.insns = {
+ 			BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
+ 				     BPF_FUNC_get_prandom_u32),
+ 			BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
+ 			BPF_MOV64_IMM(BPF_REG_0, 0),
+ 			BPF_ALU64_IMM(BPF_AND, BPF_REG_1, 0xff),
+ 			BPF_JMP_IMM(BPF_JSET, BPF_REG_1, 0xf0, 3),
+ 			BPF_JMP_IMM(BPF_JLT, BPF_REG_1, 0x10, 1),
+ 			BPF_LDX_MEM(BPF_B, BPF_REG_8, BPF_REG_9, 0),
+ 			BPF_EXIT_INSN(),
+ 			BPF_JMP_IMM(BPF_JSET, BPF_REG_1, 0x10, 1),
+ 			BPF_EXIT_INSN(),
+ 			BPF_JMP_IMM(BPF_JGE, BPF_REG_1, 0x10, 1),
+ 			BPF_LDX_MEM(BPF_B, BPF_REG_8, BPF_REG_9, 0),
+ 			BPF_EXIT_INSN(),
+ 		},
+ 		.prog_type = BPF_PROG_TYPE_SOCKET_FILTER,
+ 		.result_unpriv = ACCEPT,
+ 		.result = ACCEPT,
+ 	},
  };
  
  static int probe_filter_length(const struct bpf_insn *fp)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the bpf-next tree with Linus' tree
@ 2018-09-24  0:19 Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2018-09-24  0:19 UTC (permalink / raw)
  To: Daniel Borkmann, Alexei Starovoitov, Networking
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Arnaldo Carvalho de Melo, Yonghong Song

[-- Attachment #1: Type: text/plain, Size: 1162 bytes --]

Hi all,

Today's linux-next merge of the bpf-next tree got a conflict in:

  tools/lib/bpf/Build

between commit:

  6d41907c630d ("tools lib bpf: Provide wrapper for strerror_r to build in !_GNU_SOURCE systems")

from Linus' tree and commit:

  f7010770fbac ("tools/bpf: move bpf/lib netlink related functions into a new file")

from the bpf-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc tools/lib/bpf/Build
index 6eb9bacd1948,512b2c0ba0d2..000000000000
--- a/tools/lib/bpf/Build
+++ b/tools/lib/bpf/Build
@@@ -1,1 -1,1 +1,1 @@@
- libbpf-y := libbpf.o bpf.o nlattr.o btf.o libbpf_errno.o str_error.o
 -libbpf-y := libbpf.o bpf.o nlattr.o btf.o libbpf_errno.o netlink.o
++libbpf-y := libbpf.o bpf.o nlattr.o btf.o libbpf_errno.o str_error.o netlink.o

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the bpf-next tree with Linus' tree
@ 2018-01-15  0:15 Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2018-01-15  0:15 UTC (permalink / raw)
  To: Daniel Borkmann, Alexei Starovoitov, Networking
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	David Woodhouse, Thomas Gleixner, Masami Hiramatsu

Hi all,

Today's linux-next merge of the bpf-next tree got a conflict in:

  arch/x86/lib/Makefile

between commit:

  76b043848fd2 ("x86/retpoline: Add initial retpoline support")

from Linus' tree and commit:

  540adea3809f ("error-injection: Separate error-injection from kprobe")

from the bpf-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/x86/lib/Makefile
index f23934bbaf4e,171377b83be1..000000000000
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@@ -26,7 -26,7 +26,8 @@@ lib-y += memcpy_$(BITS).
  lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
  lib-$(CONFIG_INSTRUCTION_DECODER) += insn.o inat.o insn-eval.o
  lib-$(CONFIG_RANDOMIZE_BASE) += kaslr.o
 +lib-$(CONFIG_RETPOLINE) += retpoline.o
+ lib-$(CONFIG_FUNCTION_ERROR_INJECTION)	+= error-inject.o
  
  obj-y += msr.o msr-reg.o msr-reg-export.o hweight.o
  

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-01-23 22:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19  0:43 linux-next: manual merge of the bpf-next tree with Linus' tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2023-01-23 22:44 Stephen Rothwell
2023-01-23 22:58 ` Stanislav Fomichev
2022-01-24 21:56 Stephen Rothwell
2022-01-24 21:43 Stephen Rothwell
2020-08-24  0:56 Stephen Rothwell
2020-03-31  0:40 Stephen Rothwell
2019-12-15 23:26 Stephen Rothwell
2019-08-08  2:53 Stephen Rothwell
2018-12-21  2:36 Stephen Rothwell
2018-09-24  0:19 Stephen Rothwell
2018-01-15  0:15 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).