We consider the problem of nonlinear convection in horizontal mushy layers during the solidification of binary alloys. We analyse the oscillatory modes of convection in the form of two-and three-dimensional travelling and standing waves. Under a near-eutectic approximation and the limit of large far-field temperature, we determine the solutions to the nonlinear problem by using a perturbation technique, and the stability of two-and three-dimensional solutions in the form of simple travelling waves, general travelling waves and standing waves is investigated. The results of the stability and the nonlinear analyses indicate that supercritical simple travelling rolls are stable over most of the studied range of parameter values, while supercritical standing rolls can be stable only over some small range of parameter values, where the simple travelling rolls are unstable. The results of the investigation of the onset of plume convection and chimney formation leading to the occurrence of freckles in the alloy crystal indicate that the chimney of the plume can be generated internally or near the lower boundary of the mushy layer. The roles of a Stefan number, a permeability parameter and a concentration ratio on the flow instability in both linear and nonlinear regimes are also determined.