linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Networking <netdev@vger.kernel.org>
Cc: Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrii Nakryiko <andriin@fb.com>
Subject: linux-next: manual merge of the bpf-next tree with Linus' tree
Date: Thu, 8 Aug 2019 12:53:26 +1000	[thread overview]
Message-ID: <20190808125326.614065d6@canb.auug.org.au> (raw)

[-- 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 --]

             reply	other threads:[~2019-08-08  2:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08  2:53 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-01-23 22:44 linux-next: manual merge of the bpf-next tree with Linus' tree 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-11-19  0:43 Stephen Rothwell
2018-12-21  2:36 Stephen Rothwell
2018-09-24  0:19 Stephen Rothwell
2018-01-15  0:15 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190808125326.614065d6@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).