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]
Date:	Tue, 15 Dec 2015 18:10:33 +0100
From:	Vitaly Kuznetsov <vkuznets@...hat.com>
To:	Dexuan Cui <decui@...rosoft.com>
Cc:	KY Srinivasan <kys@...rosoft.com>,
	"gregkh\@linuxfoundation.org" <gregkh@...uxfoundation.org>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>,
	"devel\@linuxdriverproject.org" <devel@...uxdriverproject.org>,
	"olaf\@aepfle.de" <olaf@...fle.de>,
	"apw\@canonical.com" <apw@...onical.com>,
	"jasowang\@redhat.com" <jasowang@...hat.com>
Subject: Re: [PATCH 3/9] Drivers: hv: utils: introduce HVUTIL_TRANSPORT_DESTROY mode

Dexuan Cui <decui@...rosoft.com> writes:

>> -----Original Message-----
>> From: devel [mailto:driverdev-devel-bounces@...uxdriverproject.org] On Behalf
>> Of K. Y. Srinivasan
>> Sent: Tuesday, December 15, 2015 11:02
>> To: gregkh@...uxfoundation.org; linux-kernel@...r.kernel.org;
>> devel@...uxdriverproject.org; olaf@...fle.de; apw@...onical.com;
>> vkuznets@...hat.com; jasowang@...hat.com
>> Subject: [PATCH 3/9] Drivers: hv: utils: introduce HVUTIL_TRANSPORT_DESTROY
>> mode
>> 
>> From: Vitaly Kuznetsov <vkuznets@...hat.com>
>> 
>> When Hyper-V host asks us to remove some util driver by closing the
>> appropriate channel there is no easy way to force the current file
>> descriptor holder to hang up but we can start to respond -EBADF to all
>> operations asking it to exit gracefully.
>> 
>> As we're setting hvt->mode from two separate contexts now we need to use
>> a proper locking.
>> 
>> ...
>> @@ -99,6 +107,10 @@ static unsigned int hvt_op_poll(struct file *file,
>> poll_table *wait)
>>  	hvt = container_of(file->f_op, struct hvutil_transport, fops);
>> 
>>  	poll_wait(file, &hvt->outmsg_q, wait);
>> +
>> +	if (hvt->mode == HVUTIL_TRANSPORT_DESTROY)
>> +		return -EBADF;
>> +
>>  	if (hvt->outmsg_len > 0)
>>  		return POLLIN | POLLRDNORM;
>
> Hi Vitaly, 
> Should hvt_op_poll() return -EBADF -- I think it probably
> should return POLLERR or POLLHUP?

Oh, sorry, my bad -- hvt_op_poll() returns unsigned int and -EBADF is
definitely inappropriate. I see this patch was already merged to
char-misc-testing so I'll send a follow-up patch to fix things up.

Thanks!

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