How to query all Chatter Files attached to a record?
On second though, use the LinkedEntityId field on ContentDocumentLink:
SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = '[RECORD ID]'
I believe that the FeedItem object is what you are looking for. Chatter posts with a file attachment will be of type "ContentPost", so I would try this for gathering all files for a particular record id:
SELECT ContentFileName FROM FeedItem WHERE Type = 'ContentPost' AND ParentId = '[RECORD_ID]'