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: <YkWD8bV8wSFUobrs@shell.armlinux.org.uk>
Date:   Thu, 31 Mar 2022 11:35:29 +0100
From:   "Russell King (Oracle)" <linux@...linux.org.uk>
To:     Chen Zhongjin <chenzhongjin@...wei.com>
Cc:     alexander.sverdlin@...ia.com, ardb@...nel.org,
        linus.walleij@...aro.org, nico@...xnic.net,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ARM: module: Add all unwind tables when load module

On Thu, Mar 31, 2022 at 06:15:09PM +0800, Chen Zhongjin wrote:
> Hi Russell,
> 
> Thanks for comment! I've pushed v2 patch with your advises.
> 
> > > -	memset(maps, 0, sizeof(maps));
> > > +	INIT_LIST_HEAD(&table_list->mod_list);
> > > +	mod->arch.init_table = NULL;
> > >   	for (s = sechdrs; s < sechdrs_end; s++) {
> > > -		const char *secname = secstrs + s->sh_name;
> > > +		const unsigned int sectype = s->sh_type;
> > Please loose this local variable.
> 
> Also I moved "txtname" inside func params.
> 
> +		const char *txtname = strcmp(".ARM.exidx", secname) == 0 ?
> +				".text" : secname + strlen(".ARM.exidx");
> +		const Elf_Shdr *txt_sec = find_mod_section(hdr, sechdrs, txtname);
> 
> >>>
> 
> +		const Elf_Shdr *txt_sec = find_mod_section(hdr, sechdrs,
> +				strcmp(".ARM.exidx", secname) ?
> +				secname + strlen(".ARM.exidx") : ".text");
> 

Hmm. I wonder whether it should be:

		const Elf_Shdr *txt_sec;
		const char *txtname;

		if (!strcmp(".ARM.exidx", secname))
			txtname = ".text";
		else
			txtname = secname + strlen(".ARM.exidx");

		txt_sec = find_mod_section(hdr, sechdrs, txtname);

which looks cleaner to me.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ