live-patching.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Lawrence <joe.lawrence@redhat.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kbuild@vger.kernel.org,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Miroslav Benes <mbenes@suse.cz>, Petr Mladek <pmladek@suse.com>,
	Marcos Paulo de Souza <mpdesouza@suse.com>
Subject: Re: [PATCH v7 00/10] livepatch: klp-convert tool
Date: Fri, 31 Mar 2023 11:58:20 -0400	[thread overview]
Message-ID: <e37ff5de-f34c-bd86-be04-a21f82612a7e@redhat.com> (raw)
In-Reply-To: <4ce29654-4e1e-4680-9c25-715823ff5e02@p183>

On 3/30/23 08:10, Alexey Dobriyan wrote:
> Joe Lawrence wrote:
>> +static int update_strtab(struct elf *elf)
>> +{
>>
>> +	buf = malloc(new_size);
>> +	if (!buf) {
>> +		WARN("malloc failed");
>> +		return -1;
>> +	}
>> +	memcpy(buf, (void *)strtab->data, orig_size);
> 
> This code is called realloc(). :-)
> 
>> +static int write_file(struct elf *elf, const char *file)
>> +{
>>
>> +	fd = creat(file, 0664);
>> +	e = elf_begin(fd, ELF_C_WRITE, NULL);
> 
> elf_end() doesn't close descriptor, so there is potentially corrupted
> data. There is no unlink() call if writes fail as well.
> 
>> +void elf_close(struct elf *elf)
>> +{
>> +
>> +	if (elf->fd > 0)
>> +		close(elf->fd);
> 
> Techically, it is "fd >= 0".
> 
>> +filechk_klp_map = \
>> +	echo "klp-convert-symbol-data.0.1";		\
>> +	echo "*vmlinux";				\
>> +	$(NM) -f posix vmlinux | cut -d\  -f1;		\
>> +	sort $(MODORDER) $(MODULES_LIVEPATCH) |		\
> 
> This probably should be "LC_ALL=C sort" for speed and reproducibility (?).
> 

Thanks, will incorporate these into the next version.

-- 
Joe


  parent reply	other threads:[~2023-03-31 15:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 12:10 [PATCH v7 00/10] livepatch: klp-convert tool Alexey Dobriyan
2023-03-30 17:04 ` Alexey Dobriyan
2023-03-31 16:03   ` Joe Lawrence
2023-04-01  9:59     ` Alexey Dobriyan
2023-03-31 15:58 ` Joe Lawrence [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-03-06 14:08 Joe Lawrence
2023-03-14 20:23 ` Marcos Paulo de Souza
2023-03-17 20:29   ` Joe Lawrence
2023-03-17 23:20     ` Josh Poimboeuf
2023-03-20 19:23       ` Joe Lawrence
2023-04-11 10:06       ` Nicolai Stange
2023-05-02 23:38         ` Marcos Paulo de Souza
2023-05-03 19:54         ` Joe Lawrence
2023-05-09 20:34           ` Marcos Paulo de Souza
2023-03-20 20:15     ` Marcos Paulo de Souza
2023-04-19 20:27 ` Marcos Paulo de Souza

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=e37ff5de-f34c-bd86-be04-a21f82612a7e@redhat.com \
    --to=joe.lawrence@redhat.com \
    --cc=adobriyan@gmail.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mpdesouza@suse.com \
    --cc=pmladek@suse.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).