There is terminological confusion. Several things are colloquially called ‘masks’. Surgical masks do not significantly protect the wearer. Filtering facepiece respirators do.¹ ² The parent comment's links refer to N95, so they mean the latter, which are protective (assuming they're worn properly and genuine³).
In addition, the permanent rubber units provide protection when fitted with suitable filters; NIOSH calls these half masks (as distinct from full facepieces, colloquially ‘gas masks’). Where I am, these are still languishing on the shelves⁴, which means that the sort of people who are willing to spend five minutes looking up that P95 ≥ N95 are not yet panicking.