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: <20220518105543.54cda82f@xps-13>
Date:   Wed, 18 May 2022 10:55:43 +0200
From:   Miquel Raynal <miquel.raynal@...tlin.com>
To:     Alexander Aring <aahringo@...hat.com>
Cc:     Alexander Aring <alex.aring@...il.com>,
        Stefan Schmidt <stefan@...enfreihafen.org>,
        linux-wpan - ML <linux-wpan@...r.kernel.org>,
        David Girault <david.girault@...vo.com>,
        Romuald Despres <romuald.despres@...vo.com>,
        Frederic Blain <frederic.blain@...vo.com>,
        Nicolas Schodet <nico@...fr.eu.org>,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH wpan-next v3 10/11] net: mac802154: Add a warning in the
 hot path


aahringo@...hat.com wrote on Tue, 17 May 2022 20:58:19 -0400:

> Hi,
> 
> On Tue, May 17, 2022 at 12:35 PM Miquel Raynal
> <miquel.raynal@...tlin.com> wrote:
> >
> > We should never start a transmission after the queue has been stopped.
> >
> > But because it might work we don't kill the function here but rather
> > warn loudly the user that something is wrong.
> >
> > Set an atomic when the queue will remain stopped. Reset this atomic when
> > the queue actually gets restarded. Just check this atomic to know if the
> > transmission is legitimate, warn if it is not.
> >
> > Signed-off-by: Miquel Raynal <miquel.raynal@...tlin.com>
> > ---
> >  include/net/cfg802154.h |  1 +
> >  net/mac802154/tx.c      | 16 +++++++++++++++-
> >  net/mac802154/util.c    |  1 +
> >  3 files changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/net/cfg802154.h b/include/net/cfg802154.h
> > index 8881b6126b58..f4e7b3fe7cf0 100644
> > --- a/include/net/cfg802154.h
> > +++ b/include/net/cfg802154.h
> > @@ -218,6 +218,7 @@ struct wpan_phy {
> >         spinlock_t queue_lock;
> >         atomic_t ongoing_txs;
> >         atomic_t hold_txs;
> > +       unsigned long queue_stopped;  
> 
> Can we name it something like state_flags (as phy state flags)? Pretty
> sure there will be more coming, or internal_flags, no idea...
> something_flags...

'phy_flags'? Just 'flags', maybe?

state_flags seems a bit too specific, but if it's your favorite I don't
mind using it.

> 
> >         wait_queue_head_t sync_txq;
> >
> >         char priv[] __aligned(NETDEV_ALIGN);
> > diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
> > index 6cc4e5c7ba94..e36aca788ea2 100644
> > --- a/net/mac802154/tx.c
> > +++ b/net/mac802154/tx.c
> > @@ -123,9 +123,13 @@ static int ieee802154_sync_queue(struct ieee802154_local *local)
> >
> >  int ieee802154_sync_and_hold_queue(struct ieee802154_local *local)
> >  {
> > +       int ret;
> > +
> >         ieee802154_hold_queue(local);
> > +       ret = ieee802154_sync_queue(local);
> > +       set_bit(0, &local->phy->queue_stopped);
> >  
> 
> Define the 0 as WPAN_PHY_STATE_QUEUE_STOPPED_BIT or something like
> that, above wpan_phy.

Sure.

Thanks,
Miquèl

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ