It's not socialism. Many of the world's jurisdictions operate under a system where when you buy property, you buy the use of the surface (and its depths to a certain extent) for your purposes, but the rights to exploit minerals (and oil or natural gaz) is a separate contract (Land claim) because the State (used in a very broad sense) has rights on them.
The State can decide to form government-owned corporations and use the profits (which would be socialistic) or give out or sell the rights to a private entity who would better be able to exploit the deposits in exchange for royalties (such as in Alaska).
What the State then does with the royalty money will determine if it is socialistic. If they give it back to the people in equal shares, it is not very socialistic IMO. If you give it in unequal shares where poorer people receive a greater stake or invest in high quality infrastructure (schools, Universities, research, hospitals) that will benefit all citizens, that is socialist. The latter (infrastructure) is my prefered solution.







