From: "Salyzyn, Mark" <mark_salyzyn@adaptec.com>
To: "Meelis Roos" <mroos@linux.ee>,
"Linux Kernel list" <linux-kernel@vger.kernel.org>
Subject: RE: integer overflow in i2o_block
Date: Thu, 26 Jul 2007 16:48:39 -0400 [thread overview]
Message-ID: <AE4F746F2AECFC4DA4AADD66A1DFEF01C5B32D@otce2k301.adaptec.com> (raw)
In-Reply-To: <Pine.SOC.4.64.0707262322240.7082@math.ut.ee>
I would change tid from an int to an unsigned instead, he is the culprit
that is promoting the unsigned to an signed.
Sincerely -- Mark Salyzyn
> -----Original Message-----
> From: linux-kernel-owner@vger.kernel.org
> [mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Meelis Roos
> Sent: Thursday, July 26, 2007 4:30 PM
> To: Linux Kernel list
> Subject: integer overflow in i2o_block
>
>
> Got this warning on 32-bit ppc, seems real? And it seems I2O
> subsystem has no maintainer (only DPT_I2O has one)?
>
> CC [M] drivers/message/i2o/i2o_block.o
> drivers/message/i2o/i2o_block.c: In function 'i2o_block_transfer':
> drivers/message/i2o/i2o_block.c:837: warning: integer
> overflow in expression
>
> The line in question is
> msg->u.head[1] = cpu_to_le32(I2O_CMD_PRIVATE << 24 | HOST_TID
> << 12 | tid);
> and I2O_CMD_PRIVATE is defined as 0xFF. This gets "0xFF0100 |
> tid" and
> fits into 32-bit unsigned but not into 32-bit signed integer properly.
> Target value head[*] is defined as u32 so the claculation
> does not fit
> during computation? Should we mark the shiftable inputas as unsigned?
>
> --
> Meelis Roos (mroos@linux.ee)
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
next prev parent reply other threads:[~2007-07-26 20:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-26 20:30 Meelis Roos
2007-07-26 20:48 ` Salyzyn, Mark [this message]
2007-07-27 15:45 ` [PATCH] fix integer overflow warning " Meelis Roos
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=AE4F746F2AECFC4DA4AADD66A1DFEF01C5B32D@otce2k301.adaptec.com \
--to=mark_salyzyn@adaptec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mroos@linux.ee \
/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®