From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.redhat.com (Postfix) with ESMTP id A4A2040529 for ; Sat, 9 Nov 2002 16:29:12 -0500 (EST) Received: (from mail@localhost) by int-mx1.corp.redhat.com (8.11.6/8.11.6) id gA9LTC930406 for axp-list@listman.redhat.com; Sat, 9 Nov 2002 16:29:12 -0500 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with SMTP id gA9LTCD30402 for ; Sat, 9 Nov 2002 16:29:12 -0500 Received: from ellpspace.math.ualberta.ca (ellpspace.math.ualberta.ca [129.128.207.67]) by mx1.redhat.com (8.11.6/8.11.6) with SMTP id gA9L6Iw16603 for ; Sat, 9 Nov 2002 16:06:18 -0500 Received: (from michal@localhost) by ellpspace.math.ualberta.ca (8.11.6/8.11.6) id gA9LTB408234 for axp-list@redhat.com; Sat, 9 Nov 2002 14:29:11 -0700 Date: Sat, 9 Nov 2002 14:29:11 -0700 From: Michal Jaegermann To: axp-list@redhat.com Subject: Re: [PATCH] [RESENT] compilation warnings 3/6 Message-ID: <20021109142911.A8182@ellpspace.math.ualberta.ca> References: <20021109010039.D18411@Marvin.DL8BCU.ampr.org> <20021109010312.E18411@Marvin.DL8BCU.ampr.org> <20021109010502.F18411@Marvin.DL8BCU.ampr.org> <20021108205012.C3169@twiddle.net> <3DCD5E9F.B32BC88B@zk3.dec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3DCD5E9F.B32BC88B@zk3.dec.com>; from frival@zk3.dec.com on Sat, Nov 09, 2002 at 02:14:40PM -0500 X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: 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: > > > > > > > ### 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