PURPOSE: This phase II trial is studying the side effects of panobinostat and to see how well it works in treating patients with relapsed or refractory acute lymphoblastic leukemia or acute myeloid leukemia.