Skip to content

Commit 799bac5

Browse files
committed
Revert "net/rds: Avoid potential use after free in rds_send_remove_from_sock"
This reverts commit 0c85a7e. The games with 'rm' are on (two separate instances) of a local variable, and make no difference. Quoting Aditya Pakki: "I was the author of the patch and it was the cause of the giant UMN revert. The patch is garbage and I was unaware of the steps involved in retracting it. I *believed* the maintainers would pull it, given it was already under Greg's list. The patch does not introduce any bugs but is pointless and is stupid. I accept my incompetence and for not requesting a revert earlier." Link: https://lwn.net/Articles/854319/ Requested-by: Aditya Pakki <pakki001@umn.edu> Cc: Santosh Shilimkar <santosh.shilimkar@oracle.com> Cc: David S. Miller <davem@davemloft.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8db5efb commit 799bac5

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

net/rds/message.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ void rds_message_put(struct rds_message *rm)
180180
rds_message_purge(rm);
181181

182182
kfree(rm);
183-
rm = NULL;
184183
}
185184
}
186185
EXPORT_SYMBOL_GPL(rds_message_put);

net/rds/send.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ static void rds_send_remove_from_sock(struct list_head *messages, int status)
665665
unlock_and_drop:
666666
spin_unlock_irqrestore(&rm->m_rs_lock, flags);
667667
rds_message_put(rm);
668-
if (was_on_sock && rm)
668+
if (was_on_sock)
669669
rds_message_put(rm);
670670
}
671671

0 commit comments

Comments
 (0)