Commit graph

7160 commits

Author SHA1 Message Date
eaglegai
184248eb0e fix memory leak in unbound-streamtcp when open_svr failed
==1927474== Memcheck, a memory error detector
==1927474== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1927474== Using Valgrind-3.16.0 and LibVEX; rerun with -h for copyright info
==1927474== Command: unbound-streamtcp -f localhost
==1927474==
fatal: bad server specs 'localhost'
==1927474==
==1927474== HEAP SUMMARY:
==1927474==     in use at exit: 131,186 bytes in 4 blocks
==1927474==   total heap usage: 5 allocs, 1 frees, 132,210 bytes allocated
==1927474==
==1927474== 40 bytes in 1 blocks are still reachable in loss record 1 of 4
==1927474==    at 0x483F751: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==1927474==    by 0x1E0573: sldns_buffer_new (sbuffer.c:21)
==1927474==    by 0x11ECED: send_em (streamtcp.c:374)
==1927474==    by 0x11E6C1: main (streamtcp.c:585)
==1927474==
==1927474== 40 bytes in 1 blocks are still reachable in loss record 2 of 4
==1927474==    at 0x483F751: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==1927474==    by 0x1E0573: sldns_buffer_new (sbuffer.c:21)
==1927474==    by 0x11ECFA: send_em (streamtcp.c:375)
==1927474==    by 0x11E6C1: main (streamtcp.c:585)
==1927474==
==1927474== 65,553 bytes in 1 blocks are still reachable in loss record 3 of 4
==1927474==    at 0x483F751: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==1927474==    by 0x1E0583: sldns_buffer_new (sbuffer.c:27)
==1927474==    by 0x11ECED: send_em (streamtcp.c:374)
==1927474==    by 0x11E6C1: main (streamtcp.c:585)
==1927474==
==1927474== 65,553 bytes in 1 blocks are still reachable in loss record 4 of 4
==1927474==    at 0x483F751: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==1927474==    by 0x1E0583: sldns_buffer_new (sbuffer.c:27)
==1927474==    by 0x11ECFA: send_em (streamtcp.c:375)
==1927474==    by 0x11E6C1: main (streamtcp.c:585)
==1927474==
==1927474== LEAK SUMMARY:
==1927474==    definitely lost: 0 bytes in 0 blocks
==1927474==    indirectly lost: 0 bytes in 0 blocks
==1927474==      possibly lost: 0 bytes in 0 blocks
==1927474==    still reachable: 131,186 bytes in 4 blocks
==1927474==         suppressed: 0 bytes in 0 blocks
==1927474==
==1927474== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Signed-off-by: eaglegai <eaglegai@163.com>
2023-03-07 21:49:54 +08:00
eaglegai
319119943f fix potential memory leak in unbound-host when errors happen
==3709953== HEAP SUMMARY:
==3709953==     in use at exit: 276,541 bytes in 23 blocks
==3709953==   total heap usage: 29 allocs, 6 frees, 280,682 bytes allocated
==3709953==
==3709953== 1 bytes in 1 blocks are still reachable in loss record 1 of 23
==3709953==    at 0x4866EC0: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-arm64-linux.so)
==3709953==    by 0x48E2BC3: ub_initstate (random.c:85)
==3709953==    by 0x489B067: ub_ctx_create_nopipe (libunbound.c:114)
==3709953==    by 0x489B31F: ub_ctx_create (libunbound.c:180)
==3709953==    by 0x10E203: main (unbound-host.c:433)
==3709953==
......
==3709953== 8,192 bytes in 1 blocks are still reachable in loss record 22 of 23
==3709953==    at 0x4866EC0: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-arm64-linux.so)
==3709953==    by 0x48E427B: regional_create_custom (regional.c:94)
==3709953==    by 0x48DEA03: edns_strings_create (edns.c:57)
==3709953==    by 0x489B0F3: ub_ctx_create_nopipe (libunbound.c:157)
==3709953==    by 0x489B31F: ub_ctx_create (libunbound.c:180)
==3709953==    by 0x10E203: main (unbound-host.c:433)
==3709953==
==3709953== 262,144 bytes in 1 blocks are still reachable in loss record 23 of 23
==3709953==    at 0x486933C: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-arm64-linux.so)
==3709953==    by 0x48C826F: config_create (config_file.c:179)
==3709953==    by 0x48C85AF: config_create_forlib (config_file.c:383)
==3709953==    by 0x489B0BB: ub_ctx_create_nopipe (libunbound.c:130)
==3709953==    by 0x489B31F: ub_ctx_create (libunbound.c:180)
==3709953==    by 0x10E203: main (unbound-host.c:433)
==3709953==
==3709953== LEAK SUMMARY:
==3709953==    definitely lost: 0 bytes in 0 blocks
==3709953==    indirectly lost: 0 bytes in 0 blocks
==3709953==      possibly lost: 0 bytes in 0 blocks
==3709953==    still reachable: 276,541 bytes in 23 blocks
==3709953==         suppressed: 0 bytes in 0 blocks
==3709953==
==3709953== For lists of detected and suppressed errors, rerun with: -s
==3709953== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Signed-off-by: eaglegai <eaglegai@163.com>
2023-03-06 22:04:06 +08:00
W.C.A. Wijngaards
d97c174f50 - Fix for #852: Completion of error handling. 2023-02-23 13:38:29 +01:00
Philip Homburg
ed07c5424d Changelog entry for issue #825 2023-02-21 09:29:39 +01:00
Philip Homburg
fb187d1a60 Merge branch 'master' into ecs-serve-expired-bug 2023-02-21 09:28:13 +01:00
Philip Homburg
71e0ddc94a Improved comment 2023-02-21 09:27:03 +01:00
Philip Homburg
b89d0d1cce Test cache update from serve-expired and client-subnet-always-forward 2023-02-21 09:21:43 +01:00
Philip Homburg
d1f5ded1d9 ifdef CLIENT_SUBNET 2023-02-21 09:21:24 +01:00
Philip Homburg
fb06364014 Fix issue #825: interaction between ECS and serve-expired. 2023-02-21 09:20:28 +01:00
George Thessalonikefs
02a77f0567 Changelog entry for
- Clean up iterator/iterator.c::error_response_cache() and allow for
  better interaction with serve-expired, prefetch and cached error
  responses.
2023-02-10 16:54:44 +01:00
George Thessalonikefs
eb81761b13 - Clean up iterator/iterator.c::error_response_cache() and allow for
better interaction with serve-expired, prefetch and cached error
  responses.
2023-02-10 16:51:07 +01:00
George Thessalonikefs
96c70d91ca - Add testcase for refreshing expired error responses. 2023-02-09 12:44:01 +01:00
W.C.A. Wijngaards
488811157e - Fix to git ignore the library symbol file that configure can create. 2023-02-09 12:08:27 +01:00
W.C.A. Wijngaards
e225e4bcab - Fix consistency of unit test without roundrobin answers for the
cnametooptout unit test.
2023-02-09 11:46:33 +01:00
George Thessalonikefs
1c1c5d72d3 Changelog entry for
- Allow TTL refresh of expired error responses.
2023-02-09 10:52:56 +01:00
George Thessalonikefs
87a8c80fcb - Allow TTL refresh of expired error responses. 2023-02-09 10:47:46 +01:00
W.C.A. Wijngaards
a8977df4d9 - Fix unit tests for spurious empty messages. 2023-02-09 10:38:55 +01:00
W.C.A. Wijngaards
4953daa016 - Fix to ignore entirely empty responses, and try at another authority.
This turns completely empty responses, a type of noerror/nodata into
  a servfail, but they do not conform to RFC2308, and the retry can
  fetch improved content.
2023-02-09 09:56:40 +01:00
W.C.A. Wijngaards
5ab5b3b43a - Fix #841: Unbound won't build with aaaa-filter-iterator.patch. 2023-02-08 11:36:52 +01:00
George Thessalonikefs
24e6d1e18e - Add duration variable for speed_local.test. 2023-01-30 11:33:58 +01:00
W.C.A. Wijngaards
8b9382998d Regenerate configure for the fix acx_nlnetlabs.m4 for -Wstrict-prototypes. 2023-01-26 10:59:16 +01:00
W.C.A. Wijngaards
c482999898 - Fix acx_nlnetlabs.m4 for -Wstrict-prototypes. 2023-01-26 10:54:38 +01:00
George Thessalonikefs
6bf677e7de Fix #833: [FR] Ability to set the Redis password. 2023-01-23 11:45:07 +01:00
W.C.A. Wijngaards
d666e9bd13 - Fix #835: [FR] Ability to use Redis unix sockets. 2023-01-23 10:10:23 +01:00
W.C.A. Wijngaards
77f15428c9 - Add #835: [FR] Ability to use Redis unix sockets. 2023-01-23 10:09:28 +01:00
W.C.A. Wijngaards
111e66ae64 Changelog note for #819, generate configparser.c and comment syntax change.
- Merge #819: Added new static zone type block_a to suppress all A
  queries for specific zones.
2023-01-20 16:19:20 +01:00
Wouter Wijngaards
6a4a9435d1
Merge pull request #819 from pavel-odintsov/pavel/suppress_a
Added new static zone type block_a to suppress all A queries for specific zones
2023-01-20 16:18:05 +01:00
W.C.A. Wijngaards
6afdc336ba - Fix test for new default. 2023-01-19 16:06:30 +01:00
W.C.A. Wijngaards
c9233f8429 - Set default for harden-unknown-additional to no. So that it does
not hamper future protocol developments.
2023-01-19 15:45:10 +01:00
W.C.A. Wijngaards
8df1e58209 - Add harden-unknown-additional option. Default on and it removes
unknown records from the authority section and additional section.
  Thanks to Xiang Li, from NISL Lab, Tsinghua University.
2023-01-19 14:59:18 +01:00
W.C.A. Wijngaards
d69f875261 - Set max-udp-size default to 1232. This is the same default value as
the default value for edns-buffer-size. It restricts client edns
  buffer size choices, and makes unbound behave similar to other DNS
  resolvers. The new choice, down from 4096 means it is harder to get
  large responses from Unbound. Thanks to Xiang Li, from NISL Lab,
  Tsinghua University.
2023-01-19 14:16:17 +01:00
W.C.A. Wijngaards
b12ab31ae3 - Fix not following cleared RD flags potentially enables amplification
DDoS attacks, reported by Xiang Li and Wei Xu from NISL Lab,
  Tsinghua University. The fix stops query loops, by refusing to send
  RD=0 queries to a forwarder, they still get answered from cache.
2023-01-18 13:18:47 +01:00
W.C.A. Wijngaards
90d42148de - Improve documentation for #826, describe the large collisions amount. 2023-01-13 11:22:47 +01:00
W.C.A. Wijngaards
469133e8df Changelog note and documentation for #826
- Merge #826: Аdd a metric about the maximum number of collisions in
  lrushah.
2023-01-13 11:01:46 +01:00
Wouter Wijngaards
785c938106
Merge pull request #826 from sakateka/lruhash_max_collisions
Аdd a metric about the maximum number of collisions in lrushah
2023-01-13 10:57:44 +01:00
Sergey Kacheev
52a4ccee18 add a metric about the maximum number of collisions in lrushah 2023-01-13 13:33:38 +07:00
W.C.A. Wijngaards
aa621f1c04 Code repository continues with version 1.17.2. 2023-01-12 10:21:28 +01:00
W.C.A. Wijngaards
0fed35a4b7 - Fix python version detection in configure. 2023-01-09 15:10:00 +01:00
W.C.A. Wijngaards
4517dcd439 - Fix python module install path detection. 2023-01-09 15:03:38 +01:00
W.C.A. Wijngaards
c5c4f6d40b Changelog note for 1.17.1rc2 fix.
- Fix wildcard in hyperlocal zone service degradation, reported
  by Sergey Kacheev. This fix is included in 1.17.1rc2.
2023-01-06 13:23:02 +01:00
W.C.A. Wijngaards
0419b06ca4 Merge branch 'branch-1.17.1' 2023-01-06 13:22:06 +01:00
W.C.A. Wijngaards
90831af981 - Fix wildcard in hyperlocal zone service degradation, reported
by Sergey Kacheev.
2023-01-06 13:21:39 +01:00
W.C.A. Wijngaards
ba6325f24f - Fix #823: Response change to NODATA for some ANY queries since
1.12, tested on 1.16.1.
2023-01-06 09:16:59 +01:00
W.C.A. Wijngaards
2025946247 Changelog note for tag for 1.17.1rc1.
- Tag for 1.17.1 release.
2023-01-05 11:06:07 +01:00
Alex Band
e92bd614c0
Add Mastodon link 2023-01-04 16:21:43 +01:00
Alex Band
f93fdb5e09
Add Mastodon 2023-01-04 15:57:45 +01:00
Pavel Odintsov
d5b9a790fe Added new static zone type block_a to suppress all A queries for specific zones 2023-01-03 19:17:51 +00:00
W.C.A. Wijngaards
70260273a4 - Update github workflows to use checkout v3. 2023-01-02 13:30:03 +01:00
W.C.A. Wijngaards
1224cd9d25 - Fix windows compile for libunbound subprocess reap comm point closes. 2023-01-02 13:06:39 +01:00
George Thessalonikefs
0682d4371e - Merge #569 from JINMEI Tatuya: add keep-cache option to
'unbound-control reload' to keep caches.
2022-12-14 16:40:00 +01:00