Index: wp-includes/comment.php
===================================================================
--- wp-includes/comment.php	(revision 20310)
+++ wp-includes/comment.php	(working copy)
@@ -1975,7 +1975,7 @@
 	if ( empty( $posts ) || ! $query->is_singular() || ! get_option( 'close_comments_for_old_posts' ) )
 		return $posts;
 
-	$post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) );
+	$post_types = apply_filters( 'close_comments_for_post_types', array( 'post', 'attachment' ) );
 	if ( ! in_array( $posts[0]->post_type, $post_types ) )
 		return $posts;
 
@@ -1983,7 +1983,12 @@
 	if ( ! $days_old )
 		return $posts;
 
-	if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) ) {
+	$post = $posts[0];
+
+	if ( 'inherit' == $posts[0]->post_status )
+		$post = get_post( $posts[0]->post_parent );
+
+	if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) ) {
 		$posts[0]->comment_status = 'closed';
 		$posts[0]->ping_status = 'closed';
 	}
@@ -2014,10 +2019,13 @@
 
 	$post = get_post($post_id);
 
-	$post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) );
+	$post_types = apply_filters( 'close_comments_for_post_types', array( 'post', 'attachment' ) );
 	if ( ! in_array( $post->post_type, $post_types ) )
 		return $open;
 
+	if ( 'inherit' == get_post_status( $post_id ) )
+		$post = get_post( $post->post_parent );
+
 	if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) )
 		return false;
 
