linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taras Kondratiuk <takondra@cisco.com>
To: "H. Peter Anvin" <hpa@zytor.com>,
	Al Viro <viro@zeniv.linux.org.uk>, Arnd Bergmann <arnd@arndb.de>,
	James McMechan <james.w.mcmechan@gmail.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Mimi Zohar <zohar@linux.vnet.ibm.com>,
	Rob Landley <rob@landley.net>
Cc: initramfs@vger.kernel.org, Victor Kamensky <kamensky@cisco.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	xe-linux-external@cisco.com
Subject: Re: [PATCH v2 11/15] gen_init_cpio: add newcx format
Date: Fri, 26 Jan 2018 12:37:14 -0800	[thread overview]
Message-ID: <151699903485.21956.15795523878472133751@takondra-t460s> (raw)
In-Reply-To: <b3451193-0666-d929-01f3-29d3872bd5d4@landley.net>

Quoting Rob Landley (2018-01-25 18:40:25)
> On 01/24/2018 09:27 PM, Taras Kondratiuk wrote:
> > diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c
> > index 7a2a6d85345d..78a47a5bdcb1 100644
> > --- a/usr/gen_init_cpio.c
> > +++ b/usr/gen_init_cpio.c
> > @@ -10,6 +10,7 @@
> >  #include <errno.h>
> >  #include <ctype.h>
> >  #include <limits.h>
> > +#include <assert.h>
> 
> You're adding an assert? Really?
> 
> >       fputs(s, stdout);
> > -     offset += 110;
> > +     assert((offset & 3) == 0);
> > +     offset += cpio_hdr_size;
> 
> Why?

Current code assumes that previous file entry in cpio is padded to 4
byte boundary. The assert just captures this assumption. It should be
true unless there is a bug in the code and some padding is missing.

Actually this assert should be a part of the next patch (#12) that
modifies padding code.

  reply	other threads:[~2018-01-26 20:37 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25  3:27 [PATCH v2 00/15] extend initramfs archive format to support xattrs Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 01/15] Documentation: add newcx initramfs format description Taras Kondratiuk
2018-01-25  9:29   ` Arnd Bergmann
2018-01-25 20:26     ` Taras Kondratiuk
2018-01-25 21:02       ` Arnd Bergmann
2018-01-25 22:13         ` Taras Kondratiuk
2018-01-26  2:39     ` Rob Landley
2018-01-26  9:04       ` Arnd Bergmann
2018-01-26 10:31       ` Henrique de Moraes Holschuh
2018-01-26 15:51         ` Victor Kamensky
2018-01-26 18:15           ` Henrique de Moraes Holschuh
2018-01-26  2:40   ` Rob Landley
2018-01-26 21:02     ` Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 02/15] initramfs: replace states with function pointers Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 03/15] initramfs: store file name in name_buf Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 04/15] initramfs: remove unnecessary symlinks processing shortcut Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 05/15] initramfs: move files creation into separate state Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 06/15] initramfs: separate reading cpio method from header Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 07/15] initramfs: split header layout information from parsing function Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 08/15] initramfs: add newcx format Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 09/15] initramfs: set extended attributes Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 10/15] gen_init_cpio: move header formatting into function Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 11/15] gen_init_cpio: add newcx format Taras Kondratiuk
2018-01-26  2:40   ` Rob Landley
2018-01-26 20:37     ` Taras Kondratiuk [this message]
2018-01-25  3:27 ` [PATCH v2 12/15] gen_init_cpio: set extended attributes for " Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 13/15] gen_initramfs_list.sh: add -x option to enable " Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 14/15] selinux: allow setxattr on rootfs so initramfs code can set them Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 15/15] selinux: delay sid population for rootfs till init is complete Taras Kondratiuk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=151699903485.21956.15795523878472133751@takondra-t460s \
    --to=takondra@cisco.com \
    --cc=arnd@arndb.de \
    --cc=corbet@lwn.net \
    --cc=hpa@zytor.com \
    --cc=initramfs@vger.kernel.org \
    --cc=james.w.mcmechan@gmail.com \
    --cc=kamensky@cisco.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=rob@landley.net \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xe-linux-external@cisco.com \
    --cc=zohar@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).