No description
Find a file
Miklos Vajna 85dbb4a9af kit: fix UB in ChildSession::disconnect()
Finally unit-copy-paste passes under sanitizers with this. Details:

==8988==ERROR: AddressSanitizer: heap-use-after-free on address 0x60d0005e6de0 at pc 0x000000988e85 bp 0x7fff753316d0 sp 0x7fff753316c8
READ of size 4 at 0x60d0005e6de0 thread T0 (loolkit)
    #0 0x988e84 in std::pair<int const, UserInfo>::pair(std::pair<int const, UserInfo> const&) /home/vmiklos/git/libreoffice/lode/opt_private/gcc-7.3.0/lib64/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_pair.h:292:17
...
    #12 0x9322af in Document::notifyViewInfo() /home/vmiklos/git/libreoffice/online-san/kit/Kit.cpp:1600:53
    #13 0x9303f9 in Document::onUnload(ChildSession const&) /home/vmiklos/git/libreoffice/online-san/kit/Kit.cpp:1566:13
    #14 0x616dcd in ChildSession::disconnect() /home/vmiklos/git/libreoffice/online-san/kit/ChildSession.cpp:96:25
    #15 0x616535 in ChildSession::~ChildSession() /home/vmiklos/git/libreoffice/online-san/kit/ChildSession.cpp:85:5

freed by thread T0 (loolkit) here:
    #0 0x60f9b0 in operator delete(void*) _asan_rtl_:0
...
    #8 0x939292 in Document::~Document() /home/vmiklos/git/libreoffice/online-san/kit/Kit.cpp:913:5

I.e. when the Document dtor clears Document::_sessions, the ChildSession
dtor may be called. But ChildSession expected that it has a valid
Document during its lifetime, which is not a promise we can hold, see
the above trace.

Fix the problem by having a pointer (and not a reference) to a Document
in ChildSession and then:

1) Clear that Document pointer in ChildSessions at the end of the
Document dtor using a new resetDocManager()

2) Check if the Document is nullptr in ChildSession::disconnect()
instead of dereferencing it unconditionally.

Change-Id: I19d3d6bfe9e142a52c199f49aaa347d1a2edbf87
2019-08-16 09:05:54 +02:00
android android: Load the document only after we've got the permission. 2019-07-23 14:20:25 +02:00
bundled/include/LibreOfficeKit tdf#122529 Support for table overlay - column/row change markers 2019-08-15 05:16:04 +02:00
common common: fix UB in vectorAppend() 2019-08-15 08:38:07 +02:00
debian Use -delete command of find instead of -exec rm 2019-08-10 23:28:56 +02:00
docker Use pkill to kill process instead of killall 2019-06-25 11:35:50 +02:00
etc add the /hosting/capabilities endpoint to the example reverse proxy configs 2018-11-30 13:46:33 +01:00
gtk gtk: fix typo 2019-04-23 09:10:18 +02:00
ios Prevent the user from zooming the WebView 2019-06-11 17:33:48 +03:00
kit kit: fix UB in ChildSession::disconnect() 2019-08-16 09:05:54 +02:00
loleaflet tdf#122529 Support for table overlay - column/row change markers 2019-08-15 05:16:04 +02:00
man
net wsd: Logging corrections 2019-08-05 22:21:54 -04:00
scripts added server uptime field to admin console 2019-07-19 21:14:01 +01:00
test test: avoid ODR violation in UnitCopyPaste 2019-08-14 09:05:23 +02:00
tools tdf#122529 Support for table overlay - column/row change markers 2019-08-15 05:16:04 +02:00
wsd The SavedClipboards stuff presumably makes no sense for MOBILEAPP 2019-08-12 13:20:52 +03:00
.clang-format
.clang-tidy
.gitignore android: Split the actual editing Activity into an own library. 2019-07-12 11:52:56 +02:00
.gitreview git-review: Use the hostname instead of alias. 2019-05-17 14:10:33 +02:00
AUTHORS
autogen.sh Revert "Get rid of use of GNU libtool" and its follow-up 2019-05-27 10:25:51 +03:00
browsersync-config.js Browsersync: Also sync html files 2019-05-20 09:59:45 +02:00
ChangeLog
configure.ac android: Split the actual editing Activity into an own library. 2019-07-12 11:52:56 +02:00
COPYING
discovery.xml Make ODG view-only in discovery.xml 2019-06-22 16:40:01 +02:00
favicon.ico
INSTALL
loolkitconfig.xcu change default HelpRootURL to 'https://help.libreoffice.org/help.html?' 2019-04-23 10:05:05 +02:00
loolstat
loolwsd-systemplate-setup Fix domain name resolution from jail by adding required libs to systemplate 2018-12-02 18:32:34 +01:00
loolwsd.service Revert "Adapt paths to new package name" 2019-05-22 12:06:06 +02:00
loolwsd.spec.in Revert "Adapt paths to new package name" 2019-05-22 12:06:06 +02:00
loolwsd.xml.in Allow Docker's 172.17.0.0/16 subnet in sample (default) net.post_allow.host array 2019-06-24 08:56:14 +02:00
Makefile.am clipboard - set it with a post now. 2019-08-05 21:18:44 -04:00
NEWS
PROBLEMS Tweak problemms. 2019-02-13 18:35:32 +01:00
README
sysconfig.loolwsd

LibreOffice Online.

This project has several components:

wsd/
	The Web Services Daemon - which accepts external connections.

kit/
	The client which lives in its own chroot and renders documents.

common/
	Shared code between these processes.

loleaflet/
	The client side JavaScript component.

It is recommended to read these files:

	wsd/README
	loleaflet/README

Enjoy.