A small amount of work will show that squaring the expression above gives:
$$(m_1-m_2)(m_1+m_2)(2km_1^2 m_2^2-k (m_2^2+m_1^2)+m_1^2+m_2^2-2) = 0.$$ Two solutions are obvious (and presumably uninteresting): $m_2 = \pm m_1$. The other two are also straightforward (assuming I haven't made a mistake): $$m_2 = \pm \sqrt{\frac{1+\frac{k-1}{2} m_1^2}{k m_1^2+\frac{1-k}{2}}}.$$ The original equation rules out the negative solutions.