lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon, 19 Jul 2021 10:51:38 +1000
From:   Stephen Rothwell <sfr@...b.auug.org.au>
To:     David Miller <davem@...emloft.net>,
        Networking <netdev@...r.kernel.org>
Cc:     Alexei Starovoitov <ast@...nel.org>,
        Cody Haas <chaas@...tgames.com>,
        Daniel Borkmann <daniel@...earbox.net>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Next Mailing List <linux-next@...r.kernel.org>,
        Lisa Watanabe <lwatanabe@...tgames.com>,
        Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
        Zvi Effron <zeffron@...tgames.com>
Subject: linux-next: manual merge of the net-next tree with the net tree

Hi all,

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

  net/bpf/test_run.c

between commit:

  5e21bb4e8125 ("bpf, test: fix NULL pointer dereference on invalid expected_attach_type")

from the net tree and commit:

  47316f4a3053 ("bpf: Support input xdp_md context in BPF_PROG_TEST_RUN")

from the net-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 net/bpf/test_run.c
index 1cc75c811e24,cda8375bbbaf..000000000000
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@@ -697,15 -756,24 +756,27 @@@ int bpf_prog_test_run_xdp(struct bpf_pr
  	struct netdev_rx_queue *rxqueue;
  	struct xdp_buff xdp = {};
  	u32 retval, duration;
+ 	struct xdp_md *ctx;
  	u32 max_data_sz;
  	void *data;
- 	int ret;
+ 	int ret = -EINVAL;
  
 +	if (prog->expected_attach_type == BPF_XDP_DEVMAP ||
 +	    prog->expected_attach_type == BPF_XDP_CPUMAP)
 +		return -EINVAL;
- 	if (kattr->test.ctx_in || kattr->test.ctx_out)
- 		return -EINVAL;
+ 	ctx = bpf_ctx_init(kattr, sizeof(struct xdp_md));
+ 	if (IS_ERR(ctx))
+ 		return PTR_ERR(ctx);
+ 
+ 	if (ctx) {
+ 		/* There can't be user provided data before the meta data */
+ 		if (ctx->data_meta || ctx->data_end != size ||
+ 		    ctx->data > ctx->data_end ||
+ 		    unlikely(xdp_metalen_invalid(ctx->data)))
+ 			goto free_ctx;
+ 		/* Meta data is allocated from the headroom */
+ 		headroom -= ctx->data;
+ 	}
  
  	/* XDP have extra tailroom as (most) drivers use full page */
  	max_data_sz = 4096 - headroom - tailroom;

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ