1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
samba-mirror/source3/rpc_server
Ralph Boehme 3633027e49 rpcd_mdssvc: initialize POSIX locking
Otherwise the posix_pending_close_db is NULL and we crash when trying to close a
file descriptor:

   #4 /usr/lib64/samba/libdbwrap-samba4.so(dbwrap_parse_record+0xe) [0x7fbc5d05c8ae]
   #5 /usr/lib64/samba/libdbwrap-samba4.so(dbwrap_fetch_int32+0x38) [0x7fbc5d05d438]
   #6 /usr/lib64/samba/libsmbd-base-samba4.so(fd_close_posix+0x7b) [0x7fbc5e276f8b]
   #7 /usr/lib64/samba/libsmbd-base-samba4.so(+0x57900) [0x7fbc5e28a900]
   #8 /usr/lib64/samba/libsmbd-base-samba4.so(fd_close+0x68) [0x7fbc5e2b7ea8]
   #9 /usr/lib64/samba/libsmbd-base-samba4.so(+0x62608) [0x7fbc5e295608]
   #10 /usr/lib64/samba/libtalloc-samba4.so(_talloc_free+0x51b) [0x7fbc5d9f439b]
   #11 /usr/lib64/samba/vfs/fruit.so(+0xcac2) [0x7fbc45fcdac2]
   #12 /usr/lib64/samba/vfs/fruit.so(+0xcbdd) [0x7fbc45fcdbdd]
   #13 /usr/lib64/samba/vfs/fruit.so(+0xf603) [0x7fbc45fd0603]
   #14 /usr/lib64/samba/libsmbd-base-samba4.so(+0x56375) [0x7fbc5e289375]
   #15 /usr/lib64/samba/vfs/nothingtoseeherereally.so(+0x196c) [0x7fbc467f996c]
   #16 /usr/lib64/samba/vfs/streams_xattr.so(+0x51fc) [0x7fbc461e71fc]
   #17 /usr/lib64/samba/libsmbd-base-samba4.so(+0xade3a) [0x7fbc5e2e0e3a]
   #18 /usr/lib64/samba/libsmbd-base-samba4.so(create_conn_struct_cwd+0x44) [0x7fbc5e2e1cf4]
   #19 /usr/libexec/samba/rpcd_mdssvc(mds_init_ctx+0x2c3) [0x563fdac08f03]
   #20 /usr/libexec/samba/rpcd_mdssvc(_mdssvc_open+0x141) [0x563fdac0b4d1]

The corresponding open is done as part of initializing a connection_struct
object, where we chdir() and stat() the root path of the share. The stat() in
vfs_fruit causes an expensive metadata request on the path which triggers an
internal open of a pathref handle. Note that this only affects servers that have
fruit:metadata = netatalk set, which is the default unfortunately.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15354

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr  7 21:12:21 UTC 2023 on atb-devel-224
2023-04-07 21:12:21 +00:00
..
dfs s3: smbd: Remove allow_broken_path from create_junction(). 2022-08-28 19:59:28 +00:00
dssetup CVE-2020-25717: Add FreeIPA domain controller role 2021-11-09 19:45:33 +00:00
echo s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
epmapper rpc_server3: Remove pipes_struct->local_address 2022-01-05 00:11:37 +00:00
eventlog s3:rpcsrv:eventlog: Remove unused variable 2023-02-06 22:51:31 +00:00
fss rpc_server3: Remove pipes_struct->session_info 2022-01-05 00:11:38 +00:00
initshutdown s3:rpc_server: Do not include s3 autogenerated headers 2020-03-20 15:36:36 +00:00
lsa rpc_server3: Remove pipes_struct->auth 2022-01-05 00:11:38 +00:00
mdssvc mdssvc: fix kMDScopeArray parsing 2023-02-02 20:14:36 +00:00
netlogon s3:rpc_server/netlogon: Fix typo 2023-03-03 01:07:37 +00:00
ntsvcs rpc_server3: Remove pipes_struct->session_info 2022-01-05 00:11:38 +00:00
samr auth: Shorten long SID flags combinations 2023-02-08 00:03:39 +00:00
spoolss rpc_server3: Remove pipes_struct->auth 2022-01-05 00:11:38 +00:00
srvsvc s3:rpc_server/srvsvc: make sure we (re-)load all shares as root. 2022-12-29 21:14:02 +00:00
svcctl rpc_server3: Remove pipes_struct->session_info 2022-01-05 00:11:38 +00:00
winreg rpc_server3: Remove pipes_struct->session_info 2022-01-05 00:11:38 +00:00
wkssvc rpc_server3: Remove pipes_struct->session_info 2022-01-05 00:11:38 +00:00
rpc_config.c dcesrv_core: wrap gensec_*() calls in [un]become_root() calls 2022-01-24 15:25:36 +00:00
rpc_config.h s3:rpc_server: Delete unused code and doc references 2021-12-10 14:02:30 +00:00
rpc_handles.c rpc_server3: Remove pipes_struct->session_info 2022-01-05 00:11:38 +00:00
rpc_host.c rpcd: Use size_t for walking an array 2023-03-09 18:10:33 +00:00
rpc_ncacn_np.c rpc_server3: Inline single-use rpcint_binding_handle_ex() 2022-01-05 00:11:38 +00:00
rpc_ncacn_np.h s3:rpc_server: Activate samba-dcerpcd 2021-12-10 14:02:30 +00:00
rpc_pipes.h rpc_server3: No linked list for pipes_struct anymore 2022-01-05 00:11:38 +00:00
rpc_server.c lib: Remove idtree from samba_util.h 2023-01-10 00:28:37 +00:00
rpc_server.h rpc_server3: Inline pipes_struct into dcerpc_ncacn_conn 2022-01-05 00:11:38 +00:00
rpc_sock_helper.c s3:rpc_server: Delete unused code and doc references 2021-12-10 14:02:30 +00:00
rpc_sock_helper.h rpc_server: Consolidate transport-specific socket creation 2021-01-26 00:10:31 +00:00
rpc_worker.c rpcd: With npa->need_idle_server we can have more than 256 servers 2023-03-06 22:35:00 +00:00
rpc_worker.h s3:rpc_server: Implement the rpcd_* helper-end of the samba-dcerpc protocol 2021-12-10 14:02:30 +00:00
rpcd_classic.c rpc_server3: Initialize mangle_fns in classic and spoolss 2022-07-12 13:33:14 +00:00
rpcd_epmapper.c s3:rpc_server: Add samba-dcerpcd helper programs 2021-12-10 14:02:30 +00:00
rpcd_fsrvp.c s3:rpc_server: Add samba-dcerpcd helper programs 2021-12-10 14:02:30 +00:00
rpcd_lsad.c s3:rpc_server: Add samba-dcerpcd helper programs 2021-12-10 14:02:30 +00:00
rpcd_mdssvc.c rpcd_mdssvc: initialize POSIX locking 2023-04-07 21:12:21 +00:00
rpcd_rpcecho.c s3:rpc_server: Add samba-dcerpcd helper programs 2021-12-10 14:02:30 +00:00
rpcd_spoolss.c rpc_server3: Initialize mangle_fns in classic and spoolss 2022-07-12 13:33:14 +00:00
rpcd_winreg.c s3:rpc_server: Add samba-dcerpcd helper programs 2021-12-10 14:02:30 +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
srv_pipe_hnd.c smbd: Adapt np_[read|write]_send() to more recent tevent_req conventions 2022-08-26 18:54:37 +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
wscript_build CVE-2022-38023 s3:rpc_server/netlogon: Use dcesrv_netr_creds_server_step_check() 2023-01-09 14:23:36 +00:00