The branch, master has been updated via ed9abf94b31 utils/asn1: avoid undefined behaviour warning via 47ee0c81f65 s4:torture/rpc: move test_fsrvp_seq_timeout as last via 9bbfdb11858 s4:torture/rpc: flip order of netlogon tests via 671fe10f212 s4:torture/rpc: run tests in the order that they're added via 6f5b0fef598 ctdb: Prevent man page duplication via e60df214998 oss-fuzz: standardise on RUNPATH for the static-ish binaries from 53a368c58d0 idmap_ad: Honor "client ldap sasl wrapping" config setting
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit ed9abf94b3167a1a61b5da163e9b07b06c8a457b Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Sun Sep 6 09:35:49 2020 +1200 utils/asn1: avoid undefined behaviour warning UBSAN does not like an int >= 1<<24 being shifted left. We check the overflow in the very next line. Credit to OSS-Fuzz. REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25436 Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> Autobuild-User(master): Andrew Bartlett <abart...@samba.org> Autobuild-Date(master): Fri Sep 11 05:05:59 UTC 2020 on sn-devel-184 commit 47ee0c81f65108216234f738c3ada6782931dc47 Author: David Disseldorp <dd...@samba.org> Date: Tue Sep 8 01:20:51 2020 +0200 s4:torture/rpc: move test_fsrvp_seq_timeout as last test_fsrvp_seq_timeout may see share snapshots left-over, which can cause problems if subsequent tests expect a clean slate (i.e. enum_created). Signed-off-by: David Disseldorp <dd...@samba.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 9bbfdb11858fd6cdecdfedb3fcbf7cde219e3dd9 Author: David Disseldorp <dd...@samba.org> Date: Sun Sep 6 18:46:38 2020 +0200 s4:torture/rpc: flip order of netlogon tests The previous change to not run rpc tests in reverse order results in the following failure: Testing netr_LogonGetDomainInfo UNEXPECTED(failure): samba4.rpc.netlogon with seal,padcheck.netlogon.GetDomainInfo(ad_dc) REASON: Exception: ../../source4/torture/rpc/netlogon.c:320: Expression `plain_pass != ((void *)0)' failed: plain_pass Restore the dependent order of netlogon tests by reversing the torture_rpc_tcase_add_test*() calls for the suite. Signed-off-by: David Disseldorp <dd...@samba.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 671fe10f212b013af844ad4e3291322082b05619 Author: David Disseldorp <dd...@samba.org> Date: Sun Sep 6 10:57:41 2020 +0200 s4:torture/rpc: run tests in the order that they're added torture_rpc_tcase_add_test*() uses DLIST_ADD(), which sees them executed in reverse order to which they're added. Use DLIST_ADD_END() instead to fix this. Signed-off-by: David Disseldorp <dd...@samba.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 6f5b0fef59850477ad30c2b5063b431725716056 Author: David Mulder <dmul...@suse.com> Date: Thu Sep 10 11:50:53 2020 -0600 ctdb: Prevent man page duplication The new waf detects a duplicate instance of ctdb_mutex_ceph_rados_helper.7.xml, which is due to manpages_extra being a pointer to manpages_misc, therefore each call to build() added duplicate entries to the manpages_misc global entry. Signed-off-by: David Mulder <dmul...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit e60df214998afc145ca482cab184691b3ddc3bb2 Author: Andrew Bartlett <abart...@samba.org> Date: Wed Aug 26 15:37:57 2020 +1200 oss-fuzz: standardise on RUNPATH for the static-ish binaries We use ld.bfd for the coverage builds, rather than the faster ld.gold. We run the oss-fuzz autobuild target on Ubuntu 16.04 to more closely mirror the environment provided by the Google oss-fuzz build container. On Ubuntu 16.04, when linking with ld.bfd built binaries get a RPATH, but builds in Ubuntu 18.04 and those using ld.gold get a RUNPATH. Just convert them all to RUNPATH to make the check_build.sh test (run by the oss-fuzz autobuild target) easier. Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> ----------------------------------------------------------------------- Summary of changes: ctdb/wscript | 2 +- lib/fuzzing/oss-fuzz/build_samba.sh | 11 +++++ lib/util/asn1.c | 6 ++- source4/torture/rpc/fsrvp.c | 4 +- source4/torture/rpc/netlogon.c | 82 ++++++++++++++++++------------------- source4/torture/rpc/rpc.c | 10 ++--- 6 files changed, 65 insertions(+), 50 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/wscript b/ctdb/wscript index 35c8c0622fc..b883990c55e 100644 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -705,7 +705,7 @@ def build(bld): (sed_expr1, sed_expr2, sed_expr3, sed_expr4, sed_expr5, sed_expr6, sed_expr7, sed_expr8) - manpages_extra = manpages_misc + manpages_extra = list(manpages_misc) if bld.env.etcd_reclock: manpages_extra += manpages_etcd if bld.env.HAVE_LIBRADOS: diff --git a/lib/fuzzing/oss-fuzz/build_samba.sh b/lib/fuzzing/oss-fuzz/build_samba.sh index 333e8c38561..b06e03c4903 100755 --- a/lib/fuzzing/oss-fuzz/build_samba.sh +++ b/lib/fuzzing/oss-fuzz/build_samba.sh @@ -88,6 +88,17 @@ do # Copy any system libraries needed by this fuzzer to $OUT/lib ldd $OUT/$bin | cut -f 2 -d '>' | cut -f 1 -d \( | cut -f 2 -d ' ' | xargs -i cp \{\} $OUT/lib/ + # Change any RPATH to RUNPATH. + # + # We use ld.bfd for the coverage builds, rather than the faster ld.gold. + # + # On Ubuntu 16.04, used for the oss-fuzz build, when linking with + # ld.bfd the binaries get a RPATH, but builds in Ubuntu 18.04 + # ld.bfd and those using ld.gold get a RUNPATH. + # + # Just convert them all to RUNPATH to make the check_build.sh test + # easier. + chrpath -c $OUT/$bin # Change RUNPATH so that the copied libraries are found on the # runner chrpath -r '$ORIGIN/lib' $OUT/$bin diff --git a/lib/util/asn1.c b/lib/util/asn1.c index 6b1b4bc2877..9ab9e1b0844 100644 --- a/lib/util/asn1.c +++ b/lib/util/asn1.c @@ -1071,7 +1071,11 @@ bool asn1_read_enumerated(struct asn1_data *data, int *v) data->has_error = true; return false; } - *v = (*v << 8) + b; + /* + * To please/fool the Undefined Behaviour Sanitizer we cast to + * unsigned for the left shift. + */ + *v = ((unsigned int)*v << 8) + b; if (*v < 0) { /* ASN1_ENUMERATED can't be -ve. */ data->has_error = true; diff --git a/source4/torture/rpc/fsrvp.c b/source4/torture/rpc/fsrvp.c index 71750114a18..00e690de536 100644 --- a/source4/torture/rpc/fsrvp.c +++ b/source4/torture/rpc/fsrvp.c @@ -945,8 +945,6 @@ struct torture_suite *torture_rpc_fsrvp(TALLOC_CTX *mem_ctx) torture_rpc_tcase_add_test(tcase, "share_sd", test_fsrvp_share_sd); - torture_rpc_tcase_add_test(tcase, "seq_timeout", - test_fsrvp_seq_timeout); torture_rpc_tcase_add_test(tcase, "enum_created", test_fsrvp_enum_created); torture_rpc_tcase_add_test(tcase, "sc_share_io", @@ -963,6 +961,8 @@ struct torture_suite *torture_rpc_fsrvp(TALLOC_CTX *mem_ctx) test_fsrvp_get_version); torture_rpc_tcase_add_test(tcase, "is_path_supported", test_fsrvp_is_path_supported); + torture_rpc_tcase_add_test(tcase, "seq_timeout", + test_fsrvp_seq_timeout); return suite; } diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index 87c6ed548cb..c508ecacd50 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -4926,51 +4926,51 @@ struct torture_suite *torture_rpc_netlogon(TALLOC_CTX *mem_ctx) tcase = torture_suite_add_machine_bdc_rpc_iface_tcase(suite, "netlogon", &ndr_table_netlogon, TEST_MACHINE_NAME); - torture_rpc_tcase_add_test(tcase, "Broken RPC binding handle", - test_netr_broken_binding_handle); + torture_rpc_tcase_add_test_creds(tcase, "SetupCredentialsDowngrade", test_SetupCredentialsDowngrade); + torture_rpc_tcase_add_test(tcase, "lsa_over_netlogon", test_lsa_over_netlogon); - torture_rpc_tcase_add_test(tcase, "LogonUasLogon", test_LogonUasLogon); - torture_rpc_tcase_add_test(tcase, "LogonUasLogoff", test_LogonUasLogoff); - torture_rpc_tcase_add_test_creds(tcase, "SamLogon", test_SamLogon); - torture_rpc_tcase_add_test_creds(tcase, "invalidAuthenticate2", test_invalidAuthenticate2); - torture_rpc_tcase_add_test_creds(tcase, "ServerReqChallengeGlobal", test_ServerReqChallengeGlobal); - torture_rpc_tcase_add_test_creds(tcase, "ServerReqChallengeReuseGlobal", test_ServerReqChallengeReuseGlobal); - torture_rpc_tcase_add_test_creds(tcase, "ServerReqChallengeReuseGlobal2", test_ServerReqChallengeReuseGlobal2); - torture_rpc_tcase_add_test_creds(tcase, "ServerReqChallengeReuseGlobal3", test_ServerReqChallengeReuseGlobal3); - torture_rpc_tcase_add_test_creds(tcase, "ServerReqChallengeReuseGlobal4", test_ServerReqChallengeReuseGlobal4); - torture_rpc_tcase_add_test_creds(tcase, "ServerReqChallengeReuse", test_ServerReqChallengeReuse); - torture_rpc_tcase_add_test_creds(tcase, "SetPassword", test_SetPassword); - torture_rpc_tcase_add_test_creds(tcase, "SetPassword2", test_SetPassword2); - torture_rpc_tcase_add_test_creds(tcase, "SetPassword2_AES", test_SetPassword2_AES); - torture_rpc_tcase_add_test_creds(tcase, "GetPassword", test_GetPassword); - torture_rpc_tcase_add_test_creds(tcase, "GetTrustPasswords", test_GetTrustPasswords); - torture_rpc_tcase_add_test_creds(tcase, "GetDomainInfo", test_GetDomainInfo); - torture_rpc_tcase_add_test_creds(tcase, "DatabaseSync", test_DatabaseSync); - torture_rpc_tcase_add_test_creds(tcase, "DatabaseDeltas", test_DatabaseDeltas); - torture_rpc_tcase_add_test_creds(tcase, "DatabaseRedo", test_DatabaseRedo); - torture_rpc_tcase_add_test_creds(tcase, "AccountDeltas", test_AccountDeltas); - torture_rpc_tcase_add_test_creds(tcase, "AccountSync", test_AccountSync); - torture_rpc_tcase_add_test(tcase, "GetDcName", test_GetDcName); - torture_rpc_tcase_add_test(tcase, "ManyGetDCName", test_ManyGetDCName); - torture_rpc_tcase_add_test(tcase, "GetAnyDCName", test_GetAnyDCName); - torture_rpc_tcase_add_test_creds(tcase, "DatabaseSync2", test_DatabaseSync2); - torture_rpc_tcase_add_test(tcase, "DsrEnumerateDomainTrusts", test_DsrEnumerateDomainTrusts); - torture_rpc_tcase_add_test(tcase, "NetrEnumerateTrustedDomains", test_netr_NetrEnumerateTrustedDomains); - torture_rpc_tcase_add_test(tcase, "NetrEnumerateTrustedDomainsEx", test_netr_NetrEnumerateTrustedDomainsEx); + torture_rpc_tcase_add_test_creds(tcase, "GetForestTrustInformation", test_netr_GetForestTrustInformation); + torture_rpc_tcase_add_test_creds(tcase, "ServerGetTrustInfo_AES", test_netr_ServerGetTrustInfo_AES); + torture_rpc_tcase_add_test_creds(tcase, "ServerGetTrustInfo", test_netr_ServerGetTrustInfo); + torture_rpc_tcase_add_test(tcase, "DsRAddressToSitenamesExW", test_netr_DsRAddressToSitenamesExW); + torture_rpc_tcase_add_test(tcase, "DsRAddressToSitenamesW", test_netr_DsRAddressToSitenamesW); + torture_rpc_tcase_add_test(tcase, "DsrGetDcSiteCoverageW", test_netr_DsrGetDcSiteCoverageW); + torture_rpc_tcase_add_test(tcase, "DsRGetDCNameEx2", test_netr_DsRGetDCNameEx2); + torture_rpc_tcase_add_test(tcase, "DsRGetDCNameEx", test_netr_DsRGetDCNameEx); + torture_rpc_tcase_add_test(tcase, "DsRGetDCName", test_netr_DsRGetDCName); test = torture_rpc_tcase_add_test_creds(tcase, "GetDomainInfo_async", test_GetDomainInfo_async); test->dangerous = true; - torture_rpc_tcase_add_test(tcase, "DsRGetDCName", test_netr_DsRGetDCName); - torture_rpc_tcase_add_test(tcase, "DsRGetDCNameEx", test_netr_DsRGetDCNameEx); - torture_rpc_tcase_add_test(tcase, "DsRGetDCNameEx2", test_netr_DsRGetDCNameEx2); - torture_rpc_tcase_add_test(tcase, "DsrGetDcSiteCoverageW", test_netr_DsrGetDcSiteCoverageW); - torture_rpc_tcase_add_test(tcase, "DsRAddressToSitenamesW", test_netr_DsRAddressToSitenamesW); - torture_rpc_tcase_add_test(tcase, "DsRAddressToSitenamesExW", test_netr_DsRAddressToSitenamesExW); - torture_rpc_tcase_add_test_creds(tcase, "ServerGetTrustInfo", test_netr_ServerGetTrustInfo); - torture_rpc_tcase_add_test_creds(tcase, "ServerGetTrustInfo_AES", test_netr_ServerGetTrustInfo_AES); - torture_rpc_tcase_add_test_creds(tcase, "GetForestTrustInformation", test_netr_GetForestTrustInformation); + torture_rpc_tcase_add_test(tcase, "NetrEnumerateTrustedDomainsEx", test_netr_NetrEnumerateTrustedDomainsEx); + torture_rpc_tcase_add_test(tcase, "NetrEnumerateTrustedDomains", test_netr_NetrEnumerateTrustedDomains); + torture_rpc_tcase_add_test(tcase, "DsrEnumerateDomainTrusts", test_DsrEnumerateDomainTrusts); + torture_rpc_tcase_add_test_creds(tcase, "DatabaseSync2", test_DatabaseSync2); + torture_rpc_tcase_add_test(tcase, "GetAnyDCName", test_GetAnyDCName); + torture_rpc_tcase_add_test(tcase, "ManyGetDCName", test_ManyGetDCName); + torture_rpc_tcase_add_test(tcase, "GetDcName", test_GetDcName); + torture_rpc_tcase_add_test_creds(tcase, "AccountSync", test_AccountSync); + torture_rpc_tcase_add_test_creds(tcase, "AccountDeltas", test_AccountDeltas); + torture_rpc_tcase_add_test_creds(tcase, "DatabaseRedo", test_DatabaseRedo); + torture_rpc_tcase_add_test_creds(tcase, "DatabaseDeltas", test_DatabaseDeltas); + torture_rpc_tcase_add_test_creds(tcase, "DatabaseSync", test_DatabaseSync); + torture_rpc_tcase_add_test_creds(tcase, "GetDomainInfo", test_GetDomainInfo); + torture_rpc_tcase_add_test_creds(tcase, "GetTrustPasswords", test_GetTrustPasswords); + torture_rpc_tcase_add_test_creds(tcase, "GetPassword", test_GetPassword); + torture_rpc_tcase_add_test_creds(tcase, "SetPassword2_AES", test_SetPassword2_AES); + torture_rpc_tcase_add_test_creds(tcase, "SetPassword2", test_SetPassword2); + torture_rpc_tcase_add_test_creds(tcase, "SetPassword", test_SetPassword); + torture_rpc_tcase_add_test_creds(tcase, "ServerReqChallengeReuse", test_ServerReqChallengeReuse); + torture_rpc_tcase_add_test_creds(tcase, "ServerReqChallengeReuseGlobal4", test_ServerReqChallengeReuseGlobal4); + torture_rpc_tcase_add_test_creds(tcase, "ServerReqChallengeReuseGlobal3", test_ServerReqChallengeReuseGlobal3); + torture_rpc_tcase_add_test_creds(tcase, "ServerReqChallengeReuseGlobal2", test_ServerReqChallengeReuseGlobal2); + torture_rpc_tcase_add_test_creds(tcase, "ServerReqChallengeReuseGlobal", test_ServerReqChallengeReuseGlobal); + torture_rpc_tcase_add_test_creds(tcase, "ServerReqChallengeGlobal", test_ServerReqChallengeGlobal); + torture_rpc_tcase_add_test_creds(tcase, "invalidAuthenticate2", test_invalidAuthenticate2); + torture_rpc_tcase_add_test_creds(tcase, "SamLogon", test_SamLogon); + torture_rpc_tcase_add_test(tcase, "LogonUasLogoff", test_LogonUasLogoff); + torture_rpc_tcase_add_test(tcase, "LogonUasLogon", test_LogonUasLogon); - torture_rpc_tcase_add_test(tcase, "lsa_over_netlogon", test_lsa_over_netlogon); - torture_rpc_tcase_add_test_creds(tcase, "SetupCredentialsDowngrade", test_SetupCredentialsDowngrade); + torture_rpc_tcase_add_test(tcase, "Broken RPC binding handle", + test_netr_broken_binding_handle); return suite; } diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c index 4a01eb2480c..243e5d3f207 100644 --- a/source4/torture/rpc/rpc.c +++ b/source4/torture/rpc/rpc.c @@ -414,7 +414,7 @@ _PUBLIC_ struct torture_test *torture_rpc_tcase_add_test( test->data = NULL; test->fn = fn; - DLIST_ADD(tcase->tcase.tests, test); + DLIST_ADD_END(tcase->tcase.tests, test); return test; } @@ -435,7 +435,7 @@ _PUBLIC_ struct torture_test *torture_rpc_tcase_add_test_creds( test->data = NULL; test->fn = fn; - DLIST_ADD(tcase->tcase.tests, test); + DLIST_ADD_END(tcase->tcase.tests, test); return test; } @@ -457,7 +457,7 @@ _PUBLIC_ struct torture_test *torture_rpc_tcase_add_test_join( test->data = NULL; test->fn = fn; - DLIST_ADD(tcase->tcase.tests, test); + DLIST_ADD_END(tcase->tcase.tests, test); return test; } @@ -480,7 +480,7 @@ _PUBLIC_ struct torture_test *torture_rpc_tcase_add_test_ex( test->data = userdata; test->fn = fn; - DLIST_ADD(tcase->tcase.tests, test); + DLIST_ADD_END(tcase->tcase.tests, test); return test; } @@ -536,7 +536,7 @@ _PUBLIC_ struct torture_test *torture_rpc_tcase_add_test_setup( test->data = userdata; test->fn = fn; - DLIST_ADD(tcase->tcase.tests, test); + DLIST_ADD_END(tcase->tcase.tests, test); return test; } -- Samba Shared Repository