So, I'm not sure if there are any official rules about passing during a race. But two people who passed me yesterday did it wrong.
One guy came up behind me and yelled at me to get out of the way. Before giving me a chance to move, he crashed into my side, bumping into my right handlebar and nearly knocking me over, and then sped off ahead of me.
Another guy came up behind me and screamed at me "I need trail, I need trail, I need trail!!" Unfortunately, I was on a singletrack right next to the side of a ridge, but he really didn't seem to care. I pulled over the best I could and he finally passed by, but, he nearly caused me to fall down the ridge.
I think that passing correctly is one of the challenges of racing and is a skill that must be learned. When you are riding on singletrack, there will be times when you may not have the option to pass someone until there is a trail opening. In the case of these two individuals yesterday, they could have just waited for the trail to open up so that they could pass me. In both of these cases, they could have passed me only a short while up the trail.
In my opinion, people like this kind of ruin the race for everyone, by turning what should be a fun, competitive experience into a death match.