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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 22 Apr 2020 10:14:21 +0200
From:   Mathieu Othacehe <m.othacehe@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Jonathan Cameron <jic23@...nel.org>,
        Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald <pmeerw@...erw.net>,
        linux-iio <linux-iio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 4/4] iio: vcnl4000: Add buffer support for VCNL4010/20.


>> +static int vcnl4010_buffer_predisable(struct iio_dev *indio_dev)
>> +{
>> +       struct vcnl4000_data *data = iio_priv(indio_dev);
>> +       int ret, ret_disable;
>> +
>> +       ret = i2c_smbus_write_byte_data(data->client, VCNL4010_INT_CTRL, 0);
>> +       if (ret < 0)
>> +               goto end;
>> +
>> +       ret = i2c_smbus_write_byte_data(data->client, VCNL4000_COMMAND, 0);
>> +
>> +end:
>
>> +       ret_disable = iio_triggered_buffer_predisable(indio_dev);
>> +       if (ret == 0)
>> +               ret = ret_disable;
>
> What is this?
>
> Can't you rather call IIO API first, and then try to handle the rest?

Well, iio_triggered_buffer_predisable will call free_irq which requires
that the interruption source is disabled, hence this strange pattern.

However, this may be some misunderstanding from me, but I noticed
something strange here. In a configuration with one CPU and
CONFIG_PREEMPT disabled, I have kernel lockups when disabling the
buffer.

This is because free_irq calls synchronize_irq that will wait for any
IRQ handler to be over. If the kthread handling the interruption is
still running, it has no chances to terminate, and synchronize_irq waits
forever. So maybe I'm missing something.

Anyway, I'll send a v5 addressing your remarks.

Thanks,

Mathieu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ