From: David Miller <davem@davemloft.net>
To: xi.wang@gmail.com
Cc: linux-hams@vger.kernel.org, netdev@vger.kernel.org, ralf@linux-mips.org
Subject: Re: [PATCH -next] ax25: avoid overflows in ax25_setsockopt()
Date: Wed, 28 Dec 2011 14:08:19 -0500 (EST) [thread overview]
Message-ID: <20111228.140819.861154490395622829.davem@davemloft.net> (raw)
In-Reply-To: <1325014999-28931-1-git-send-email-xi.wang@gmail.com>
From: Xi Wang <xi.wang@gmail.com>
Date: Tue, 27 Dec 2011 14:43:19 -0500
> Commit be639ac6 ("NET: AX.25: Check ioctl arguments to avoid overflows
> further down the road") rejects very large arguments, but doesn't
> completely fix overflows on 64-bit systems. Consider the AX25_T2 case.
>
> int opt;
> ...
> if (opt < 1 || opt > ULONG_MAX / HZ) {
> res = -EINVAL;
> break;
> }
> ax25->t2 = opt * HZ;
>
> The 32-bit multiplication opt * HZ would overflow before being assigned
> to 64-bit ax25->t2. This patch changes "opt" to unsigned long.
>
> Signed-off-by: Xi Wang <xi.wang@gmail.com>
> Cc: Ralf Baechle <ralf@linux-mips.org>
Applied.
prev parent reply other threads:[~2011-12-28 19:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-27 19:43 [PATCH -next] ax25: avoid overflows in ax25_setsockopt() Xi Wang
2011-12-28 19:08 ` David Miller [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=20111228.140819.861154490395622829.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=linux-hams@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ralf@linux-mips.org \
--cc=xi.wang@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).