It's only illegal if the mattress isn't secured properly—so you have to tie it tight and drive slowly to make sure it won’t slide.