Last.fm privacy policy:
"Certain third parties may have access to your data (which may include personal information, but not your email contact information) via our API and webservices or arrangements with our business partners. These people may use this information for their own purposes, which may be either commercial or non-commercial in nature and may include targeted advertising or direct marketing. These third parties may be based in the U.K. or elsewhere in the world."
"Your pseudonymous listening habit data will be available to other Last.fm users for non-commercial use and to third parties via our API for their own commercial and/or non-commercial purposes. This statistical information is used to help third parties understand the likes and dislikes of music fans on Last.fm."
"We log certain information concerning the listening, skipping and music-sharing activities of users and other activities whilst they use the Website, and we may match such information with personally identifiable information concerning such users. For example, it is possible for us to know which records you listen to, which you skip, which you recommend to other users and which you add to your record collection. However, information related to your listening, skipping and music-sharing activities may be viewed by all other users (who may include other organisations or representatives of other organisations who have registered as Last.fm users) in conjunction with your Last.fm username and by third parties who have access to this information via Last.fm’s API and webservices, as further explained in this Policy.
Please note that we do log and use statistical information in the aggregate. For example, we know the number of users who skip a particular song. From this information we are able to compile statistics in the form of percentages of all users (i.e. 29% of our users skipped song XYZ). We can of course compare the skipping statistics of one song to those of another song. We are also able to perform more sophisticated statistical operations based on the information collected. For example, we can determine the raw number (and associated percentages) of users who listen to one particular song that also listen to other particular songs. From this information, we are able to determine which songs are “neighbours” in terms of overall listener taste and we can see which genres of music tend to be neighbours. As a service, we may supply certain aggregate statistical information to record labels and artists that allow us to stream their music on Last.fm in order to help them understand the likes and dislikes of music listeners."
Regarding your IP, it says they collect the information but it doesn't say if they share the information or not
"We collect data regarding the users of Last.fm, including: (i) The Internet Protocol (IP) address of the user’s computer. This may or may not be associated with a particular Internet Service Provider (ISP); (ii) The referring URL, if any; (iii) The browser software identification (i.e. the brand and version of your browser software)."
there's no proof thus far that Last.fm has released information that could link you to the data they collect.