Accurate channel estimation is essential to achieve the performance gains promised by the use of reconfigurable intelligent surfaces (RISs) in wireless communications. In the uplink of multi-user orthogonal frequency division multiple access (OFDMA) systems, synchronization errors such as carrier frequency offsets (CFOs) can significantly degrade the channel estimation performance. This becomes more critical in RIS-aided communications, as even a small channel estimation error leads to a significant performance loss. Motivated by this, we propose a joint CFO and channel estimation method for RIS-aided multi-user massive multiple-input multiple-output (MIMO) systems. Our proposed pilot structure allows accurate estimation of the CFOs without multi-user interference (MUI), using the same pilot resources for both CFO estimation and channel estimation. For joint estimation of multiple users' CFOs, a correlation-based approach is devised using the received signals at all BS antennas. Using least-squares (LS) estimation with the obtained CFO values, the channels of all users are jointly estimated. For optimization of the RIS phase shifts at the data transmission stage, we propose a projected gradient method (PGM). Simulation results demonstrate that the proposed method provides an improvement in the normalized mean-square error (NMSE) of channel estimation as well as in the bit error rate (BER) performance.