[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190702.153219.745790952731148399.davem@davemloft.net>
Date: Tue, 02 Jul 2019 15:32:19 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: petrm@...lanox.com
Cc: netdev@...r.kernel.org, colin.king@...onical.com,
idosch@...lanox.com
Subject: Re: [PATCH net-next] mlxsw: spectrum_ptp: Fix validation in
mlxsw_sp1_ptp_packet_finish()
From: Petr Machata <petrm@...lanox.com>
Date: Tue, 2 Jul 2019 19:06:47 +0000
> Before mlxsw_sp1_ptp_packet_finish() sends the packet back, it validates
> whether the corresponding port is still valid. However the condition is
> incorrect: when mlxsw_sp_port == NULL, the code dereferences the port to
> compare it to skb->dev.
>
> The condition needs to check whether the port is present and skb->dev still
> refers to that port (or else is NULL). If that does not hold, bail out.
> Add a pair of parentheses to fix the condition.
>
> Fixes: d92e4e6e33c8 ("mlxsw: spectrum: PTP: Support timestamping on Spectrum-1")
> Reported-by: Colin Ian King <colin.king@...onical.com>
> Signed-off-by: Petr Machata <petrm@...lanox.com>
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
> Reviewed-by: Ido Schimmel <idosch@...lanox.com>
Applied, thank you.
Powered by blists - more mailing lists