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, 14 Nov 2022 09:50:00 +1100
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>,
        Andrii Nakryiko <andrii@...nel.org>,
        Kumar Kartikeya Dwivedi <memxor@...il.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Next Mailing List <linux-next@...r.kernel.org>,
        Xu Kuohai <xukuohai@...wei.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:

  include/linux/bpf.h

between commit:

  1f6e04a1c7b8 ("bpf: Fix offset calculation error in __copy_map_value and zero_map_value")

from the net tree and commits:

  aa3496accc41 ("bpf: Refactor kptr_off_tab into btf_record")
  f71b2f64177a ("bpf: Refactor map->off_arr handling")

from the net-next tree.

I fixed it up (I think - 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 c1bd1bd10506,798aec816970..000000000000
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@@ -311,13 -356,14 +356,14 @@@ static inline void bpf_obj_memcpy(struc
  		return;
  	}
  
- 	for (i = 0; i < map->off_arr->cnt; i++) {
- 		u32 next_off = map->off_arr->field_off[i];
+ 	for (i = 0; i < foffs->cnt; i++) {
+ 		u32 next_off = foffs->field_off[i];
+ 		u32 sz = next_off - curr_off;
  
- 		memcpy(dst + curr_off, src + curr_off, next_off - curr_off);
- 		curr_off = next_off + map->off_arr->field_sz[i];
+ 		memcpy(dst + curr_off, src + curr_off, sz);
 -		curr_off += foffs->field_sz[i];
++		curr_off = next_off + foffs->field_sz[i];
  	}
- 	memcpy(dst + curr_off, src + curr_off, map->value_size - curr_off);
+ 	memcpy(dst + curr_off, src + curr_off, size - curr_off);
  }
  
  static inline void copy_map_value(struct bpf_map *map, void *dst, void *src)
@@@ -340,13 -386,19 +386,19 @@@ static inline void bpf_obj_memzero(stru
  		return;
  	}
  
- 	for (i = 0; i < map->off_arr->cnt; i++) {
- 		u32 next_off = map->off_arr->field_off[i];
+ 	for (i = 0; i < foffs->cnt; i++) {
+ 		u32 next_off = foffs->field_off[i];
+ 		u32 sz = next_off - curr_off;
  
- 		memset(dst + curr_off, 0, next_off - curr_off);
- 		curr_off = next_off + map->off_arr->field_sz[i];
+ 		memset(dst + curr_off, 0, sz);
 -		curr_off += foffs->field_sz[i];
++		curr_off = next_off + foffs->field_sz[i];
  	}
- 	memset(dst + curr_off, 0, map->value_size - curr_off);
+ 	memset(dst + curr_off, 0, size - curr_off);
+ }
+ 
+ static inline void zero_map_value(struct bpf_map *map, void *dst)
+ {
+ 	bpf_obj_memzero(map->field_offs, dst, map->value_size);
  }
  
  void copy_map_value_locked(struct bpf_map *map, void *dst, void *src,

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists