Glue river rock to canvas
There are really two aspects to gluing the stones.  One is the glue.  The materials (canvas and stone) are different in almost every way and the canvas is not really a rigid surface, so you will get the most reliable, long-term attachment with a glue that remains flexible and adheres to both kinds of surfaces.  E6000, as suggested by Lyssagal, was the first glue that came to my mind, also.  Regular superglue is brittle and not good for attaching to fabric.  There is a variant that contains rubber particles and is also much more viscous that remains more flexible and might work.  Silicone adhesive is another that might work.  Gorilla glue will also work, but as Buzz notes in a comment, use the type that doesn't expand.

Note though, that if you are gluing to dried paint rather than canvas, some glues may not adhere to it well (the surface texture provides more bonding area, but the glue may not bond well with the paint).

A second problem is that no matter how well the glue bonds with the paint, the stones will be only as secure as the attachment of the paint to the canvas.  Even if the glue bonds with the paint, the stones may eventually fall off with the paint firmly attached to them.  If you want a reliable bond, you need to glue the stones to the canvas, itself.

The best solution would be to sketch the design on the bare canvas to identify the stone locations, then glue the stones to the canvas before you paint.  If painting is already completed, I would suggest creating glue areas for the stones.

Position a stone where it will be glued, then draw an outline on the painted canvas smaller than the stone so it will be completely hidden.  Within that outline, remove as much paint as you can.  How you do that will depend on the type of paint, how thick it is, and how recently it was applied.  After removing as much paint as you can, it might help to scuff the surface within the outline to expose some bare canvas (use a cutout template to protect the paint outside the outline).

But if you are gluing a lot of heavy stones, that kind of weight might cause the canvas to stretch more over time and start to sag.  I would be tempted to glue something rigid to the back of the canvas (like Masonite, thin plywood, or even thick corrugated cardboard), the full size of the stretcher frame opening.