From: Jeff Dike <jdike@addtoit.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, blaisorblade_spam@yahoo.it
Subject: [PATCH] UML - Don't trash return value
Date: Wed, 22 Sep 2004 22:26:32 -0400 [thread overview]
Message-ID: <200409230226.i8N2QWiF004303@ccure.user-mode-linux.org> (raw)
From: Doug Dumitru <doug@easyco.com>
I have been fighting a buffering error when sending large amounts of
data out pty devices from UML. I have tried a couple of patches that
did not really fix the problem (and were rightly rejected by the group),
but have finally found the real bug.
In /arch/um/drivers/line.c there is a function "buffer_data" that is
responsible for storing data into the lines ring buffer. The function
is "supposed" to return the number of characters actually buffered.
Unfortunately, in the case where the buffer wraps, the "len" variable is
decremented by "end" before it is used as the return parameter.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Index: linux-2.6.9-rc2-mm1-orig/arch/um/drivers/line.c
===================================================================
--- linux-2.6.9-rc2-mm1-orig.orig/arch/um/drivers/line.c 2004-09-22 20:39:58.000000000 -0400
+++ linux-2.6.9-rc2-mm1-orig/arch/um/drivers/line.c 2004-09-22 20:55:34.000000000 -0400
@@ -73,9 +73,8 @@
else {
memcpy(line->tail, buf, end);
buf += end;
- len -= end;
- memcpy(line->buffer, buf, len);
- line->tail = line->buffer + len;
+ memcpy(line->buffer, buf, len - end);
+ line->tail = line->buffer + len - end;
}
return(len);
reply other threads:[~2004-09-23 1:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200409230226.i8N2QWiF004303@ccure.user-mode-linux.org \
--to=jdike@addtoit.com \
--cc=akpm@osdl.org \
--cc=blaisorblade_spam@yahoo.it \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®