Let R be a commutative Noetherian ring. We give criteria for flatness of R-modules in terms of associated primes and torsion-freeness of certain tensor products. This allows us to develop a criterion for regularity if R has characteristic p, or more generally if it has a locally contracting endomorphism. Dualizing, we give criteria for injectivity of R-modules in terms of coassociated primes an...