This is not possible.
Smart objects can only be used as clipping masks (Option/Alt-clicking between layers). Smart objects can not be used as any other form of mask. Masks must consist of pixels or paths and nothing more complex than that.
However.. if some raster content is okay.....
Assumptions:
- The X layer Smart Object can not be edited in any way.
- raster masks are okay
Image is RGB
- Move the red layer above the X.
- Set blend mode of red layer to "Lighten"
- Highlight the X layer
- Layer > Adjustment Layer > Invert..
- Highlight the X layer and the Adjustment layer
- Right/control-click on highlighted layers > Convert to Smart Object
- Option/alt click between the two layers you now have.
- Highlight the X layer
- Command/Ctrl-click the Blue Channel
- Layer > Layer Mask > Hide Selection
Final image:

Zoomed to show edges:

Steps 3 through 6 could be replaced by simply editing the X smart object so it's inverted.
Conversely, you could simply highlight the X layer, Command/Ctrl-click the Blue Channel. Inverse the selection and apply a mask to the red layer. Then turn off the X Smart Object visibility. This provides a much easier file to work with.
I'm not clear as to why you need to use the smart object to mask anything. If you need a red X why not simply create a red x?