* [PATCH] Make sure sockets implement splice_read
@ 2008-02-14 16:53 Rémi Denis-Courmont
2008-02-15 10:36 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Rémi Denis-Courmont @ 2008-02-14 16:53 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Fixes a segmentation fault when trying to splice from a non-TCP socket.
Signed-off-by: Rémi Denis-Courmont <rdenis@simphalempin.com>
---
net/socket.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/socket.c b/net/socket.c
index 7651de0..b6d35cd 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -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);
}
--
1.5.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Make sure sockets implement splice_read
2008-02-14 16:53 [PATCH] Make sure sockets implement splice_read Rémi Denis-Courmont
@ 2008-02-15 10:36 ` David Miller
2008-02-15 16:30 ` Andi Kleen
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2008-02-15 10:36 UTC (permalink / raw)
To: rdenis; +Cc: netdev
From: Rémi_Denis-Courmont <rdenis@simphalempin.com>
Date: Thu, 14 Feb 2008 18:53:34 +0200
> Fixes a segmentation fault when trying to splice from a non-TCP socket.
>
> Signed-off-by: Rémi Denis-Courmont <rdenis@simphalempin.com>
Applied, thank you.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Make sure sockets implement splice_read
2008-02-15 10:36 ` David Miller
@ 2008-02-15 16:30 ` Andi Kleen
2008-02-15 16:40 ` Rémi Denis-Courmont
0 siblings, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2008-02-15 16:30 UTC (permalink / raw)
To: David Miller; +Cc: rdenis, netdev
David Miller <davem@davemloft.net> writes:
> From: Rémi_Denis-Courmont <rdenis@simphalempin.com>
> Date: Thu, 14 Feb 2008 18:53:34 +0200
>
>> Fixes a segmentation fault when trying to splice from a non-TCP socket.
>>
>> Signed-off-by: Rémi Denis-Courmont <rdenis@simphalempin.com>
>
> Applied, thank you.
That's also a stable candidate, isn't it?
-Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Make sure sockets implement splice_read
2008-02-15 16:30 ` Andi Kleen
@ 2008-02-15 16:40 ` Rémi Denis-Courmont
2008-02-15 16:46 ` Andi Kleen
0 siblings, 1 reply; 5+ messages in thread
From: Rémi Denis-Courmont @ 2008-02-15 16:40 UTC (permalink / raw)
To: Andi Kleen; +Cc: David Miller, netdev
Le Friday 15 February 2008 18:30:11 Andi Kleen, vous avez écrit :
> David Miller <davem@davemloft.net> writes:
> > From: Rémi_Denis-Courmont <rdenis@simphalempin.com>
> > Date: Thu, 14 Feb 2008 18:53:34 +0200
> >
> >> Fixes a segmentation fault when trying to splice from a non-TCP socket.
> >>
> >> Signed-off-by: Rémi Denis-Courmont <rdenis@simphalempin.com>
> >
> > 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.
--
Rémi Denis-Courmont
http://www.remlab.net/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Make sure sockets implement splice_read
2008-02-15 16:40 ` Rémi Denis-Courmont
@ 2008-02-15 16:46 ` Andi Kleen
0 siblings, 0 replies; 5+ messages in thread
From: Andi Kleen @ 2008-02-15 16:46 UTC (permalink / raw)
To: Rémi Denis-Courmont; +Cc: Andi Kleen, David Miller, netdev
Rémi Denis-Courmont <rdenis@simphalempin.com> writes:
> Le Friday 15 February 2008 18:30:11 Andi Kleen, vous avez écrit :
>> David Miller <davem@davemloft.net> writes:
>> > From: Rémi_Denis-Courmont <rdenis@simphalempin.com>
>> > Date: Thu, 14 Feb 2008 18:53:34 +0200
>> >
>> >> Fixes a segmentation fault when trying to splice from a non-TCP socket.
>> >>
>> >> Signed-off-by: Rémi Denis-Courmont <rdenis@simphalempin.com>
>> >
>> > 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-02-15 16:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-14 16:53 [PATCH] Make sure sockets implement splice_read Rémi Denis-Courmont
2008-02-15 10:36 ` David Miller
2008-02-15 16:30 ` Andi Kleen
2008-02-15 16:40 ` Rémi Denis-Courmont
2008-02-15 16:46 ` Andi Kleen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).