lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <314BE1148B8C8D468A05944FDF577583069B0222@MRE02.enterprise.com>
Date:	Wed, 7 Mar 2007 08:31:09 -0500
From:	"Chen, Dongliang" <Chen.D@...-t.com>
To:	"H. Peter Anvin" <hpa@...or.com>, "Andreas Schwab" <schwab@...e.de>
Cc:	<linux-kernel@...r.kernel.org>
Subject: RE: return negative number for unsigned long function in kernel

Peter & Andreas,

Thank you very much for your help. 

I understood that the kernel error numbers are limited. The largest
error number for i386 (kernel 2.6) is 131 so far.  Assume that the
virtual address returned from do_mmap_pgoff will never exceed (unsigned
long)(-1000L), which is in the address range one page below the maximum
virtual address, then IS_ERR_VALUE() should work.

Dongliang Chen

Staff Engineer
EMS Technologies, Inc - Defense & Space Systems
660 Engineering Dr 
Norcross, GA 30092
Tel: 770-263-9200 x 4379


-----Original Message-----
From: H. Peter Anvin [mailto:hpa@...or.com] 
Sent: Tuesday, March 06, 2007 7:39 PM
To: Chen, Dongliang
Cc: linux-kernel@...r.kernel.org
Subject: Re: return negative number for unsigned long function in kernel


H. Peter Anvin wrote:
>If you want to test for errorness, you could use the macro 
>IS_ERR_VALUE().  Unfortunately the macro isn't all that safe, in that
it 
>will give you the wrong answer if it's ever used on something that 
>*isn't* an unsigned long.

-----Original Message-----
From: Andreas Schwab [mailto:schwab@...e.de] 
Sent: Tuesday, March 06, 2007 2:06 PM
To: Chen, Dongliang
Cc: linux-kernel@...r.kernel.org
Subject: Re: return negative number for unsigned long function in kernel

Andreas Schwab wrote:
>The return value is directly passed to user space (it's the guts of the
>mmap syscall).  The glibc wrapper transforms it appropriately so that
errno >is set and -1 is returned if there is an error.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ