If you don't want to unlock your bootloader, the only way to root is downgrading to 4.1 and then using the root before update script I made. Otherwise you just unlock your bootloader and install CWM recovery, from CWM you flash SuperSU update package and you're done.
Jus keep in mind that by unlocking your bootloader you will void your warranty and your DRM keys will be wiped (some proprietary Sony apps will stop working without these keys)...
Sony Xperia M dual [C2004]
ROM: 15.5.A.1.5 (stock)
Android version: 4.3 (rooted)
Bootloader: locked (unlockable)