1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00
samba-mirror/source3/rpc_server
Samuel Cabrero 2558c15beb s3:rpc_server: Fix talloc_free() with references error on server exit
Fixes talloc_free() with references when smbd exists and talloc_free the
global dcesrv context:

ERROR: talloc_free with references at ../../source3/rpc_server/rpc_config.c:73
	reference at ../../source3/rpc_server/rpc_server.c:193
	reference at ../../source3/rpc_server/rpc_server.c:592
	...

The talloc_reference to make the dcerpc_ncacn_listen_state a parent of
the dcesrv context is not necessary as the listen state is allocated
under the endpoint, which is allocated under the dcesrv context:

full talloc report on 'struct dcesrv_context' (total  12298 bytes in 188 blocks)
    ...
    struct dcesrv_endpoint         contains    691 bytes in  11 blocks (ref 0) 0x55ae964d79a0
        struct dcerpc_ncacn_listen_state contains    160 bytes in   2 blocks (ref 0) 0x55ae964fca60
            struct tevent_fd               contains    104 bytes in   1 blocks (ref 0) 0x55ae964f36f0
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964e8a40
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964e8ac0
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964e8870
            ../../librpc/rpc/dcesrv_core.c:327 contains    104 bytes in   1 blocks (ref 0) 0x55ae964e8970
        struct dcerpc_binding          contains    108 bytes in   2 blocks (ref 0) 0x55ae964e87a0
            \pipe\lsass                    contains     12 bytes in   1 blocks (ref 0) 0x55ae964e88f0
        struct dcerpc_binding          contains    111 bytes in   2 blocks (ref 0) 0x55ae964e86d0
            \pipe\netlogon                 contains     15 bytes in   1 blocks (ref 0) 0x55ae964e8650
    ...
    struct dcesrv_endpoint         contains   1728 bytes in  27 blocks (ref 0) 0x55ae964e0db0
        struct dcerpc_ncacn_listen_state contains    160 bytes in   2 blocks (ref 0) 0x55ae964fd540
            struct tevent_fd               contains    104 bytes in   1 blocks (ref 0) 0x55ae964f3890
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964fbd70
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964f67a0
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964fff60
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964f66c0
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964eb8b0
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964eba00
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964eb200
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964eb350
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964eab70
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964eabf0
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964ea360
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964ea4b0
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964e9cb0
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964e9e00
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964e96a0
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964e97f0
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964e8430
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964e8580
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964e6250
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964e8070
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964e7e50
            ../../librpc/rpc/dcesrv_core.c:327 contains    104 bytes in   1 blocks (ref 0) 0x55ae964e7fa0
        struct dcerpc_binding          contains    104 bytes in   2 blocks (ref 0) 0x55ae964e7ed0
            DEFAULT                        contains      8 bytes in   1 blocks (ref 0) 0x55ae964eaa10
    ....

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Apr  1 10:28:43 UTC 2020 on sn-devel-184
2020-04-01 10:28:43 +00:00
..
dfs s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
dssetup s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
echo s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
epmapper s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
eventlog s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
fss s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
initshutdown s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
lsa s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
mdssvc s3:rpc_server: Remove unused RPC module init and shutdown callbacks 2020-03-20 15:36:36 +00:00
netlogon s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
ntsvcs s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
samr s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
spoolss s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
srvsvc s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
svcctl s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
winreg s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
wkssvc s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
epmd.c s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
epmd.h s3:rpc_server: Reinitialize dcesrv_context in external epmd daemon 2020-03-20 15:36:32 +00:00
fssd.c s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
fssd.h s3:rpc_server: Reinitialize dcesrv_context in external fssd daemon 2020-03-20 15:36:32 +00:00
lsasd.c s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
lsasd.h s3:rpc_server: Reinitialize dcesrv_context in external lsasd daemon 2020-03-20 15:36:32 +00:00
mdssd.c s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
mdssd.h s3:rpc_server: Reinitialize dcesrv_context in external mdssd daemon 2020-03-20 15:36:32 +00:00
rpc_config.c s3:rpc_server: Setup dcesrv_context callbacks 2020-03-20 15:36:33 +00:00
rpc_config.h s3:rpc_server: Add global dcesrv_context init and shutdown functions 2020-03-20 15:36:32 +00:00
rpc_contexts.c s3:rpc_server: Set debug class in all rpc server related files 2019-07-22 16:49:15 +00:00
rpc_contexts.h
rpc_ep_register.c s3:rpc_server: Drop dcerpc_binding_vector usage in the server side 2020-03-20 15:36:34 +00:00
rpc_ep_register.h s3:rpc_server: Drop dcerpc_binding_vector usage in the server side 2020-03-20 15:36:34 +00:00
rpc_handles.c s3:rpc_server: Remove dead code and unused struct members 2020-03-20 15:36:36 +00:00
rpc_modules.c s3:rpc_server: Remove unused RPC module init and shutdown callbacks 2020-03-20 15:36:36 +00:00
rpc_modules.h s3:rpc_server: Remove unused RPC module init and shutdown callbacks 2020-03-20 15:36:36 +00:00
rpc_ncacn_np.c s3:rpc_server: Remove dead code 2020-03-20 17:11:28 +00:00
rpc_ncacn_np.h s3:rpc_server: Retrieve dcesrv_context from parent context to open NP 2020-03-20 15:36:35 +00:00
rpc_pipes.h s3:rpc_server: Remove dead code 2020-03-20 17:11:28 +00:00
rpc_server.c s3:rpc_server: Fix talloc_free() with references error on server exit 2020-04-01 10:28:43 +00:00
rpc_server.h s3:rpc_server: Remove s3 rpc server loop 2020-03-20 15:36:36 +00:00
rpc_service_setup.c s3:rpc_server: Drop dcerpc_binding_vector usage in the server side 2020-03-20 15:36:34 +00:00
rpc_service_setup.h s3:rpc_server: Drop dcerpc_binding_vector usage in the server side 2020-03-20 15:36:34 +00:00
rpc_sock_helper.c s3:rpc_server: Drop dcerpc_binding_vector usage in the server side 2020-03-20 15:36:34 +00:00
rpc_sock_helper.h s3:rpc_server: Drop dcerpc_binding_vector usage in the server side 2020-03-20 15:36:34 +00:00
srv_access_check.c s3:rpc_server: Set debug class in all rpc server related files 2019-07-22 16:49:15 +00:00
srv_access_check.h Covert all uint32/16/8 to _t in source3/rpc_server. 2015-05-15 19:31:24 +02:00
srv_pipe_hnd.c s3:rpc_server: Retrieve dcesrv_context from parent context to open NP 2020-03-20 15:36:35 +00:00
srv_pipe_hnd.h s3:rpc_server: Retrieve dcesrv_context from parent context to open NP 2020-03-20 15:36:35 +00:00
srv_pipe.c s3:rpc_server: Remove s3 rpc server loop 2020-03-20 15:36:36 +00:00
srv_pipe.h s3:rpc_server: Remove s3 rpc server loop 2020-03-20 15:36:36 +00:00
wscript_build s3:rpc_server: Remove dead code 2020-03-20 17:11:28 +00:00