LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Tomas Bortoli <tomasbortoli@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] trace: Avoid memory leak in predicate_parse()
Date: Tue, 28 May 2019 17:32:58 +0200	[thread overview]
Message-ID: <7abc7172-11fd-b0e3-6381-f976c5450d4f@gmail.com> (raw)
In-Reply-To: <20190528112956.4cf2dd9c@gandalf.local.home>

On 5/28/19 5:29 PM, Steven Rostedt wrote:
> On Tue, 28 May 2019 17:18:59 +0200
> Tomas Bortoli <tomasbortoli@gmail.com> wrote:
> 
>>>> +	memset(prog_stack, 0, nr_preds * sizeof(*prog_stack));
>>>> +  
>>>
>>> Can you instead just switch the allocation of prog_stack to use
>>> kcalloc()?  
>>
>> kmalloc_array() is safe against arithmetic overflow of the arguments.
>> Using kcalloc() directly we wouldn't check for that. Not really ideal in
>> my opinion. And there's no kcalloc_array() apparently!
> 
> But doesn't kcalloc() simply call kmalloc_array() with the GFP_ZERO
> flag?
> 

It does! Oops, I'll send it shortly

Tomas


  reply	other threads:[~2019-05-28 15:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-28 13:46 Tomas Bortoli
2019-05-28 14:44 ` Steven Rostedt
2019-05-28 15:18   ` Tomas Bortoli
2019-05-28 15:29     ` Steven Rostedt
2019-05-28 15:32       ` Tomas Bortoli [this message]
2019-05-28 15:43   ` Tomas Bortoli
2019-05-28 15:48     ` Steven Rostedt
2019-05-28 15:55       ` Tomas Bortoli
2019-05-28 20:31     ` Steven Rostedt
2019-05-28 20:48       ` Tomas Bortoli

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=7abc7172-11fd-b0e3-6381-f976c5450d4f@gmail.com \
    --to=tomasbortoli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --subject='Re: [PATCH] trace: Avoid memory leak in predicate_parse()' \
    /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

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).