[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v10 04/25] tools/libxenevtchn: add possibility to not close file descriptor on exec


  • To: Jürgen Groß <jgross@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 16 Dec 2020 11:22:35 +0000
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>
  • Delivery-date: Wed, 16 Dec 2020 11:23:00 +0000
  • Ironport-sdr: j+gInFzWtNVKXfq625TT/LdLZ7Z/jsMfLEJtcpjbKmykuFCB/fGmQgm5cL3Y1jcFlx646Mm+rb COsAvbr502XlI2ROmcj4cqAoLL8zQX0PWkbiytau4/DXW5IjJWYGNqJUSGqv9kmStcdbN++9ZA HVK2Knf0di9TKKgkSq6dCHaStl2n/Y0tcnXM4ZZ1Jbn5zrbQmg7JgLc/UN2FbVRMesyGJ3P/Vu YhbQcHpZZB8OW1o6Ic0Y6urncLt6/mnAEIbdHEeNNY0U/LSCoQTcvilXYLl0IuNCijbNOgr038 dBY=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16/12/2020 06:06, Jürgen Groß wrote:
> On 15.12.20 19:09, Andrew Cooper wrote: 
>>
>> Additionally, something in core.c should check for unknown flags and
>> reject them them with EINVAL.  It was buggy that this wasn't done
>> before, and really needs to be implemented before we start having cases
>> where people might plausibly pass something other than 0.
>
> Are you sure this is safe? I'm not arguing against it, but we considered
> to do that and didn't dare to.

Well - you're already breaking things by adding meaning to bit 0 where
it was previously ignored.

But fundamentally - any caller passing non-zero to begin with is buggy,
and it will be less bad to fix up our input validation and given them a
clean EINVAL now.

The alternative is no error and some weird side effect when we implement
whichever bit they were settings.

~Andrew




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.