-
Notifications
You must be signed in to change notification settings - Fork 232
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
1.2.0-dev executes setup.sh, and the following error occurs when compiling bpf. #679
Comments
#672 Has this bug not been fixed yet? %.bpf: %.c
PHONY: cscope clean I modified the bpf makefile, but I still get the same error when recompiling. |
I'm in the middle of upgrading Gatekeeper v1.2 to DPDK v23.11. Once I finish this upgrade, the workaround you tried will work. |
/path/dpdk/include/rte_byteorder.h
|
I have a problem now. The output packets sent through gatekeeper cannot pass. I have not added any interception policy and all are allowed. Is it because you changed the KIN code? I can capture the data and see that the input data packet can arrive. output return packets are dropped. Use granted.bpf The input data packet passes through the gatekeeper, and the output data packet does not go through the gatekeeper and can reach the Internet. The bpf policy also filters normally. Version 1.2dev is required to solve the output packet problem. |
Hi @ShawnLeung87,
|
I've checked everything you mentioned. There is no bpf index problem. |
The failed test scenario is that both input and output packets pass through the gatekeeper. Error log that appears
Successful test scenario(the server's input data packets pass through the gatekeeper, and the output data packets do not pass through the gatekeeper, and the server can access the Internet normally) without this error log. Preliminary suspicion is that the ACL policy of the back network card may have rejected the data packet. |
I need to finish my ongoing DPDK port before looking at this issue. I'll report back later. |
If I inferred it correctly, you mean that the packets going from the protected server to the Gatekeeper server is not being forwarded from the back network to the front network. Have you checked if there's a prefix to forward the packet in the routing table of the GK blocks? |
Weren't there log lines that showed the dropped packet in hexadecimal? That information would've allowed us to see which packet was dropped. |
Branch |
1、In the dpdk23.11 version of gatekeeper, there are still protected servers that cannot access the Internet through the gatekeeper's back network card. The log of blocked data packets is as follows: BPF data for flow: GK/7 2024-03-26 14:57:57 ERR Flow (src: 20.20.20.20, dst: 30.30.30.30) at index 0: [state: GK_REQUEST (0), flow_hash_value: 0xc68c807, expire_at: 0x2f4ed04f11f0, last_packet_seen_at: 0x2f497e859842, last_priority: 39, allowance: 7, grantor_ip: 10.0.2.11] 2、This version cannot set flow_ht_size to 250000000.The dpdk 21.05 version of gatekeeper does not have this problem. It should be that the memory allocation of dpdk has not been modified.The error is reported as follows: 3、forwarding route prefix, |
This problem (there are still protected servers that cannot access the Internet through the gatekeeper's back network card.) has been solved by adding fib default route. |
This version cannot set flow_ht_size to 250000000.The dpdk 21.05 version of gatekeeper does not have this problem. It should be that the memory allocation of dpdk has not been modified.The error is reported as follows: |
I recommend setting |
After modifying these constants, you can set flow_ht_size to 200 million. Before modification, even if flow_ht_size is set to 200 million, the memory will not be successfully initialized.
|
Can this version integrate the BPF parameter extension patch #643? Currently, this patch has been added to the gatekeeper 1.2dev version of my test environment. |
Extending the cookie of the BPFs is outside our short-term roadmap. I recommend you make a case for why the BPF cookie should be extended. I'm not aware of which kinds of attacks are blocked or which features are enabled by extended BPF cookies. If you can come up with a convincing case to increase the memory requirement, other deployers will want the feature, and proper implementation will eventually happen. The patch in issue #643 was meant to allow you to experiment with an extended cookie. |
Now we have written our own BPF for tcp reflection defense, which has better defense effect. If the default number of bpf cookies parameters is used, such BPF cannot be compiled. According to the default cookie parameters, the bpf written can only do simple restriction of data packets. It is impossible to make a targeted judgment on the number of tcp flags. After verification in our production environment, special DDoS attack types do require too many bpf cookie parameters to execute defense business logic functions. The default number of parameters is no longer suitable for many types of DDOS attacks. We have increased the number of bpf. Compared with your default parameter bpf, the defense success rate is as follows: |
Please create an issue specifically to discuss the extension of the cookie of the BPFs. In addition to copying the text you already have above, add a fully functional BPF showing off your solution. Add comments to the code where appropriate. If we move forward with the cookie extension, we'll need to have a BPF in the folder I've pushed a commit to branch |
In file included from granted.c:29:
In file included from /usr/local/include/rte_mbuf_core.h:22:
/usr/local/include/rte_byteorder.h:30:16: error: invalid output constraint '=Q' in asm
: [x1] "=Q" (x)
^
1 error generated.
make: *** [Makefile:17: granted.bpf] Error 1
clang -O2 -g -target bpf -I../include -Wall -Wextra -Wno-int-to-void-pointer-cast -o granted.bpf -c granted.c
In file included from granted.c:29:
In file included from /usr/local/include/rte_mbuf_core.h:22:
/usr/local/include/rte_byteorder.h:30:16: error: invalid output constraint '=Q' in asm
: [x1] "=Q" (x)
^
1 error generated.
ubuntu 20.04
Kernel uses 5.13.16-051316-generic
The text was updated successfully, but these errors were encountered: