From: Dan Rosenberg <drosenberg@vsecurity.com>
To: segooon@gmail.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: tidspbridge: fix signess error
Date: Mon, 11 Oct 2010 16:24:03 -0400 [thread overview]
Message-ID: <1286828643.2762.76.camel@dan> (raw)
In-Reply-To: <1286827491.2762.69.camel@dan>
It seems to me that in a lot of cases, signed types were used initially
with checks that the value was not below zero, but then unsigned types
were substituted due to problems later on (potentially security
related), and the checks were never removed. Just because a check
doesn't make sense doesn't necessarily mean it's safe to revert an
unsigned type to a signed one - just be careful to make sure you're not
introducing any problems when you make these kinds of changes. I have
no idea whether or not this is the case in this particular example.
> i was unsigned, so check for (i < 0) made no sense. Made it signed.
>
> Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
> ---
> I cannot compile this driver, so it is not tested.
> drivers/staging/tidspbridge/core/dsp-mmu.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
> diff --git a/drivers/staging/tidspbridge/core/dsp-mmu.c b/drivers/staging/tidspbridge/core/dsp-mmu.c
> index 3c978f9..983c95a 100644
> --- a/drivers/staging/tidspbridge/core/dsp-mmu.c
> +++ b/drivers/staging/tidspbridge/core/dsp-mmu.c
> @@ -219,7 +219,8 @@ u32 user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, u32 size,
> struct page **usr_pgs)
> {
> int res, w;
> - unsigned pages, i;
> + unsigned pages;
> + int i;
> struct vm_area_struct *vma;
> struct mm_struct *mm = current->mm;
> struct sg_table *sgt;
> --
> 1.7.0.4
next parent reply other threads:[~2010-10-11 20:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1286827491.2762.69.camel@dan>
2010-10-11 20:24 ` Dan Rosenberg [this message]
2010-10-12 16:48 ` [PATCH] staging: tidspbridge: fix signess error Vasiliy Kulikov
2010-10-10 17:28 Vasiliy Kulikov
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=1286828643.2762.76.camel@dan \
--to=drosenberg@vsecurity.com \
--cc=linux-kernel@vger.kernel.org \
--cc=segooon@gmail.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