Search Linux Wireless

Re: [PATCH] mac80211: use BUG_ON and return -EINVAL if rate_lowest_index() fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/17/2011 02:37 AM, Arend van Spriel wrote:
On 06/17/2011 12:08 AM, Pavel Roskin wrote:

In my case, I was able to restart the system by sysrq when using BUG_ON,
but the system would hang hard with WARN_ON. I think continuing after
returning an invalid index is wrong. It will lead to memory corruption
that could in turn lead to corruption of the filesystem.

I think it is generally a bad idea to use BUG_ON as a solution. As
Stanislaw indicated there are platforms which can continue without a
hang so you are regressing those. Regarding your patch I think the
-EINVAL is good to have, but leave the WARN_ON.

Well, then it would be pointless. The whole idea was to prevent memory corruption and to stop early. Returning -EINVAL for real (as opposed to having it in the dead code) could lead to worse memory corruption than returning 0.

The real fix would be to make rate control algorithms robust to the case when no rates are allowed. My patch was meant as a first little step towards it by making it easier to capture the backtrace and restart the system. But it's not worth the trouble for me to argue about it.

--
Regards,
Pavel Roskin
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux