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: <20091216.112402.226798335.d.hatayama@jp.fujitsu.com>
Date:	Wed, 16 Dec 2009 11:24:02 +0900 (JST)
From:	Daisuke HATAYAMA <d.hatayama@...fujitsu.com>
To:	xiyou.wangcong@...il.com
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	jdike@...toit.com, tony.luck@...el.com, mhiramat@...hat.com
Subject: Re: [RFC, PATCH 4/4] elf_core_dump(): Add extended numbering
 support


I agree with two of three cleanup ideas, but the last.

> > @@ -2079,11 +2139,19 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file, un
> >        if (!elf_core_write_extra_data(file, &size, limit))
> >                goto end_coredump;
> >
> > +       if (e_phnum == PN_XNUM) {
> > +               size += sizeof(*shdr4extnum);
> > +               if (size > limit
> > +                   || !dump_write(file, shdr4extnum, sizeof(*shdr4extnum)))
> > +                       goto end_coredump;
> > +       }
> > +
> >  end_coredump:

There are two reasons I wrote like this.

First, the code like

if (size > limit || !dump_write(file, obj, sizeof(*obj)))
   goto end_coredump;

is used as the common idiom in thourghout elf_core_dump().  Not
writing goto only at the last use seems unnatural for me.

Second, there is a possibility that new writing operation for section
header table will be added. If the goto is removed now, the patch
writer must rewrite it again.

Thanks for your comments.
--
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