It ain't the port functions that are the big vunerability. It's the layers on top that call those functions - and the interface between those layer and the implementing applications. A good example is Visual Basic being hooked into all sorts of Windows Apps - like Outlook, etc.
"It turned out Microsoft had purchased the right to use the Berkley Linux code in Windows."
Actually MSFT's UNIX variant was XENIX in cahoots with the original Santa Cruz Operation and it was either System Five of Seven variant.
BSD was a love child of Bekeley students/profs and they went in material numbers to create Solaris.