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] [day] [month] [year] [list]
Date:   Tue, 28 Feb 2023 11:08:53 +0100
From:   Miquel Raynal <miquel.raynal@...tlin.com>
To:     Eric Dumazet <edumazet@...gle.com>
Cc:     Alexander Aring <alex.aring@...il.com>,
        Stefan Schmidt <stefan@...enfreihafen.org>,
        linux-wpan@...r.kernel.org,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, netdev@...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>,
        Guilhem Imberton <guilhem.imberton@...vo.com>,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH wpan v2 2/6] ieee802154: Convert scan error messages to
 extack

Hi Eric,

edumazet@...gle.com wrote on Mon, 27 Feb 2023 21:41:51 +0100:

> On Tue, Feb 14, 2023 at 2:50 PM Miquel Raynal <miquel.raynal@...tlin.com> wrote:
> >
> > Instead of printing error messages in the kernel log, let's use extack.
> > When there is a netlink error returned that could be further specified
> > with a string, use extack as well.
> >
> > Apply this logic to the very recent scan/beacon infrastructure.
> >
> > Fixes: ed3557c947e1 ("ieee802154: Add support for user scanning requests")
> > Fixes: 9bc114504b07 ("ieee802154: Add support for user beaconing requests")
> > Suggested-by: Jakub Kicinski <kuba@...nel.org>
> > Signed-off-by: Miquel Raynal <miquel.raynal@...tlin.com>
> > ---
> >  net/ieee802154/nl802154.c | 19 +++++++++++++------
> >  1 file changed, 13 insertions(+), 6 deletions(-)
> >
> > diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
> > index 64fa811e1f0b..d3b6e9e80941 100644
> > --- a/net/ieee802154/nl802154.c
> > +++ b/net/ieee802154/nl802154.c
> > @@ -1407,9 +1407,15 @@ static int nl802154_trigger_scan(struct sk_buff *skb, struct genl_info *info)
> >         u8 type;
> >         int err;
> >
> > -       /* Monitors are not allowed to perform scans */
> > -       if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR)
> > +       if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) {
> > +               NL_SET_ERR_MSG(info->extack, "Monitors are not allowed to perform scans");
> >                 return -EPERM;
> > +       }
> > +
> > +       if (!nla_get_u8(info->attrs[NL802154_ATTR_SCAN_TYPE])) {
> 
> syzbot crashes hosts by _not_ adding NL802154_ATTR_SCAN_TYPE attribute.

I was looking at Sanan Hasanov's e-mail, I believe this is the same
breakage that is being reported?
Link: https://lore.kernel.org/netdev/IA1PR07MB98302CDCC21F6BA664FB7298ABAF9@IA1PR07MB9830.namprd07.prod.outlook.com/

> Did you mean to write :
> 
> diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
> index 2215f576ee3788f74ea175b046d05d285bac752d..d8f4379d4fa68b5b07bb2c45cd74d4b73213c107
> 100644
> --- a/net/ieee802154/nl802154.c
> +++ b/net/ieee802154/nl802154.c
> @@ -1412,7 +1412,7 @@ static int nl802154_trigger_scan(struct sk_buff
> *skb, struct genl_info *info)
>                 return -EOPNOTSUPP;
>         }
> 
> -       if (!nla_get_u8(info->attrs[NL802154_ATTR_SCAN_TYPE])) {
> +       if (!info->attrs[NL802154_ATTR_SCAN_TYPE]) {

That is absolutely what I intended to do, I will send a fix immediately.

>                 NL_SET_ERR_MSG(info->extack, "Malformed request,
> missing scan type");
>                 return -EINVAL;
>         }
> 

Thanks a lot,
Miquèl

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ