All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS getdomainname() off by 1;
@ 2004-06-01  3:21 Randy.Dunlap
  2004-07-08  0:49 ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: Randy.Dunlap @ 2004-06-01  3:21 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf, rddunlap


irix_getdomainname() max size appears to be off by 1;
other similar code in kernel uses __NEW_UTS_LEN as the max size,
and <domainname> includes an extra byte for the terminating
null character.

Does sysirix.c need to limit <len> to 63 instead of 64 for some
reason?


diffstat:=
 arch/mips/kernel/sysirix.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff -Naurp ./arch/mips/kernel/sysirix.c~uts_len_off1 ./arch/mips/kernel/sysirix.c
--- ./arch/mips/kernel/sysirix.c~uts_len_off1	2004-05-31 13:58:24.000000000 -0700
+++ ./arch/mips/kernel/sysirix.c	2004-05-31 20:11:42.000000000 -0700
@@ -913,8 +913,8 @@ asmlinkage int irix_getdomainname(char *
 		return error;
 
 	down_read(&uts_sem);
-	if(len > (__NEW_UTS_LEN - 1))
-		len = __NEW_UTS_LEN - 1;
+	if (len > __NEW_UTS_LEN)
+		len = __NEW_UTS_LEN;
 	error = 0;
 	if (copy_to_user(name, system_utsname.domainname, len))
 		error = -EFAULT;

--
~Randy

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

* Re: [PATCH] MIPS getdomainname() off by 1;
  2004-06-01  3:21 [PATCH] MIPS getdomainname() off by 1; Randy.Dunlap
@ 2004-07-08  0:49 ` Ralf Baechle
  2004-07-08  8:46   ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Ralf Baechle @ 2004-07-08  0:49 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: linux-mips

On Mon, May 31, 2004 at 08:21:01PM -0700, Randy.Dunlap wrote:

> irix_getdomainname() max size appears to be off by 1;
> other similar code in kernel uses __NEW_UTS_LEN as the max size,
> and <domainname> includes an extra byte for the terminating
> null character.
> 
> Does sysirix.c need to limit <len> to 63 instead of 64 for some
> reason?

I would know why - and it has other bugs also, so I removed it by the
normal Linux getdomainname(2) for SysV flavour syscalls, too.

  Ralf

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

* Re: [PATCH] MIPS getdomainname() off by 1;
  2004-07-08  0:49 ` Ralf Baechle
@ 2004-07-08  8:46   ` Geert Uytterhoeven
  2004-07-08 10:56     ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2004-07-08  8:46 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Randy.Dunlap, Linux/MIPS Development

On Thu, 8 Jul 2004, Ralf Baechle wrote:
> On Mon, May 31, 2004 at 08:21:01PM -0700, Randy.Dunlap wrote:
> > irix_getdomainname() max size appears to be off by 1;
> > other similar code in kernel uses __NEW_UTS_LEN as the max size,
> > and <domainname> includes an extra byte for the terminating
> > null character.
> >
> > Does sysirix.c need to limit <len> to 63 instead of 64 for some
> > reason?
>
> I would know why - and it has other bugs also, so I removed it by the
> normal Linux getdomainname(2) for SysV flavour syscalls, too.

I saw you even removed it from 2.0. Woow! ;-)

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* Re: [PATCH] MIPS getdomainname() off by 1;
  2004-07-08  8:46   ` Geert Uytterhoeven
@ 2004-07-08 10:56     ` Ralf Baechle
  0 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2004-07-08 10:56 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Randy.Dunlap, Linux/MIPS Development

On Thu, Jul 08, 2004 at 10:46:19AM +0200, Geert Uytterhoeven wrote:

> > > Does sysirix.c need to limit <len> to 63 instead of 64 for some
> > > reason?
> >
> > I would know why - and it has other bugs also, so I removed it by the
> > normal Linux getdomainname(2) for SysV flavour syscalls, too.
> 
> I saw you even removed it from 2.0. Woow! ;-)

Yep :-)  But whoever is still runing 2.0 on MIPS must be suffering from a
suicidal tendences.  Too many bugs left unfixed.

  Ralf

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

end of thread, other threads:[~2004-07-08 10:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-01  3:21 [PATCH] MIPS getdomainname() off by 1; Randy.Dunlap
2004-07-08  0:49 ` Ralf Baechle
2004-07-08  8:46   ` Geert Uytterhoeven
2004-07-08 10:56     ` Ralf Baechle

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.