28 U.S. Code § 2255 - Federal custody; remedies on motion attacking sentence
A prisoner in custody under sentence of a court established by Act of Congress claiming the right to be released upon the ground that the sentence was imposed in violation of the Constitution or laws of the United States, or that the court was without jurisdiction to impose such sentence, or that the sentence was in excess of the maximum authorized by law, or is otherwise subject to collateral attack, may move the court which imposed the sentence to vacate, set aside or correct the sentence.
Unless the motion and the files and records of the case conclusively show that the prisoner is entitled to no relief, the court shall cause notice thereof to be served upon the United States attorney, grant a prompt hearing thereon, determine the issues and make findings of fact and conclusions of law with respect thereto. If the court finds that the judgment was rendered without jurisdiction, or that the sentence imposed was not authorized by law or otherwise open to collateral attack, or that there has been such a denial or infringement of the constitutional rights of the prisoner as to render the judgment vulnerable to collateral attack, the court shall vacate and set the judgment aside and shall discharge the prisoner or resentence him or grant a new trial or correct the sentence as may appear appropriate.
A court may entertain and determine such motion without requiring the production of the prisoner at the hearing.
An appeal may be taken to the court of appeals from the order entered on the motion as from a final judgment on application for a writ of habeas corpus.
An application for a writ of habeas corpus in behalf of a prisoner who is authorized to apply for relief by motion pursuant to this section, shall not be entertained if it appears that the applicant has failed to apply for relief, by motion, to the court which sentenced him, or that such court has denied him relief, unless it also appears that the remedy by motion is inadequate or ineffective to test the legality of his detention.
In a habeas corpus proceeding or a proceeding under section 2255 before a district judge, the final order shall be subject to review, on appeal, by the court of appeals for the circuit in which the proceeding is held.
There shall be no right of appeal from a final order in a proceeding to test the validity of a warrant to remove to another district or place for commitment or trial a person charged with a criminal offense against the United States, or to test the validity of such person’s detention pending removal proceedings.
(A) the final order in a habeas corpus proceeding in which the deten tion complained of arises out of process issued by a State court; or
(2) A certificate of appealability may issue under paragraph (1) only if the applicant has made a substantial showing of the denial of a constitutional right.