Skip to contentSkip to conversation

Make sure sockets implement splice_read

PATCH Applied Rémi Denis-Courmont 3 participants 5 messages Feb 14, 2008 – Feb 15, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make sure sockets implement splice_read

Fixes a segmentation fault when trying to splice from a non-TCP socket.

---
 net/socket.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
net/socket.c +3 -0
index 7651de0..b6d35cd 100644
@@ -701,6 +701,9 @@ static ssize_t sock_splice_read(struct file *file, loff_t *ppos,
 {
 	struct socket *sock = file->private_data;
 
+	if (unlikely(!sock->ops->splice_read))
+		return -EINVAL;
+
 	return sock->ops->splice_read(sock, ppos, pipe, len, flags);
 }
 
Signature · 1 line
1.5.4.1
#3 lore raw

Le Friday 15 February 2008 18:30:11 Andi Kleen, vous avez écrit :

Quoted 11 lines
Quoted 8 lines · David Miller

From: Rémi_Denis-Courmont <[email protected]>
Date: Thu, 14 Feb 2008 18:53:34 +0200

Quoted 3 lines

Fixes a segmentation fault when trying to splice from a non-TCP socket.

Applied, thank you.

That's also a stable candidate, isn't it?

Should go to 2.6.25-rc2, but the offending code is not in any stable release.

Signature · 2 lines
Rémi Denis-Courmont
http://www.remlab.net/
#4 lore raw
Quoted 7 lines · Rémi Denis-Courmont

Le Friday 15 February 2008 18:30:11 Andi Kleen, vous avez écrit :

Quoted 6 lines
Quoted 5 lines · David Miller

From: Rémi_Denis-Courmont <[email protected]>
Date: Thu, 14 Feb 2008 18:53:34 +0200

Quoted 2 lines

Fixes a segmentation fault when trying to splice from a non-TCP socket.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Applied, thank you.

That's also a stable candidate, isn't it?

Should go to 2.6.25-rc2, but the offending code is not in any stable release.

You're right. I misinterpreted git describe output for this one. Sorry.

-Andi