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]
Message-ID: <CAHkRjk5fuubEQaq2CD1cGE=W+Lf6svE6fN8KyDrY6=i3-=b_RA@mail.gmail.com>
Date:	Mon, 9 Jan 2012 12:05:01 +0000
From:	Catalin Marinas <catalin.marinas@....com>
To:	Tiejun Chen <tiejun.chen@...driver.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] kmemleak/module: only scan the existed data section

On 28 December 2011 08:11, Tiejun Chen <tiejun.chen@...driver.com> wrote:
> We should only scan the sections containing data and it's size is not
> zero as well.
>
> Signed-off-by: Tiejun Chen <tiejun.chen@...driver.com>
> ---
>  kernel/module.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/module.c b/kernel/module.c
> index 12cfa2b..0b93c30 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -2045,6 +2045,8 @@ static void kmemleak_load_module(struct module *mod, Elf_Ehdr *hdr,
>                if (strncmp(secstrings + sechdrs[i].sh_name, ".data", 5) != 0
>                    && strncmp(secstrings + sechdrs[i].sh_name, ".bss", 4) != 0)
>                        continue;
> +               if (sechdrs[i].sh_size == 0)
> +                       continue;
>
>                kmemleak_scan_area((void *)sechdrs[i].sh_addr,
>                                   sechdrs[i].sh_size, GFP_KERNEL);

I would rather move this check to kmemleak.c. But why would it be
needed? Performance? A zero-size area shouldn't be scanned anyway.

-- 
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ