public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dgilbert@interlog.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: linux-scsi@vger.kernel.org,
	"James E.J. Bottomley" <JBottomley@parallels.com>
Subject: Re: [PATCH] sg: fix integer overflow
Date: Fri, 24 Jan 2014 11:36:32 -0500	[thread overview]
Message-ID: <52E29690.4060300@interlog.com> (raw)
In-Reply-To: <alpine.LRH.2.02.1401241131380.12824@file01.intranet.prod.int.rdu2.redhat.com>

On 14-01-24 11:34 AM, Mikulas Patocka wrote:
> On alpha, USER_HZ may be higher than HZ. This results in integer overflow
> in MULDIV.
>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

Acked-by: Douglas Gilbert <dgilbert@interlog.com>

> Cc: stable@vger.kernel.org
>
> ---
>   drivers/scsi/sg.c |    2 ++
>   1 file changed, 2 insertions(+)
>
> Index: linux-3.13/drivers/scsi/sg.c
> ===================================================================
> --- linux-3.13.orig/drivers/scsi/sg.c	2014-01-20 21:44:02.000000000 +0100
> +++ linux-3.13/drivers/scsi/sg.c	2014-01-24 17:28:02.000000000 +0100
> @@ -856,8 +856,10 @@ sg_ioctl(struct file *filp, unsigned int
>   			return result;
>   		if (val < 0)
>   			return -EIO;
> +#if USER_HZ < HZ
>   		if (val >= MULDIV (INT_MAX, USER_HZ, HZ))
>   		    val = MULDIV (INT_MAX, USER_HZ, HZ);
> +#endif
>   		sfp->timeout_user = val;
>   		sfp->timeout = MULDIV (val, HZ, USER_HZ);
>
>


  reply	other threads:[~2014-01-24 16:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-24 16:34 [PATCH] sg: fix integer overflow Mikulas Patocka
2014-01-24 16:36 ` Douglas Gilbert [this message]
2014-01-24 16:56 ` James Bottomley
2014-01-24 17:04   ` Mikulas Patocka
2014-01-24 17:28     ` Mikulas Patocka

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=52E29690.4060300@interlog.com \
    --to=dgilbert@interlog.com \
    --cc=JBottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mpatocka@redhat.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