We consider a cell-free massive multiple-input multiple-output (CF-MaMIMO) communication system in the uplink transmission and propose a novel algorithm for blind or semi-blind joint channel estimation and data detection (JCD). We formulate the problem in the framework of bilinear inference and develop a solution based on the expectation propagation (EP) method for both channel estimation and data detection. We propose a new approximation of the joint a posteriori distribution of the channel and data whose representation as a factor graph enables the application of the EP approach using the message-passing technique, local low-complexity computations at the nodes, and an effective modeling of channel-data interplay. The derived algorithm, called bilinear-EP JCD, allows for a distributed implementation among access points (APs) and the central processing unit (CPU) and has polynomial complexity. Our simulation results show that it outperforms other EP-based state-of-the-art polynomial time algorithms.