Re: [PATCH] infiniband/hw/ocrdma: increase frame warning limit in verifier when using KASAN or KCSAN

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

 



On Tue, Jul 09, 2024 at 06:52:42PM +0800, flyingpenghao@xxxxxxxxx wrote:
> From: Peng Hao <flyingpeng@xxxxxxxxxxx>
> 
> When building kernel with clang, which will typically
> have sanitizers enabled, there is a warning about a large stack frame.
> 
> drivers/infiniband/hw/ocrdma/ocrdma_stats.c:686:16: error: stack frame size (20664) exceeds limit (8192) in 'ocrdma_dbgfs_ops_read' [-Werror,-Wframe-larger-than]
> static ssize_t ocrdma_dbgfs_ops_read(struct file *filp, char __user *buffer,
>                ^

Please fix it, not hide it.

Thanks

> 
> Increase the frame size by 20% to set.
> 
> Signed-off-by: Peng Hao <flyingpeng@xxxxxxxxxxx>
> ---
>  drivers/infiniband/hw/ocrdma/Makefile | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/infiniband/hw/ocrdma/Makefile b/drivers/infiniband/hw/ocrdma/Makefile
> index 14fba95021d8..a1e9fcc04751 100644
> --- a/drivers/infiniband/hw/ocrdma/Makefile
> +++ b/drivers/infiniband/hw/ocrdma/Makefile
> @@ -3,4 +3,10 @@ ccflags-y := -I $(srctree)/drivers/net/ethernet/emulex/benet
>  
>  obj-$(CONFIG_INFINIBAND_OCRDMA)	+= ocrdma.o
>  
> +ifneq ($(CONFIG_FRAME_WARN),0)
> +ifeq ($(filter y,$(CONFIG_KASAN)$(CONFIG_KCSAN)),y)
> +CFLAGS_ocrdma_stats.o = -Wframe-larger-than=22664
> +endif
> +endif
> +
>  ocrdma-y :=	ocrdma_main.o ocrdma_verbs.o ocrdma_hw.o ocrdma_ah.o ocrdma_stats.o
> -- 
> 2.27.0
> 
> 




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux