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: <2339287b-8b17-413b-aa86-f618ea7fc3fa@app.fastmail.com>
Date:   Wed, 11 Oct 2023 14:24:48 +0200
From:   "Arnd Bergmann" <arnd@...db.de>
To:     "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        "Alexander Graf" <graf@...zon.com>
Cc:     linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org,
        "Herbert Xu" <herbert@...dor.apana.org.au>,
        "Olivia Mackall" <olivia@...enic.com>,
        "Petre Eftime" <petre.eftime@...il.com>,
        "Erdem Meydanlli" <meydanli@...zon.nl>,
        "Benjamin Herrenschmidt" <benh@...nel.crashing.org>,
        "David Woodhouse" <dwmw@...zon.co.uk>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        "Jason Wang" <jasowang@...hat.com>,
        "Xuan Zhuo" <xuanzhuo@...ux.alibaba.com>,
        "Kyunghwan Kwon" <k@...onn.com>
Subject: Re: [PATCH v4 1/2] Import CBOR library

On Tue, Oct 10, 2023, at 10:27, Greg Kroah-Hartman wrote:
> On Tue, Oct 10, 2023 at 10:08:43AM +0200, Alexander Graf wrote:
>> On 10.10.23 10:03, Greg Kroah-Hartman wrote:
>>
>> > > Out of these, the NSM communication protocol uses all except Semantic tags
>> > > and Floats. The CBOR library that this patch imports does not have special
>> > > handling for Semantic tags, which leaves only floats which are already
>> > > #ifdef'ed out. That means there is not much to trim.
>> > > 
>> > > What you see here is what's needed to parse CBOR in kernel - if that's what
>> > > we want to do. I'm happy to rip it out again and make it a pure user space
>> > > problem to do CBOR :).
>> > Yes, why are we parsing this in the kernel?  What could go wrong with
>> > adding yet-another-parser in privileged context?  :)
>> > 
>> > Why does this have to be in the kernel, the data sent/recieved is over
>> > virtio, so why does the kernel have to parse it?  I couldn't figure that
>> > out from the driver, yet the driver seems to have a lot of hard-coded
>> > parsing logic in it to assume specific message formats?
>> 
>> 
>> The parsing doesn't have to be in kernel and it probably shouldn't be
>> either. V3 of the patch was punting all the parsing to user space, at which
>> point you and Arnd said I should give it a try to do the protocol parsing in
>> kernel space instead. That's why the parser is here.
>
> Arnd said that, not me :)
>
>> If we conclude that all this in-kernel parsing is not worth it, I'm very
>> happy to just go back to the the v3 ioctl interface and post v5 with hwrng
>> merged into misc, but remove all CBOR logic again :)
>
> I think the less parsers we have in the kernel, the safer we are for
> obvious reasons.  Unless you have a parser for this in rust?  :)
>
> I don't really know, having a generic interface is good, but at the
> expense of this api is probably not good.  individual ioctls might be
> better if there are not going to be any other drivers for this type of
> thing?

I was definitely expecting something simpler than what was possible
in the v4 patch. I had another look now, and it's clear that the
ioctl interface is still not great because the variable data structures
shine through for some of the calls, and even to get to this point,
a whole lot of complexity is required underneath.

To get anything better, one would probably have to redesign the entire
interface stack (hypervisor, kernel and userland) to use regular
fixed data structures, and this seems unlikely to happen.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ