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: <CABb+yY1K+prm71PrpDPydi9SyD=zG-pJfApm=esyJU-XmBZxXw@mail.gmail.com>
Date:   Thu, 16 Nov 2017 22:21:46 +0530
From:   Jassi Brar <jassisinghbrar@...il.com>
To:     Bjorn Andersson <bjorn.andersson@...aro.org>
Cc:     Sudeep Holla <sudeep.holla@....com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Alexey Klimov <alexey.klimov@....com>
Subject: Re: [PATCH] mailbox: txdone_method shouldn't always be reset

On Thu, Nov 16, 2017 at 11:01 AM, Bjorn Andersson
<bjorn.andersson@...aro.org> wrote:
> A client that knows how to drive txdone would temporarily "upgrade" the
> method to TXDONE_BY_ACK. But with the introduction of commit 33cd7123ac0ba
> ("mailbox: reset txdone_method TXDONE_BY_POLL if client knows_txdone")
> there is no longer a distinction between a channel in "upgraded" state
> or a channel for a controller that only supports TXDONE_BY_ACK. So upon
> freeing the channel it will be "downgraded" to TXDONE_BY_POLL.
>
> But a channel that operates with the txdone method of TXDONE_BY_POLL
> requires that the controller implements the last_tx_done callback and
> that the associated hrtimer was initialized when the controller was
> registered.
>
> So the core now relies on the fact that subsequent calls to
> mbox_request_channel() "upgrades" the channel to TXDONE_BY_ACK or it
> will dereference the non-initialized hrtimer.
>
I think we just need avoid the channel not running under POLL

Does this fix your issue?

diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index 674b35f..672e3ab 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -124,7 +124,8 @@ static enum hrtimer_restart txdone_hrtimer(struct
hrtimer *hrtimer)
        for (i = 0; i < mbox->num_chans; i++) {
                struct mbox_chan *chan = &mbox->chans[i];

-               if (chan->active_req && chan->cl) {
+               if (chan->active_req && chan->cl &&
+                   chan->txdone_method == TXDONE_BY_POLL) {
                        txdone = chan->mbox->ops->last_tx_done(chan);
                        if (txdone)
                                tx_tick(chan, 0);



Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ