From: Charlie Jenkins <charlie@rivosinc.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>, Ron Economos <re@w6rz.net>,
Samuel Holland <samuel.holland@sifive.com>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] riscv: Safely remove entries from relocation list
Date: Mon, 4 Dec 2023 10:42:00 -0800 [thread overview]
Message-ID: <ZW4dePVEM8sslNAJ@ghost> (raw)
In-Reply-To: <87bkbfzddr.fsf@igel.home>
On Mon, Nov 27, 2023 at 11:42:08AM +0100, Andreas Schwab wrote:
> On Nov 22 2023, Charlie Jenkins wrote:
>
> > @@ -683,17 +700,29 @@ int add_relocation_to_accumulate(struct module *me, int type, void *location,
> >
> > if (!found) {
> > rel_head = kmalloc(sizeof(*rel_head), GFP_KERNEL);
> > +
> > + if (!rel_head)
> > + return -ENOMEM;
> > +
> > rel_head->rel_entry =
> > kmalloc(sizeof(struct list_head), GFP_KERNEL);
> > +
> > + if (!rel_head->rel_entry)
> > + return -ENOMEM;
>
> This leaks rel_head on error.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
> "And now for something completely different."
Thank you for pointing this out, I fixed this issue in the next version
but forgot to respond to this thread.
https://lore.kernel.org/linux-riscv/20231127-module_linking_freeing-v4-1-a2ca1d7027d0@rivosinc.com/
- Charlie
next prev parent reply other threads:[~2023-12-04 18:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 23:31 [PATCH v3 0/2] riscv: Fix issues with module loading Charlie Jenkins
2023-11-22 23:31 ` [PATCH v3 1/2] riscv: Safely remove entries from relocation list Charlie Jenkins
2023-11-27 10:42 ` Andreas Schwab
2023-12-04 18:42 ` Charlie Jenkins [this message]
2023-11-22 23:31 ` [PATCH v3 2/2] riscv: Correct type casting in module loading Charlie Jenkins
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=ZW4dePVEM8sslNAJ@ghost \
--to=charlie@rivosinc.com \
--cc=aou@eecs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=re@w6rz.net \
--cc=samuel.holland@sifive.com \
--cc=schwab@linux-m68k.org \
/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