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: <877fkevgq3.fsf@vitty.brq.redhat.com>
Date:	Wed, 16 Dec 2015 11:19:00 +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 1/3] Drivers: hv: utils: fix hvt_op_poll() return value on transport destroy

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

>> From: devel [mailto:driverdev-devel-bounces@...uxdriverproject.org] On Behalf
>> Of K. Y. Srinivasan
>> Sent: Wednesday, December 16, 2015 8:27
>> 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 1/3] Drivers: hv: utils: fix hvt_op_poll() return value on transport
>> destroy
>> 
>> From: Vitaly Kuznetsov <vkuznets@...hat.com>
>> 
>> The return type of hvt_op_poll() is unsigned int and -EBADF is
>> inappropriate, poll functions return POLL* statuses.
>> 
>> Reported-by: Dexuan Cui <decui@...rosoft.com>
>> Signed-off-by: Vitaly Kuznetsov <vkuznets@...hat.com>
>> Signed-off-by: K. Y. Srinivasan <kys@...rosoft.com>
>> ---
>>  drivers/hv/hv_utils_transport.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>> 
>> diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv/hv_utils_transport.c
>> index ee20b50..4f42c0e 100644
>> --- a/drivers/hv/hv_utils_transport.c
>> +++ b/drivers/hv/hv_utils_transport.c
>> @@ -109,7 +109,7 @@ static unsigned int hvt_op_poll(struct file *file,
>> poll_table *wait)
>>  	poll_wait(file, &hvt->outmsg_q, wait);
>> 
>>  	if (hvt->mode == HVUTIL_TRANSPORT_DESTROY)
>> -		return -EBADF;
>> +		return POLLERR | POLLHUP;
>> 
>>  	if (hvt->outmsg_len > 0)
>>  		return POLLIN | POLLRDNORM;
>> --
>
> Hi Vitaly,
> The daemon only polls on POLLIN.
> I'm not sure returning "POLLERR | POLLHUP" here can wake up the daemon or not.
>

I tested this patch with hv_kvp_daemon which does poll() and it
works: we wake up all pollers from hvutil_transport_destroy(). Here
we just need to return proper value. Actually, the return value doesn't
really matter -- we do read() after poll() and get -EBADF there. But
let's be consistent.

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