The Linux kernel's source code is freely and publicly available on Kernel.org . Past/Previous versions can be found on their website. Kernel.org offers four ways of obtaining the source code.
Linus Torvalds has a GitHub account where he has the latest code - https://github.com/torvalds/linux. Kernel.org hosts the kernels, but GitHub has the developing kernel.