[Intel-wired-lan] [PATCH v2 net] ice: Avoid crash from unnecessary IDA free

Jesse Brandeburg jesse.brandeburg at intel.com
Wed Oct 13 23:15:20 UTC 2021


On 10/4/2021 5:15 AM, Dave Ertman wrote:
> In the remove path, there is an attempt to free the aux_idx IDA whether
> it was allocated or not.  This can potentially cause a crash when
> unloading the driver on systems that do not initialize support for RDMA.
> But, this free cannot be gated by the status bit for RDMA, since it is
> allocated if the driver detects support for RDMA at probe time, but the
> driver can enter into a state where RDMA is not supported after the IDA
> has been allocated at probe time and this would lead to a memory leak.
> 
> Initialize aux_idx to an invalid value and check for a valid value when
> unloading to determine if an IDA free is necessary.
> 
> Fixes: d25a0fc41c1f9 ("ice: Initialize RDMA support")
> Reported-by: Jun Miao <jun.miao at windriver.com>
> Signed-off-by: Dave Ertman <david.m.ertman at intel.com>

Please send upstream!
With this patch applied I can now rmmod my ice driver without a panic!

Tested-by: Jesse Brandeburg <jesse.brandeburg at intel.com>




More information about the Intel-wired-lan mailing list