The 21-year-old Senegal international suffered an injury during training before the 1-1 draw with Aston Villa on Sunday.
Following the injury, Diarra underwent the operation on Monday to address the issue.
This setback comes after Diarra joined Sunderland from Strasbourg over the summer.