  Let $p$ be an odd prime. We state characteristic $p$ analogues of the
Mumford--Tate conjecture and the Andr\'e--Oort conjecture for ordinary strata
of mod $p$ Shimura varieties. We prove the conjectures for arbitrary products
of GSpin Shimura varieties (and their subvarieties). Important subvarieties of
GSpin Shimura varieties include modular and Shimura curves, Hilbert modular
surfaces, $\mathrm{U}(1,n)$ unitary Shimura varieties, and moduli spaces of
principally polarized Abelian and K3 surfaces. The two conjectures are both
related to a notion of linearity for mod $p$ Shimura varieties, about which
Chai has formulated the Tate-linear conjecture. Though seemingly different, the
three conjectures are intricately entangled. We will first solve the
Tate-linear conjecture for single GSpin Shimura varieties, above which we build
the proof of the Tate-linear conjecture and the characteristic $p$ analogue of
the Mumford--Tate conjecture for products of GSpin Shimura varieties. We then
use the Tate-linear and the characteristic $p$ analogue of the Mumford--Tate
conjectures to prove the characteristic $p$ analogue of the Andr\'e--Oort
conjecture. Our proof uses Chai's results on monodromy of $p$-divisible groups
and rigidity theorems for formal tori, as well as Crew's parabolicity
conjecture which is recently proven by D'Addezio.
