I an in a situation that makes no sense. it shouldnt matter because im still getting paid. Im just wondering if the people im working for is really legal.

i am a contractor. i sell my body to the highest bidder.
company A called me and ask if they could submit me for a job opening. I agreed.
company A called me and said that i had a phone interview with the top dog of the client. the interview wemt well and the top dog said he would contact company B and inform them they wanted me. I asked who company B was. i was told the people who submitted me.
company A called me and said it was a go. they set up all the pre employment crap. I went to the office (unexpected). i just happen to like to meet my employers and was told everything would be handled from a guy that is not from the area. head scratching time,
I get an e-mail with an employment contract from company B. ok i signed it and sent it back. I get a benefits package from company A. My pays are deposited from company A's account. apparently company A has no contract with the client. they are half owners of company B. company B does have a contract. My question is who do i really work for? company A or B. It looks like i work for company A because they pay me. Is the employment contract i signed with company B really worth the paper its written on?

Just curious. this is a first