Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
To: axp-list@redhat.com
Subject: Re: [PATCH] [RESENT] compilation warnings 3/6
Date: Sat, 9 Nov 2002 14:29:11 -0700	[thread overview]
Message-ID: <20021109142911.A8182@ellpspace.math.ualberta.ca> (raw)
In-Reply-To: <3DCD5E9F.B32BC88B@zk3.dec.com>; from frival@zk3.dec.com on Sat, Nov 09, 2002 at 02:14:40PM -0500

On Sat, Nov 09, 2002 at 02:14:40PM -0500, Peter Rival wrote:
> Richard Henderson wrote:
> 
> > On Sat, Nov 09, 2002 at 01:05:03AM +0000, Thorsten Kranzkowski wrote:
> 
> <snip>
> >
> > > ### i is again a loopcounter with supposedly only positive values.
> > > ### OTOH this funktion needs more thought. In its current form
> > > ### it may copy arbitrary amounts of memory when given a negative
> > > ### value for namelen. 'len' should be removes altogether.

The current code for 'int osf_getdomainname(char *name, int namelen)'
goes like that:

        unsigned len;
....
        len = namelen;
        if (namelen > 32)
                len = 32;
...

Replacing that test with 'if (len > 32U)' would cut all negative values
for namelen to 32.  Still likely a verify_area() call would end with an
error first; it has 'inline int verify_area(int type, const void * addr,
unsigned long size)' for a prototype.  It is a good question if a code
like
.....
        unsigned len = namelen;
        int i, error;

        if (len > 32)
                len = 32;

        error = verify_area(VERIFY_WRITE, name, len);
        if (error)
                goto out;
.....
would be not preferable.  Maybe not.  It would "mask" some weird
arguments.

> > > ### I suppose the 'int namelen' is architecturally defined?
> >
> > Can someone with access to Tru64 headers check the definition
> > of the getdomainname syscall?
> >
> > I'm going to leave this hunk out for now.
> >
> 
> Ask and ye shall receive.  From a cscope database of V5.1A kernel
> sources:
> 
> int
> getdomainname(struct proc *p,
>               void *args,
>               long *retval)
> {
> ...
> }

Is this for a system call?  If yes then an interface between
versions 4 and 5 would be totally different.  Hm....  Other surprises?

   Michal




  reply	other threads:[~2002-11-09 21:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-09  1:00 [PATCH] [RESENT] compilation warnings 1/6 Thorsten Kranzkowski
2002-11-09  1:03 ` [PATCH] [RESENT] compilation warnings 2/6 Thorsten Kranzkowski
2002-11-09  1:05   ` [PATCH] [RESENT] compilation warnings 3/6 Thorsten Kranzkowski
2002-11-09  1:07     ` [PATCH] [RESENT] compilation warnings 4/6 Thorsten Kranzkowski
2002-11-09  1:08       ` [PATCH] [RESENT] compilation warnings 5/6 Thorsten Kranzkowski
2002-11-09  1:13         ` [PATCH] [RESENT] compilation warnings 6/6 Thorsten Kranzkowski
2002-11-09  1:47       ` [PATCH] [RESENT] compilation warnings 4/6 Michal Jaegermann
2002-11-09  5:51       ` Richard Henderson
2002-11-09  4:50     ` [PATCH] [RESENT] compilation warnings 3/6 Richard Henderson
2002-11-09 19:14       ` Peter Rival
2002-11-09 21:29         ` Michal Jaegermann [this message]
2002-11-14  6:44         ` Richard Henderson
2002-11-09  4:32 ` [PATCH] [RESENT] compilation warnings 1/6 Richard Henderson
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox