From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Horms <horms@verge.net.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix sign checks in copy_from_read_buf() in 2.4
Date: Wed, 23 Mar 2005 05:49:31 -0300 [thread overview]
Message-ID: <20050323084931.GA4017@logos.cnet> (raw)
In-Reply-To: <20050323074931.GA3092@verge.net.au>
Hi Horms,
On Wed, Mar 23, 2005 at 04:49:35PM +0900, Horms wrote:
> Applologies if this is already pending, but the signdness fix for
> copy_from_read_buf() in 2.6 seems to be needed for 2.4 as well.
>
> This relates to the bugs reported in this document
> http://www.guninski.com/where_do_you_want_billg_to_go_today_3.html
v2.4 does not suffer from the issue mentioned by Guninski because
the first argument of the arithmetic comparison is not casted
to a "signed" value:
n = min((ssize_t)*nr, n);
That was the problem in v2.6, where an unsigned value bigger than 2^31
would be treated as a negative signed.
Thanks anyway for pinging me, highly appreciated.
> --
> Horms
>
> Backport of copy_from_read_buf() signedness fix from 2.6
>
> Signed-off-by: Simon Horman <horms@verge.net.au>
>
> ===== drivers/char/n_tty.c 1.7 vs edited =====
> --- 1.7/drivers/char/n_tty.c 2004-12-16 22:57:23 +09:00
> +++ edited/drivers/char/n_tty.c 2005-03-23 13:08:37 +09:00
> @@ -1095,7 +1095,7 @@
>
> {
> int retval;
> - ssize_t n;
> + size_t n;
> unsigned long flags;
>
> retval = 0;
prev parent reply other threads:[~2005-03-23 15:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-23 7:49 [PATCH] Fix sign checks in copy_from_read_buf() in 2.4 Horms
2005-03-23 8:49 ` Marcelo Tosatti [this message]
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=20050323084931.GA4017@logos.cnet \
--to=marcelo.tosatti@cyclades.com \
--cc=horms@verge.net.au \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.