Skip to contentSkip to conversation

sockfd_lookup_light() returns random error for -EBADFD

PATCH Applied Hua Zhong 2 participants 2 messages Apr 19, 2006

Subsystems (3)
lore
Share & tools
lore

Hua Zhong

author
#0 lore raw

PATCH 1/1 sockfd_lookup_light() returns random error for -EBADFD

This applies to 2.6.17-rc2.

There is a missing initialization of err in sockfd_lookup_light() that could return random error for an invalid file handle.

net/socket.c +0 -0
index 23898f4..0ce12df 100644
@@ -490,6 +490,7 @@ static struct socket *sockfd_lookup_ligh
	struct file *file;
	struct socket *sock;
+	*err = -EBADF;
	file = fget_light(fd, fput_needed);
	if (file) {
		sock = sock_from_file(file, err);
maintainer Applied
#1 lore raw

From: Hua Zhong <[email protected]>
Date: Wed, 19 Apr 2006 12:01:06 -0700

Quoted 3 lines

There is a missing initialization of err in sockfd_lookup_light() that could return random error for an invalid file handle.

Applied, thanks a lot for this bug fix.