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] [day] [month] [year] [list]
Message-Id: <201010152203.54665.arnd@arndb.de>
Date:	Fri, 15 Oct 2010 22:03:54 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Chris Metcalf <cmetcalf@...era.com>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 04/14] arch/tile: change lower bound on syscall error return to -4095

On Friday 15 October 2010 19:17:19 Chris Metcalf wrote:
>  On 10/14/2010 5:22 PM, Arnd Bergmann wrote:
> > On Thursday 14 October 2010 21:14:29 Chris Metcalf wrote:
> >> Previously we were using -1023, which is fine for normal syscall
> >> error returns, but the common value in use for other platforms
> >> is -4095, and one Tilera-specific driver does use values in the
> >> -1100 range, so tickled this bug.
> > The patch is ok, but note that any value above starting at 512 is meant
> > as kernel internal, so funny things may happen if a driver goes
> > beyond that for errors returned to the user.
> >
> > Better use just the predefined error codes if possible.
> 
> Thanks, good point.  In practice we've found that for the syscalls we use
> (e.g. pwrite) that are intended to return errors codes from our drivers the
> errors are in fact properly returned.  But I've filed a bug internally that
> we should review our usage of error codes and determine if there are more
> standard ways to handle this, e.g. return a Linux errno but allow passing a
> pointer to store a more specific hypervisor or driver error code in.

I think in general I'd do something like return -EIO with a hardware or
hypervisor result code written to memory if that happens. In specific
drivers there may of course be a better way.

	Arnd
--
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