Re: BUG: stack guard page was hit in unwind_next_frame

From: Dan Carpenter
Date: Thu May 07 2020 - 06:00:49 EST


On Sun, May 03, 2020 at 06:22:20PM +0800, Hillf Danton wrote:
> Bail out if it's detected to handle the event more than once.
>
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -3273,9 +3273,19 @@ static int bond_netdev_event(struct noti
> return ret;
> }
>
> - if (event_dev->flags & IFF_SLAVE)
> - return bond_slave_netdev_event(event, event_dev);
> + if (event_dev->flags & IFF_SLAVE) {
> + static void *tail_spin = NULL;
^^^^^^^^^^^^^^^^
assigning NULL

> + void *token = (void *) this + (void *) event_dev;

Adding a pointer to a pointer doesn't make any sense. But the result
is non-NULL because event_dev is non-NULL.

> +
> + if (tail_spin == token) {
^^^^^^^^^^^^^^^^^^
Impossible because tail_spin is NULL and token is non-NULL.

> + tail_spin = NULL;
^^^^^^^^^^^^^^^^
re-assigning NULL. local variable assigned right before a return is
pointless.

> + return NOTIFY_DONE;
> + }
> + if (tail_spin == NULL)

Always true condition.

> + tail_spin = token;

Pointless assign.

>
> + return bond_slave_netdev_event(event, event_dev);

This whole patch is a very complicated no-op. :P I'm not sure at all
what was intended by this patch.

> + }
> return NOTIFY_DONE;
> }

regards,
dan carpenter