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: <YN4WeJCepCrpylOD@kunai>
Date:   Thu, 1 Jul 2021 21:24:40 +0200
From:   Wolfram Sang <wsa@...nel.org>
To:     Viresh Kumar <viresh.kumar@...aro.org>
Cc:     Jie Deng <jie.deng@...el.com>, linux-i2c@...r.kernel.org,
        virtualization@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org, mst@...hat.com, arnd@...db.de,
        jasowang@...hat.com, andriy.shevchenko@...ux.intel.com,
        yu1.wang@...el.com, shuo.a.liu@...el.com, conghui.chen@...el.com,
        stefanha@...hat.com
Subject: Re: [PATCH v11] i2c: virtio: add a virtio i2c frontend driver


> I just noticed this now, but this function even tries to send data
> partially, which isn't right. If the caller (i2c device's driver)
> calls this for 5 struct i2c_msg instances, then all 5 need to get
> through or none.. where as we try to send as many as possible here.
> 
> This looks broken to me. Rather return an error value here on success,
> or make it complete failure.
> 
> Though to be fair I see i2c-core also returns number of messages
> processed from i2c_transfer().
> 
> Wolfram, what's expected here ? Shouldn't all message transfer or
> none?

Well, on a physical bus, it can simply happen that after message 3 of 5,
the bus is stalled, so we need to bail out.

Again, I am missing details of a virtqueue, but I'd think it is
different. If adding to the queue fails, then it probably make sense to
drop the whole transfer.

Of course, it can later happen on the physical bus of the host, though,
that the bus is stalled after message 3 of 5, and I2C_RDWR will bail
out.


Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ