Almost all OS for computer and smartphone are large, complicated programs. Who knows if Windows 10 harvests or doesn't harvest info in some way? Even Ubuntu has grown to gigantic size, and is constantly being upgraded almost on a daily basis. Mac OSX is gigantic, as well.
The Ubuntu source code is available to everyone, right? So I don't think that they will be harvesting the user data. Also, Ubuntu doesn't have the corporate structure of ownership like Windows or Mac OS does. That is why I prefer Ubuntu to keep my data away from the prying eyes of the authorities, when compared to Mac OS and MS Windows.
There are some components of Ubuntu that are closed source, with most of it being drivers. It is also possible for governments to tamper with open source projects to leave subtle exploits wide open. The BIOS of your computer is likely to be closed-source as well, so there may be backdoor exploits in that too.