public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 9p bug fix: return non-zero error value in p9_put_data
@ 2008-08-26 17:30 Abhishek Kulkarni
  2008-08-26 18:53 ` [V9fs-developer] " Latchesar Ionkov
  2008-08-28 18:10 ` Eric Van Hensbergen
  0 siblings, 2 replies; 6+ messages in thread
From: Abhishek Kulkarni @ 2008-08-26 17:30 UTC (permalink / raw)
  To: v9fs-developer; +Cc: linux-kernel, ericvh

p9_put_data is called by p9_create_twrite which expects it to return a
non-zero value on error. This was the reason why every p9_client_write
was failing. This patch also adds a check for buffer overflow in
p9_put_data.

Signed-off-by: Abhishek Kulkarni <kulkarni@lanl.gov>
---
 net/9p/conv.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/net/9p/conv.c b/net/9p/conv.c
index 4454720..7f6db15 100644
--- a/net/9p/conv.c
+++ b/net/9p/conv.c
@@ -451,8 +451,11 @@ p9_put_data(struct cbuf *bufp, const char *data,
int count,
 		   unsigned char **pdata)
 {
 	*pdata = buf_alloc(bufp, count);
+	if (buf_check_overflow(bufp))
+		return -EIO;
+
 	memmove(*pdata, data, count);
-	return count;
+	return 0;
 }
 
 static int


Thanks,
 -- Abhishek


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-09-23 20:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-26 17:30 [PATCH] 9p bug fix: return non-zero error value in p9_put_data Abhishek Kulkarni
2008-08-26 18:53 ` [V9fs-developer] " Latchesar Ionkov
2008-08-28 18:10 ` Eric Van Hensbergen
2008-08-28 18:35   ` Abhishek Kulkarni
2008-09-02 19:04     ` Abhishek Kulkarni
2008-09-23 20:33       ` Eric Van Hensbergen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox