From: Randy Dunlap <randy.dunlap@oracle.com>
To: Doug Warzecha <Douglas_Warzecha@dell.com>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] firmware/dcdbas: add size check in smi_data_write
Date: Wed, 18 Oct 2006 20:47:36 -0700 [thread overview]
Message-ID: <20061018204736.72755856.randy.dunlap@oracle.com> (raw)
In-Reply-To: <20061019005441.GA8850@sysman-doug.us.dell.com>
On Wed, 18 Oct 2006 19:54:42 -0500 Doug Warzecha wrote:
>
> This patch adds a size check in smi_data_write to prevent possible wrapping problems with large pos values when calling smi_data_buf_realloc on 32-bit.
I think that 'man 2 write' suggests EFBIG instead of EINVAL?
> ---
>
> --- linux-2.6.19-rc2/drivers/firmware/dcdbas.c.orig 2006-10-18 18:52:43.000000000 -0500
> +++ linux-2.6.19-rc2/drivers/firmware/dcdbas.c 2006-10-18 18:55:08.000000000 -0500
> @@ -8,7 +8,7 @@
> *
> * See Documentation/dcdbas.txt for more information.
> *
> - * Copyright (C) 1995-2005 Dell Inc.
> + * Copyright (C) 1995-2006 Dell Inc.
> *
> * This program is free software; you can redistribute it and/or modify
> * it under the terms of the GNU General Public License v2.0 as published by
> @@ -40,7 +40,7 @@
> #include "dcdbas.h"
>
> #define DRIVER_NAME "dcdbas"
> -#define DRIVER_VERSION "5.6.0-2"
> +#define DRIVER_VERSION "5.6.0-3.2"
> #define DRIVER_DESCRIPTION "Dell Systems Management Base Driver"
>
> static struct platform_device *dcdbas_pdev;
> @@ -175,6 +175,9 @@ static ssize_t smi_data_write(struct kob
> {
> ssize_t ret;
>
> + if ((pos + count) > MAX_SMI_DATA_BUF_SIZE)
> + return -EINVAL;
> +
> mutex_lock(&smi_data_lock);
>
> ret = smi_data_buf_realloc(pos + count);
> -
---
~Randy
prev parent reply other threads:[~2006-10-19 3:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-19 0:54 Doug Warzecha
2006-10-19 3:47 ` Randy Dunlap [this message]
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=20061018204736.72755856.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=Douglas_Warzecha@dell.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®