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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 7 Nov 2023 08:32:24 -0800
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     zhaimingbing <zhaimingbing@...s.chinamobile.com>
Cc:     rdunlap@...radead.org, James.Bottomley@...senpartnership.com,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm:hugetlb_cgroup: Fix the wrong format specifier

On Mon,  6 Nov 2023 16:27:23 +0800 zhaimingbing <zhaimingbing@...s.chinamobile.com> wrote:

> The long type should use "%ld" instead of "%lu".
> 
> ...
>
> --- a/mm/hugetlb_cgroup.c
> +++ b/mm/hugetlb_cgroup.c
> @@ -696,7 +696,7 @@ static int __hugetlb_events_show(struct seq_file *seq, bool local)
>  	else
>  		max = atomic_long_read(&h_cg->events[idx][HUGETLB_MAX]);
>  
> -	seq_printf(seq, "max %lu\n", max);
> +	seq_printf(seq, "max %ld\n", max);
>  
>  	return 0;
>  }

Well.  We can't have a negative number of events.  If we had an
atomic_ulong_t, we'd be using that for ->events[].

Perhaps giving `max' an unsigned long type would better represent the
intent in there.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ