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: <20201023071503.GA30563@lst.de>
Date:   Fri, 23 Oct 2020 09:15:03 +0200
From:   Christoph Hellwig <hch@....de>
To:     Nick Desaulniers <nick.desaulniers@...il.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Christoph Hellwig <hch@....de>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] bdi: fix -Wformat-security

On Thu, Oct 22, 2020 at 11:57:54PM -0700, Nick Desaulniers wrote:
> mm/backing-dev.c:810:57: warning: format string is not a string literal
> (potentially insecure) [-Wformat-security]
> dev = device_create(bdi_class, NULL, MKDEV(0, 0), bdi, bdi->dev_name);

The callers never pass format strings here.  That being said the fix is
probably ok anyway, modulo the obvious style issue.

> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index 408d5051d05b..5755578d671d 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -807,7 +807,7 @@ int bdi_register_va(struct backing_dev_info *bdi, const char *fmt, va_list args)
>  		return 0;
>  
>  	vsnprintf(bdi->dev_name, sizeof(bdi->dev_name), fmt, args);
> -	dev = device_create(bdi_class, NULL, MKDEV(0, 0), bdi, bdi->dev_name);
> +	dev = device_create(bdi_class, NULL, MKDEV(0, 0), bdi, "%s", bdi->dev_name);

Please don't introduce any over 80 char lines.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ