Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion plan9port build failure on Linux (debian)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Russ Cox  
View profile  
 More options Mar 3 2008, 11:44 pm
Newsgroups: comp.os.plan9
From: r...@swtch.com (Russ Cox)
Date: Tue, 4 Mar 2008 04:44:01 GMT
Local: Mon, Mar 3 2008 11:44 pm
Subject: Re: [9fans] plan9port build failure on Linux (debian)
We tracked this down off-list.

Given these types:

        char *buf;
        uint len;

gcc-4.2 assumes that buf+len >= buf.

The test for wraparound when computing len in sprint looks like:

        len = 1<<30;  /* big number, but sprint is deprecated anyway */
        /*
         * on PowerPC, the stack is near the top of memory, so
         * we must be sure not to overflow a 32-bit pointer.
         */
        if(buf+len < buf)
                len = -(uintptr)buf-1;

gcc-4.2 compiles this away.  Adding some uintptr casts
works around the problem.  This change is checked
into the plan9port code and will be in tomorrows tar file.

Because David is running 32-bit code on a 64-bit kernel,
the stack is near the very top of 32-bit address space
and tickles the gcc-4.2 bug.

It would not surprise me if there are some exploitable
buffer overflows (in standard code, not p9p) now that
gcc is silently discarding checks like this one.

Russ


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google