* swapped memset arguments.
@ 2005-03-22 2:44 Dave Jones
2005-03-23 4:09 ` David S. Miller
2005-03-23 14:20 ` Denis Vlasenko
0 siblings, 2 replies; 3+ messages in thread
From: Dave Jones @ 2005-03-22 2:44 UTC (permalink / raw)
To: netdev
You wouldn't believe how many instances of this bug I've
seen in the last few days in both userspace and kernelspace.
Signed-off-by: Dave Jones <davej@redhat.com>
--- bk-linus/net/ipv4/multipath_wrandom.c~ 2005-03-21 21:40:15.535597104 -0500
+++ bk-linus/net/ipv4/multipath_wrandom.c 2005-03-21 21:40:41.406664104 -0500
@@ -248,7 +248,7 @@ static void wrandom_set_nhinfo(__u32 net
target_route->gw = nh->nh_gw;
target_route->oif = nh->nh_oif;
- memset(&target_route->rcu, sizeof(struct rcu_head), 0);
+ memset(&target_route->rcu, 0, sizeof(struct rcu_head));
INIT_LIST_HEAD(&target_route->dests);
list_add_rcu(&target_route->list, &state[state_idx].head);
@@ -271,7 +271,7 @@ static void wrandom_set_nhinfo(__u32 net
target_dest->network = network;
target_dest->netmask = netmask;
target_dest->prefixlen = prefixlen;
- memset(&target_dest->rcu, sizeof(struct rcu_head), 0);
+ memset(&target_dest->rcu, 0, sizeof(struct rcu_head));
list_add_rcu(&target_dest->list, &target_route->dests);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: swapped memset arguments.
2005-03-22 2:44 swapped memset arguments Dave Jones
@ 2005-03-23 4:09 ` David S. Miller
2005-03-23 14:20 ` Denis Vlasenko
1 sibling, 0 replies; 3+ messages in thread
From: David S. Miller @ 2005-03-23 4:09 UTC (permalink / raw)
To: Dave Jones; +Cc: netdev
On Mon, 21 Mar 2005 21:44:57 -0500
Dave Jones <davej@redhat.com> wrote:
> You wouldn't believe how many instances of this bug I've
> seen in the last few days in both userspace and kernelspace.
Hehe.
> Signed-off-by: Dave Jones <davej@redhat.com>
Applied, thanks Dave.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: swapped memset arguments.
2005-03-22 2:44 swapped memset arguments Dave Jones
2005-03-23 4:09 ` David S. Miller
@ 2005-03-23 14:20 ` Denis Vlasenko
1 sibling, 0 replies; 3+ messages in thread
From: Denis Vlasenko @ 2005-03-23 14:20 UTC (permalink / raw)
To: Dave Jones, Andrew Morton; +Cc: linux-kernel, vital
[-- Attachment #1: Type: text/plain, Size: 1631 bytes --]
On Tuesday 22 March 2005 04:44, Dave Jones wrote:
> You wouldn't believe how many instances of this bug I've
> seen in the last few days in both userspace and kernelspace.
>
> - memset(&target_route->rcu, sizeof(struct rcu_head), 0);
> + memset(&target_route->rcu, 0, sizeof(struct rcu_head));
Hehe.
# grep -r 'memset.*,[ 0x]*)' .
./sound/oss/cmpci.c: memset(buf + bptr, c, x);
./sound/oss/cmpci.c: memset(buf1 + bptr, c, x);
./sound/oss/swarm_cs4297a.c: memset(((char *) buf) + bptr, c, x);
./sound/oss/esssolo1.c: memset(((char *)buf) + bptr, c, x);
./sound/oss/es1370.c: memset(((char *)buf) + bptr, c, x);
./sound/oss/es1371.c: memset(((char *)buf) + bptr, c, x);
./sound/oss/maestro.c: memset(buf + bptr, c, x);
./sound/oss/cs4281/cs4281m.c: memset(((char *) buf) + bptr, c, x);
./sound/oss/maestro3.c: memset(buf + bptr, c, x);
./sound/oss/sonicvibes.c: memset(buf + bptr, c, x);
./sound/oss/ali5455.c: memset(dmabuf->rawbuf + swptr, '\0', x);
./drivers/char/hvcs.c: * 1.3.0 -> 1.3.1 In hvcs_open memset(..,0x00,..) instead of memset(..,0x3F,00).
./drivers/s390/scsi/zfcp_aux.c: memset(sg_list->sg, sg_list->count * sizeof(struct scatterlist), 0);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./Documentation/scsi/ChangeLog.1992-1997: * scsi.c (scan_scsis): memset(SDpnt, 0) and set SCmd.device to SDpnt.
./include/asm-frv/uaccess.h:#define clear_user(dst,count) (memset((dst), 0, (count)), 0)
Patch attached.
--
vda
[-- Attachment #2: zfcp_aux.patch --]
[-- Type: text/x-diff, Size: 501 bytes --]
--- linux-2.6.11.src/drivers/s390/scsi/zfcp_aux.c.orig Thu Feb 3 11:39:40 2005
+++ linux-2.6.11.src/drivers/s390/scsi/zfcp_aux.c Wed Mar 23 16:16:45 2005
@@ -583,7 +583,7 @@ zfcp_sg_list_alloc(struct zfcp_sg_list *
retval = -ENOMEM;
goto out;
}
- memset(sg_list->sg, sg_list->count * sizeof(struct scatterlist), 0);
+ memset(sg_list->sg, 0, sg_list->count * sizeof(struct scatterlist));
for (i = 0, sg = sg_list->sg; i < sg_list->count; i++, sg++) {
sg->length = min(size, PAGE_SIZE);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-03-23 14:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-22 2:44 swapped memset arguments Dave Jones
2005-03-23 4:09 ` David S. Miller
2005-03-23 14:20 ` Denis Vlasenko
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.