public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Mockern@yandex.ru
Cc: linux-kernel@vger.kernel.org
Subject: Re: buffer overflows in the tty flip buffer in 2.6.17
Date: Sat, 17 Feb 2007 14:14:44 +0100	[thread overview]
Message-ID: <45D6FFC4.4030205@gmail.com> (raw)
In-Reply-To: <45D6F52B.000003.10185@webmail19.yandex.ru>

Mockern napsal(a):
> When data is received from the hardware, it needs to be placed into the tty device's flip buffer. This can be done with the following bit of code:
> 

> for (i = 0; i < data_size; ++i) {
>         if (tty->flip.count >= TTY_FLIPBUF_SIZE)
>                 tty_flip_buffer_push(tty);
>         tty_insert_flip_char(tty, data[i], 0);
> }
> tty_flip_buffer_push(tty);

size = tty_buffer_request_room(tty, data_size);
tty_insert_flip_string(tty, data, min(data_size, size));
tty_flip_buffer_push(tty);
+ cope with size < data_size (some data_size -= size with 3 lines above in do {} 
while (data_size))

regards,
-- 
http://www.fi.muni.cz/~xslaby/            Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E

Hnus <hnus@fi.muni.cz> is an alias for /dev/null

  reply	other threads:[~2007-02-17 13:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-17 12:29 buffer overflows in the tty flip buffer in 2.6.17 Mockern
2007-02-17 13:14 ` Jiri Slaby [this message]
2007-02-17 15:17 ` Lennart Sorensen
2007-02-17 15:52   ` Mockern
2007-02-17 16:10     ` Lennart Sorensen
2007-02-19 20:19 ` Alan

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=45D6FFC4.4030205@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=Mockern@yandex.ru \
    --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