lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230923185226.GE1642130@unreal>
Date:   Sat, 23 Sep 2023 21:52:26 +0300
From:   Leon Romanovsky <leon@...nel.org>
To:     Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc:     Jason Gunthorpe <jgg@...pe.ca>, Matan Barak <matanb@...lanox.com>,
        Doug Ledford <dledford@...hat.com>,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        linux-rdma@...r.kernel.org
Subject: Re: [PATCH] RDMA/cma: Fix the size of a buffer in add_port_entries()

On Sat, Sep 23, 2023 at 08:15:25AM +0200, Christophe JAILLET wrote:
> In order to be sure that 'buff' is never truncated, its size should be
> 11, not 10.
> 
> When building with W=1, this fixes the following warnings:
> 
>   drivers/infiniband/core/cma_configfs.c: In function ‘make_cma_ports’:
>   drivers/infiniband/core/cma_configfs.c:223:57: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
>     223 |                 snprintf(port_str, sizeof(port_str), "%u", i + 1);
>         |                                                         ^
>   drivers/infiniband/core/cma_configfs.c:223:17: note: ‘snprintf’ output between 2 and 11 bytes into a destination of size 10
>     223 |                 snprintf(port_str, sizeof(port_str), "%u", i + 1);
>         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Fixes: 045959db65c67 ("IB/cma: Add configfs for rdma_cm")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
>  drivers/infiniband/core/cma_configfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, it was already fixed.
https://lore.kernel.org/all/a7e3b347ee134167fa6a3787c56ef231a04bc8c2.1694434639.git.leonro@nvidia.com/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ