Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sockmap fix for KASAN_VMALLOC and af_unix #604

Open
wants to merge 1 commit into
base: bpf-next_base
Choose a base branch
from

Conversation

danielocfb
Copy link
Owner

Pull request for series with
subject: sockmap fix for KASAN_VMALLOC and af_unix
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=793673

@danielocfb
Copy link
Owner Author

Upstream branch: 99c9991
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=793673
version: 1

Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/project/netdevbpf/list/?series=793673
error message:

Cmd('git') failed due to: exit code(128)
  cmdline: git am --3way
  stdout: 'Applying: bpf: sockmap, af_unix sockets need to hold ref for pair sock
Applying: bpf: sockmap, add af_unix test with both sockets in map
Using index info to reconstruct a base tree...
M	tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
Falling back to patching base and 3-way merge...
Auto-merging tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
CONFLICT (content): Merge conflict in tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
Patch failed at 0002 bpf: sockmap, add af_unix test with both sockets in map
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".'
  stderr: 'error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch'

conflict:

diff --cc tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
index a934d43,90e9790..0000000
--- a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
+++ b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
@@@ -1770,12 -1824,20 +1770,14 @@@ static void inet_unix_skb_redir_to_conn
  	xbpf_prog_detach2(verdict, sock_map, BPF_SK_SKB_VERDICT);
  }
  
- static void unix_inet_redir_to_connected(int family, int type, int sock_mapfd,
- 					int verd_mapfd, enum redir_mode mode)
+ static void unix_inet_redir_to_connected(int family, int type,
+ 					int sock_mapfd, int nop_mapfd,
+ 					int verd_mapfd,
+ 					enum redir_mode mode)
  {
 -	const char *log_prefix = redir_mode_str(mode);
  	int c0, c1, p0, p1;
 -	unsigned int pass;
 -	int err, n;
  	int sfd[2];
 -	u32 key;
 -	char b;
 -
 -	zero_verdict_count(verd_mapfd);
 +	int err;
  
  	err = inet_socketpair(family, SOCK_DGRAM, &p0, &c0);
  	if (err)
@@@ -1785,8 -1847,38 +1787,41 @@@
  		goto close_cli0;
  	c1 = sfd[0], p1 = sfd[1];
  
++<<<<<<< HEAD
 +	pairs_redir_to_connected(c0, p0, c1, p1, sock_mapfd, verd_mapfd, mode);
++=======
+ 	err = add_to_sockmap(sock_mapfd, p0, p1);
+ 	if (err)
+ 		goto close;
+ 
+ 	if (nop_mapfd >= 0) {
+ 		err = add_to_sockmap(nop_mapfd, c0, c1);
+ 		if (err)
+ 			goto close;
+ 	}
+ 
+ 	n = write(c1, "a", 1);
+ 	if (n < 0)
+ 		FAIL_ERRNO("%s: write", log_prefix);
+ 	if (n == 0)
+ 		FAIL("%s: incomplete write", log_prefix);
+ 	if (n < 1)
+ 		goto close;
+ 
+ 	key = SK_PASS;
+ 	err = xbpf_map_lookup_elem(verd_mapfd, &key, &pass);
+ 	if (err)
+ 		goto close;
+ 	if (pass != 1)
+ 		FAIL("%s: want pass count 1, have %d", log_prefix, pass);
+ 
+ 	n = recv_timeout(mode == REDIR_INGRESS ? p0 : c0, &b, 1, 0, IO_TIMEOUT_SEC);
+ 	if (n < 0)
+ 		FAIL_ERRNO("%s: recv_timeout", log_prefix);
+ 	if (n == 0)
+ 		FAIL("%s: incomplete recv", log_prefix);
++>>>>>>> bpf: sockmap, add af_unix test with both sockets in map
  
 -close:
  	xclose(c1);
  	xclose(p1);
  close_cli0:

@danielocfb danielocfb force-pushed the bpf-next_base branch 3 times, most recently from 5d0a354 to 6c38f9e Compare October 17, 2023 17:38
@danielocfb danielocfb added needs-ack and removed new labels Oct 17, 2023
@danielocfb danielocfb force-pushed the bpf-next_base branch 2 times, most recently from 3c4854d to c497ec6 Compare October 18, 2023 08:10
@danielocfb danielocfb force-pushed the bpf-next_base branch 4 times, most recently from b405fde to dd316da Compare November 2, 2023 05:49
@danielocfb danielocfb force-pushed the bpf-next_base branch 12 times, most recently from 260b428 to 08949e6 Compare November 10, 2023 04:46
@danielocfb danielocfb force-pushed the bpf-next_base branch 2 times, most recently from 3a8c9bf to 32f9f95 Compare November 10, 2023 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants