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, 3 Mar 2015 20:47:07 +0100
From:	Radim Krčmář <rkrcmar@...hat.com>
To:	Vitaly Kuznetsov <vkuznets@...hat.com>
Cc:	"K. Y. Srinivasan" <kys@...rosoft.com>,
	devel@...uxdriverproject.org,
	Haiyang Zhang <haiyangz@...rosoft.com>,
	linux-kernel@...r.kernel.org, Dexuan Cui <decui@...rosoft.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-api@...r.kernel.org
Subject: Re: [PATCH RFC 1/3] Drivers: hv: kvp: convert userspace/kernel
 communication to using char device

2015-03-03 10:53+0100, Vitaly Kuznetsov:
> Radim Krčmář <rkrcmar@...hat.com> writes:
> > 2015-02-27 17:14+0100, Vitaly Kuznetsov:
> >> Re-implement the communication using misc char device. Use ioctl to do
> >> kernel/userspace version negotiation (doesn't make much sense at this moment
> >> as we're breaking backwards compatibility but can be used in future).
> >
> > The ioctl is used too creatively for my liking: as an out-of-band
> > communication that is required after the main channel has been opened.
> > It would be simpler to inject the version into first x bytes of the
> > stream, making a read() after open() mandatory.
> 
> We need to perform a handshake - kernel part sends its version and
> receives daemon's version.

(We could also design a backward-compatible protocol, which should be
 possible for an application this simple, but keeping options is wise.)

>                            We can definitelly pack everything in the
> data stream but why do we need to avoid ioctls?

I think it is better if the kernel sends its version (set of features)
first, so it would be just a simple two-way handshake.

Kernel-initiated communication is not possible over ioctl and it doesn't
give extra options for handshake either.

>                                                 It seems to me the
> handshake we're performing here belongs to a 'control' stream, not
> 'data' stream.

Handshake makes sense after we open the device and before any 'data' can
appear on it, so multiplexing the same carrier also prevents a lot of
stupid cases, like ioctls from different applications.
Not to mention that asynchronicity itself has a fairly bad record.

(I don't really understand the difference between 'control' and 'data'.)
--
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