  We study with particle-in-cell (PIC) simulations the stability of fast
magnetosonic shocks. They expand across a collisionless plasma and an
orthogonal magnetic field that is aligned with one of the directions resolved
by the 2D simulations. The shock speed is 1.6 times the fast magnetosonic speed
when it enters a layer with a reduced density of mobile ions, which decreases
the shock speed by up to 15\% in 1D simulations. In the 2D simulations, the
density of mobile ions in the layer varies sinusoidally perpendicularly to the
shock normal. We resolve one sine period. This variation only leads to small
changes in the shock speed evidencing a restoring force that opposes a shock
deformation. As the shock propagates through the layer, the ion density becomes
increasingly spatially modulated along the shock front and the magnetic field
bulges out where the mobile ion density is lowest. The perturbed shock
eventually reaches a steady state. Once it leaves the layer, the perturbations
of the ion density and magnetic field oscillate along its front at a frequency
close to the lower-hybrid frequency; the shock is mediated by a standing wave
composed of obliquely propagating lower-hybrid waves. We perform three 2D
simulations with different box lengths along the shock front. The shock front
oscillations are aperiodically damped in the smallest box with the fastest
variation of the ion density, strongly damped in the intermediate one, and
weakly damped in the largest box. The shock front oscillations perturb the
magnetic field in a spatial interval that extends by several electron skin
depths upstream and downstream of the shock front and could give rise to
Whistler waves that propagate along the shock's magnetic field overshoot.
Similar waves were observed in hybrid and PIC simulations and by the MMS
satellite mission.
