2003-06-12 06:43:35

by Ravikiran G Thirumalai

[permalink] [raw]
Subject: [patchset] Fix sign handling bugs in 2.5

Here's a patchset to fix sign handling bugs. This is based on Alan's list,
and is mostly a forward port from 2.4

This patchset is for
- sign handling bug in Decnet
- sign handling bug in epca
- sign handling bug in mpt fusion
- sign handling bug in tun
- sign handling bug in aacraid

The following in Alan's list did not need a fix since it is already taken care
of in current bk.
- sign handling bug in mwave

Patches will follow this note. Patches compile, but are not really tested.

Thanks,
Kiran


2003-06-12 06:46:42

by Ravikiran G Thirumalai

[permalink] [raw]
Subject: Re: [patchset] Fix sign handling bugs in 2.5 -- 1/5; Decnet


--- linux-2.5.70/net/decnet/af_decnet.c 2003-05-27 06:30:40.000000000 +0530
+++ signfixes-2.5.70/net/decnet/af_decnet.c 2003-06-10 23:27:45.000000000 +0530
@@ -1227,7 +1227,7 @@
struct sock *sk = sock->sk;
struct dn_scp *scp = DN_SK(sk);
int err = -EOPNOTSUPP;
- unsigned long amount = 0;
+ long amount = 0;
struct sk_buff *skb;
int val;

2003-06-12 06:47:56

by Ravikiran G Thirumalai

[permalink] [raw]
Subject: Re: [patchset] Fix sign handling bugs in 2.5 -- 2/5; epca


--- linux-2.5.70/drivers/char/epca.c Tue May 27 06:30:41 2003
+++ shb-epca-2.5.70/drivers/char/epca.c Wed Jun 11 16:09:43 2003
@@ -3740,7 +3740,7 @@

case 5:
board.port = (unsigned char *)ints[index];
- if (board.port <= 0)
+ if (ints[index] <= 0)
{
printk(KERN_ERR "<Error> - epca_setup: Invalid io port 0x%x\n", (unsigned int)board.port);
invalid_lilo_config = 1;
@@ -3752,7 +3752,7 @@

case 6:
board.membase = (unsigned char *)ints[index];
- if (board.membase <= 0)
+ if (ints[index] <= 0)
{
printk(KERN_ERR "<Error> - epca_setup: Invalid memory base 0x%x\n",(unsigned int)board.membase);
invalid_lilo_config = 1;

2003-06-12 06:51:55

by Ravikiran G Thirumalai

[permalink] [raw]
Subject: Re: [patchset] Fix sign handling bugs in 2.5 -- 4/5; tun


--- linux-2.5.70/drivers/net/tun.c Tue May 27 06:30:39 2003
+++ shb-tun-2.5.70/drivers/net/tun.c Wed Jun 11 16:37:46 2003
@@ -185,7 +185,7 @@
size_t len = count;

if (!(tun->flags & TUN_NO_PI)) {
- if ((len -= sizeof(pi)) < 0)
+ if ((len -= sizeof(pi)) > len)
return -EINVAL;

memcpy_fromiovec((void *)&pi, iv, sizeof(pi));

2003-06-12 06:50:00

by Ravikiran G Thirumalai

[permalink] [raw]
Subject: Re: [patchset] Fix sign handling bugs in 2.5 -- 3/5; mpt fusion

--- linux-2.5.70/drivers/message/fusion/mptbase.c Tue May 27 06:30:26 2003
+++ shb-mpt-2.5.70/drivers/message/fusion/mptbase.c Wed Jun 11 15:11:44 2003
@@ -1822,6 +1822,7 @@
if (this != NULL) {
int sz;
u32 state;
+ int ret;

/* Disable the FW */
state = mpt_GetIocState(this, 1);
@@ -1832,9 +1833,9 @@
if (this->cached_fw != NULL) {
ddlprintk((KERN_INFO MYNAM ": Pushing FW onto adapter\n"));

- if ((state = mpt_downloadboot(this, NO_SLEEP)) < 0) {
+ if ((ret = mpt_downloadboot(this, NO_SLEEP)) < 0) {
printk(KERN_WARNING MYNAM
- ": firmware downloadboot failure (%d)!\n", state);
+ ": firmware downloadboot failure (%d)!\n", ret);
}
}

2003-06-12 06:53:38

by Ravikiran G Thirumalai

[permalink] [raw]
Subject: Re: [patchset] Fix sign handling bugs in 2.5 -- 5/5; aacraid


diff -ruN -X dontdiff linux-2.5.70/drivers/scsi/aacraid/aachba.c shb-aacraid-2.5.70/drivers/scsi/aacraid/aachba.c
--- linux-2.5.70/drivers/scsi/aacraid/aachba.c Tue May 27 06:30:39 2003
+++ shb-aacraid-2.5.70/drivers/scsi/aacraid/aachba.c Wed Jun 11 16:43:17 2003
@@ -229,7 +229,8 @@
int aac_get_containers(struct aac_dev *dev)
{
struct fsa_scsi_hba *fsa_dev_ptr;
- u32 index, status = 0;
+ u32 index;
+ int status = 0;
struct aac_query_mount *dinfo;
struct aac_mount *dresp;
struct fib * fibptr;