All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] fddi: 64 bit bug in smt_add_para()
@ 2012-09-01 19:57 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2012-09-01 19:57 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, kernel-janitors

The intent was to set 4 bytes of data so that's why the sp_len is set
to 4 on the next line.  The cast to u_long pointer clears 8 bytes
on 64 bit arches.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Code auditing work.  I don't have this hardware.  This bug is old.

diff --git a/drivers/net/fddi/skfp/pmf.c b/drivers/net/fddi/skfp/pmf.c
index 24d8566..441b4dc 100644
--- a/drivers/net/fddi/skfp/pmf.c
+++ b/drivers/net/fddi/skfp/pmf.c
@@ -673,7 +673,7 @@ void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para,
 			sm_pm_get_ls(smc,port_to_mib(smc,port))) ;
 		break ;
 	case SMT_P_REASON :
-		* (u_long *) to = 0 ;
+		*(u32 *)to = 0 ;
 		sp_len = 4 ;
 		goto sp_done ;
 	case SMT_P1033 :			/* time stamp */

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch] fddi: 64 bit bug in smt_add_para()
@ 2012-09-01 19:57 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2012-09-01 19:57 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, kernel-janitors

The intent was to set 4 bytes of data so that's why the sp_len is set
to 4 on the next line.  The cast to u_long pointer clears 8 bytes
on 64 bit arches.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Code auditing work.  I don't have this hardware.  This bug is old.

diff --git a/drivers/net/fddi/skfp/pmf.c b/drivers/net/fddi/skfp/pmf.c
index 24d8566..441b4dc 100644
--- a/drivers/net/fddi/skfp/pmf.c
+++ b/drivers/net/fddi/skfp/pmf.c
@@ -673,7 +673,7 @@ void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para,
 			sm_pm_get_ls(smc,port_to_mib(smc,port))) ;
 		break ;
 	case SMT_P_REASON :
-		* (u_long *) to = 0 ;
+		*(u32 *)to = 0 ;
 		sp_len = 4 ;
 		goto sp_done ;
 	case SMT_P1033 :			/* time stamp */

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch] fddi: 64 bit bug in smt_add_para()
  2012-09-01 19:57 ` Dan Carpenter
@ 2012-09-02  2:46   ` David Miller
  -1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-09-02  2:46 UTC (permalink / raw)
  To: dan.carpenter; +Cc: netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Sat, 1 Sep 2012 12:57:40 -0700

> The intent was to set 4 bytes of data so that's why the sp_len is set
> to 4 on the next line.  The cast to u_long pointer clears 8 bytes
> on 64 bit arches.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Obvious enough, applied, thanks Dan.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] fddi: 64 bit bug in smt_add_para()
@ 2012-09-02  2:46   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-09-02  2:46 UTC (permalink / raw)
  To: dan.carpenter; +Cc: netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Sat, 1 Sep 2012 12:57:40 -0700

> The intent was to set 4 bytes of data so that's why the sp_len is set
> to 4 on the next line.  The cast to u_long pointer clears 8 bytes
> on 64 bit arches.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Obvious enough, applied, thanks Dan.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-02  2:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-01 19:57 [patch] fddi: 64 bit bug in smt_add_para() Dan Carpenter
2012-09-01 19:57 ` Dan Carpenter
2012-09-02  2:46 ` David Miller
2012-09-02  2:46   ` David Miller

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.