You don’t even have to give up your DNA. Your 5th cousin thrice removed could submit his DNA and it will point back to you, since you both carry some marker that only .000001% of the population have.
That’s how they identified the Golden State Killer. Some distant relative submitted DNA just for fun. After that the guy was arrested after decades of searching.
Interesting that the killer abruptly stopped killing immediately after the DNA technology was discovered.