From: BlaisorBlade <blaisorblade_spam@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] Little heap overflow in mconsole_kern.c
Date: Tue, 16 Sep 2003 15:59:18 +0200 [thread overview]
Message-ID: <200309161559.18993.blaisorblade_spam@yahoo.it> (raw)
In that file(releases 2.4.22-3um and -4um at least), we have this code:
[...]
void mconsole_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
int fd;
struct mconsole_entry *new;
struct mc_request req;
[...]
new = kmalloc(sizeof(req), GFP_ATOMIC);
if(new == NULL)
mconsole_reply(&req, "Out of memory", 1, 0);
else {
new->request = req;
list_add(&new->list, &mc_requests);
}
[...]
While new points to a mconsole_entry, the code allocates sizeof(mc_request),
not sizeof(mconsole_entry), which is less than needed. I've looked for any
reasons for this to be correct(even in the weird Linux list implementation),
but seems just a typo(not noticed since the actual overflow is unlikely to
happen, but it's there). Could you change it?(I didn't post a patch because
it's simpler to edit the code at hand).
--
cat <<EOSIGN
Paolo Giarrusso, aka Blaisorblade
Linux Kernel 2.4.21/2.6.0-test on an i686; Linux registered user n. 292729
EOSIGN
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next reply other threads:[~2003-09-16 18:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-16 13:59 BlaisorBlade [this message]
2003-09-18 0:22 ` [uml-devel] Little heap overflow in mconsole_kern.c Jeff Dike
2003-09-18 2:53 ` Geoff Thorpe
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=200309161559.18993.blaisorblade_spam@yahoo.it \
--to=blaisorblade_spam@yahoo.it \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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