Skip to content

Commit

Permalink
Revert "net/rds: Avoid potential use after free in rds_send_remove_fr…
Browse files Browse the repository at this point in the history
…om_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 <[email protected]>
Cc: Santosh Shilimkar <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed Apr 24, 2021
1 parent 8db5efb commit 799bac5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion net/rds/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ void rds_message_put(struct rds_message *rm)
rds_message_purge(rm);

kfree(rm);
rm = NULL;
}
}
EXPORT_SYMBOL_GPL(rds_message_put);
Expand Down
2 changes: 1 addition & 1 deletion net/rds/send.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ static void rds_send_remove_from_sock(struct list_head *messages, int status)
unlock_and_drop:
spin_unlock_irqrestore(&rm->m_rs_lock, flags);
rds_message_put(rm);
if (was_on_sock && rm)
if (was_on_sock)
rds_message_put(rm);
}

Expand Down

0 comments on commit 799bac5

Please sign in to comment.