Earlier quoted context omitted.
In the US, you're fine. The laws that exist barring possession of information largely revolve around copyright, CSAM, or classified information (only relevant if you have a clearance), and none of those really apply here.
Source code is copyrighted surely? You can't share ebooks just because the "source" is open and visible, copyright applies to all creative works.
Since copyright law favors encouraging scholarship, research, education, and commentary, a judge is more likely to make a determination of fair use if the defendant's use is noncommercial, educational, scientific, or historical.