Commit Graph

28 Commits

Author SHA1 Message Date
fengbojiang c35e5fda17 Fix Compile Error with gcc 11.3.0(in Ubuntu 22.04). Close #736. 2023-02-16 15:14:27 +08:00
wenchengji 0f015b3f5d when nginx use setsockopt ON_LINGER, the seq number of the RST packet is error.
Use tcpdump to capture packets and you will find the problem.
See:https://reviews.freebsd.org/D30036.
2023-01-09 06:51:16 +00:00
fengbojiang 3c7b637d18 tcp: Missing mfree in rack and bbr.
See:https://reviews.freebsd.org/D30727.
2023-01-06 10:35:50 +08:00
fengbojiang a816e89636 Fix #702 F-stack rack and BBR both causes PCB memory leak.
Because `net.inet.tcp.hpts.skip_swi=1` takes effect after
`mi_startup()` in `ff_freebsd_init()`.
2023-01-06 04:10:02 +08:00
renzibei 7fe40f937e make it compilable under O2 optimization, pass gcc check 2022-12-01 22:02:45 +00:00
fengbojiang 21cfeb4372 Support extra tcp stacks, rack and bbr. 2021-09-23 15:16:09 +08:00
fengbojiang e7b7fb6cc9 FreeBSD: Upgrade to FreeBSD-releng-13.0 compiled, to be tested. 2021-08-31 19:00:09 +08:00
fengbojiang(姜凤波) cddb7cd030 Add `ff_regist_pcblddr_fun` to regist a pcb lddr function in F-Stack.
If There are multiple ips, and F-Stack client application can choose a source ip by yourself, instead always use the first ip.
2021-03-06 19:18:52 +08:00
fengbojiang(姜凤波) 0e148a1207 Denial of service in listen system call.
Corresponding upstream changeset from
https://www.freebsd.org/security/advisories/FreeBSD-EN-18:11.listen.asc.

Refer: #329.
2019-11-22 22:07:47 +08:00
fengbojiang(姜凤波) c476ff78a9 Resource exhaustion in IP fragment reassembly.
Corresponding upstream changeset from
https://www.freebsd.org/security/advisories/FreeBSD-SA-18:10.ip.asc.
2019-11-22 21:06:30 +08:00
fengbojiang(姜凤波) 30c2a48ca1 Resource exhaustion in TCP reassembly.
Corresponding upstream changeset from
https://www.freebsd.org/security/advisories/FreeBSD-SA-18:08.tcp.asc.
2019-11-22 16:16:34 +08:00
fengbojiang(姜凤波) eb6df281b3 The disclosure in the TCP network stack was introduced in 11.0.
Corresponding upstream changeset from
https://www.freebsd.org/security/advisories/FreeBSD-EN-18:05.mem.asc.
2019-11-22 14:39:26 +08:00
fengbojiang(姜凤波) b6e183603d The TCP stack has been changed to use the estimated RTT instead of timestamps for receive buffer auto resizing.
Corresponding upstream changeset from https://svnweb.freebsd.org/base?view=revision&revision=317368.
2019-11-22 11:40:45 +08:00
fengbojiang(姜凤波) e1bffb8a14 The network stack has been modified to fix incorrect or invalid IP
addresses if multiple threads emit a UDP log_in_vain message
concurrently.

Corresponding upstream changeset from
https://svnweb.freebsd.org/base?view=revision&revision=313523.
2019-11-21 16:57:10 +08:00
fengbojiang(姜凤波) d53a2d2032 FreeBSD: upgrad to FreeBSD-releng-11.0 for some bugs. 2019-11-20 20:41:29 +08:00
fengbojiang(姜凤波) adfdf56113 IPv6: FreeBSD stack and f-stack support ipv6. 2019-07-12 20:56:01 +08:00
jfb8856606 1743e020f9 recommit bind and connet use other ip.
Refer #322 #323 #343
2019-06-25 19:14:07 +08:00
fengbojiang(姜凤波) fe45045298 Revert "Merge branch 'master' of https://github.com/F-Stack/f-stack"
Refer #322 #323 #343

This reverts commit 2bc927fd77, reversing
changes made to 2576201343.
2019-03-14 18:07:36 +08:00
10077240 2c6bc8e771 indent correctly 2019-01-14 15:10:42 +08:00
10077240 490ee526cc support bind and connect 2019-01-05 11:51:57 +08:00
10077240 61467f3e8d Update freebsd/netinet/in_pcb.c
BSD's socket can bind the address not belong to local ports, this works well when using as transparent proxy. If fstack check the ip and port whenever new connect, tranparent proxy is not supported.
When using specified local port, it is app's responsibility to make 5-tuple rss hash good.
2018-10-10 07:48:32 +08:00
Shivansh Rai 4f4a430529 Fix tautological comparison
Corresponding upstream changeset: https://github.com/freebsd/freebsd/commit/d45a807e
2018-01-02 23:11:52 +05:30
logwang 2aa28acdb3 Fix #114: An out of bounds of memory in netinet/libalias/alias_sctp.c.
Run with valgrind, and found this:
==2228== Invalid write of size 8
==2228==    at 0x4E05DA: AliasSctpInit (alias_sctp.c:641)
==2228==    by 0x4DE565: LibAliasInit (alias_db.c:2503)
==2228==    by 0x4E9B3B: nat44_config (ip_fw_nat.c:505)
==2228==    by 0x4E9E91: nat44_cfg (ip_fw_nat.c:599)
==2228==    by 0x4F1719: ipfw_ctl3 (ip_fw_sockopt.c:3666)
==2228==    by 0x4B9954: rip_ctloutput (raw_ip.c:659)
==2228==    by 0x447E11: sosetopt (uipc_socket.c:2505)
==2228==    by 0x44BF4D: kern_setsockopt (uipc_syscalls.c:1407)
==2228==    by 0x409F08: ff_setsockopt (ff_syscall_wrapper.c:412)
==2228==    by 0x5277AA: handle_ipfw_msg (ff_dpdk_if.c:1146)
==2228==    by 0x52788C: handle_msg (ff_dpdk_if.c:1196)
==2228==    by 0x5289B8: process_msg_ring (ff_dpdk_if.c:1213)
==2228==  Address 0x60779b0 is 4,800 bytes inside a block of size 4,802
alloc'd
==2228==    at 0x4C2ABBD: malloc (vg_replace_malloc.c:296)
==2228==    by 0x509F15: ff_malloc (ff_host_interface.c:89)
==2228==    by 0x4053BE: malloc (ff_glue.c:1021)
==2228==    by 0x4E054E: AliasSctpInit (alias_sctp.c:632)
==2228==    by 0x4DE565: LibAliasInit (alias_db.c:2503)
==2228==    by 0x4E9B3B: nat44_config (ip_fw_nat.c:505)
==2228==    by 0x4E9E91: nat44_cfg (ip_fw_nat.c:599)
==2228==    by 0x4F1719: ipfw_ctl3 (ip_fw_sockopt.c:3666)
==2228==    by 0x4B9954: rip_ctloutput (raw_ip.c:659)
==2228==    by 0x447E11: sosetopt (uipc_socket.c:2505)
==2228==    by 0x44BF4D: kern_setsockopt (uipc_syscalls.c:1407)
==2228==    by 0x409F08: ff_setsockopt (ff_syscall_wrapper.c:412)
==2228==

The error line is:
`la->sctpNatTimer.TimerQ = sn_calloc(SN_TIMER_QUEUE_SIZE, sizeof(struct
sctpTimerQ));`

Since SN_TIMER_QUEUE_SIZE is defined as SN_MAX_TIMER+2, and sn_calloc is
defined as sn_malloc(x * n) if _SYS_MALLOC_H_ is defined, the size of
calloced memory will be wrong, because the macro will be expanded to
sizeof(struct sctpTimerQ)*SN_MAX_TIMER+2.

And the memory will be out of bounds here.
```
/* Initialise circular timer Q*/
for (i = 0; i < SN_TIMER_QUEUE_SIZE; i++)
    LIST_INIT(&la->sctpNatTimer.TimerQ[i]);
```
2017-12-05 15:32:10 +08:00
logwang 1cd6edf41e Fix endless loop when connect to a peer if all ports are completely used. 2017-09-11 11:01:18 +08:00
Andy 08dba0109c add lvs toa option 2017-09-04 23:19:12 -04:00
logwang a9e7dcf4da Fix ff_rss_check function bug.
1.Close #22.
2.Configure the HW indirection table when initializing port.
3.Use several LSBs of the rss hash result according to reta_size when
calculating queue index.
2017-08-28 17:12:07 +08:00
Li Wei 839295c867 freebsd: fix compiling error with gcc 6.3.1
Fix this misleading indentation according to the upstream of freebsd.

Signed-off-by: Li Wei <liwei@anbutu.com>
2017-05-25 18:57:02 +08:00
logwang a9643ea85c init 2017-04-21 18:43:26 +08:00