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  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]
Date:   Mon, 21 Jan 2019 17:53:21 -0800
From:   Matthew Wilcox <>
Subject: Re: Design of xa_alloc

On Thu, Jan 17, 2019 at 12:08:17PM -0800, Matthew Wilcox wrote:
> It would, of course, be possible to make the xa_alloc() API identical
> to idr_alloc().  idr_alloc() has been a phenomenal success with around
> 200 callers in the kernel today.  But it could be improved, and this
> seems like a good time to make the API changes.

> Problem 3 is solved by using xa_insert() instead of xa_alloc().  It does
> return a different errno (-EEXIST) instead of -ENOSPC, but most users
> convert the errno to something else anyway because -ENOSPC is a horrible
> errno to return to userspace.

Writing this down and then thinking about it more makes me think that
this is the right time to change the return code of xa_alloc().  I chose
-ENOSPC to be compatible with idr_alloc(), but bugs like
show that returning an -ENOSPC error to userspace is just confusing:

: # tc filter add dev ipenc0 parent 2:0 handle ::102 protocol ip prio 1 u32 match ip dst flowid 2:102
: RTNETLINK answers: No space left on device
: We have an error talking to the kernel

I'm really tempted to make it return -EEXIST instead of -ENOSPC to match

Powered by blists - more mailing lists