A subordination agreement is enforceable in a case under this title to the same extent that such agreement is enforceable under applicable nonbankruptcy law.
For the purpose of distribution under this title, a claim arising from rescission of a purchase or sale of a security of the debtor or of an affiliate of the debtor, for damages arising from the purchase or sale of such a security, or for reimbursement or contribution allowed under section 502 on account of such a claim, shall be subordinated to all claims or interests that are senior to or equal the claim or interest represented by such security, except that if such security is common stock, such claim has the same priority as common stock.
Notwithstanding subsections (a) and (b) of this section, after notice and a hearing, the court may—
under principles of equitable subordination, subordinate for purposes of distribution all or part of an allowed claim to all or part of another allowed claim or all or part of an allowed interest to all or part of another allowed interest; or
order that any lien securing such a subordinated claim be transferred to the estate.
(Pub. L. 95–598, Nov. 6, 1978, 92 Stat. 2586; Pub. L. 98–353, title III, § 451, July 10, 1984, 98 Stat. 375.)