Search Linux Wireless

Re: bug report: potential ERR_PTR dereference in iwm_debugfs_init()

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

 



On Fri, 2010-04-23 at 20:03 +0800, Johannes Berg wrote:
> > The bit that was problematic in this code for me is that passing
> > ERR_PTR(-ENODEV) to debugfs_create_dir() on line 447 will cause an
> oops.
> > But, as you point out, the check on line 442 is never true because
> we
> > already established that debugfs is enabled.
> 
> I don't think so. See, that function will only return -ENODEV when
> debugfs is not compiled into the kernel, and in that case the argument
> to debugfs_create_dir is never used anyway. 

Yes, there won't be any kernel oops anyway. But the iwm debugfs code is
a little misleading. Dan, please feel free to send a patch to clean up
this. On the error path, either NULL or ERR_PTR(-ENODEV) (no other
errno) is returned. Since all the debugfs functions are defined as no-op
if CONFIG_DEBUG_FS is not selected, maybe we only check against NULL is
enough.

Thanks,
-yi

--
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