Analysing Training-Data Leakage from Gradients through Linear Systems and Gradient Matching