Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fa8705b00aeca19d91a1437b8a5cf865999b28f6 Commit: fa8705b00aeca19d91a1437b8a5cf865999b28f6 Parent: 414c66e00e9fb4572e38bd14e6cc570eae8c5a61 Author: Tony Battersby <[EMAIL PROTECTED]> AuthorDate: Wed Oct 10 21:09:04 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Wed Oct 10 21:09:04 2007 -0700
[NET]: sanitize kernel_accept() error path If kernel_accept() returns an error, it may pass back a pointer to freed memory (which the caller should ignore). Make it pass back NULL instead for better safety. Signed-off-by: Tony Battersby <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- net/socket.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/net/socket.c b/net/socket.c index d233647..379b3a3 100644 --- a/net/socket.c +++ b/net/socket.c @@ -2235,6 +2235,7 @@ int kernel_accept(struct socket *sock, struct socket **newsock, int flags) err = sock->ops->accept(sock, *newsock, flags); if (err < 0) { sock_release(*newsock); + *newsock = NULL; goto done; } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html