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]
Date:   Fri, 12 Mar 2021 16:37:56 +0800
From:   Jie Deng <jie.deng@...el.com>
To:     Wolfram Sang <wsa@...nel.org>,
        Viresh Kumar <viresh.kumar@...aro.org>
Cc:     linux-i2c@...r.kernel.org,
        virtualization@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org, mst@...hat.com, wsa@...nel.org,
        jasowang@...hat.com, wsa+renesas@...g-engineering.com,
        andriy.shevchenko@...ux.intel.com, conghui.chen@...el.com,
        arnd@...db.de, kblaiech@...lanox.com,
        jarkko.nikula@...ux.intel.com, Sergey.Semin@...kalelectronics.ru,
        rppt@...nel.org, loic.poulain@...aro.org, tali.perry1@...il.com,
        u.kleine-koenig@...gutronix.de, bjorn.andersson@...aro.org,
        yu1.wang@...el.com, shuo.a.liu@...el.com, stefanha@...hat.com,
        pbonzini@...hat.com
Subject: Re: [PATCH v7] i2c: virtio: add a virtio i2c frontend driver


On 2021/3/12 16:11, Viresh Kumar wrote:
> On 12-03-21, 15:51, Jie Deng wrote:
>> On 2021/3/12 14:10, Viresh Kumar wrote:
>>> I saw your email about wrong version being sent, I already wrote some
>>> reviews. Sending them anyway for FWIW :)
>>>
>>> On 12-03-21, 21:33, Jie Deng wrote:
>>>> +struct virtio_i2c {
>>>> +	struct virtio_device *vdev;
>>>> +	struct completion completion;
>>>> +	struct i2c_adapter adap;
>>>> +	struct mutex lock;
>>> As I said in the previous version (Yes, we were both waiting for
>>> Wolfram to answer that), this lock shouldn't be required at all.
>>>
>>> And since none of us have a use-case at hand where we will have a
>>> problem without this lock, we should really skip it. We can always
>>> come back and add it if we find an issue somewhere. Until then, better
>>> to keep it simple.
>> The problem is you can't guarantee that adap->algo->master_xfer
>> is only called from i2c_transfer. Any function who holds the adapter can
>> call
>> adap->algo->master_xfer directly.
> See my last reply here, (almost) no one in the mainline kernel call it
> directly. And perhaps you can consider the caller broken in that case
> and so there is no need of an extra lock, unless you have a case that
> is broken.
>
> https://lore.kernel.org/lkml/20210305072903.wtw645rukmqr5hx5@vireshk-i7/
>
>> I prefer to avoid potential issues rather
>> than
>> find a issue then fix.
> This is a very hypothetical issue IMHO as the kernel code doesn't have
> such a user. There is no need of locks here, else the i2c core won't
> have handled it by itself.

I'd like to see Wolfram's opinion.
Is it safe to remove lock in adap->algo->master_xfer ?


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ