pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/45326: security/sudo dies



The following reply was made to PR pkg/45326; it has been noted by GNATS.

From: David Holland <dholland-pbugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/45326: security/sudo dies
Date: Sun, 18 Sep 2011 23:22:00 +0000

 On Tue, Sep 06, 2011 at 09:35:03AM +0000, Hauke Fath wrote:
  >      /* Allocate space for struct item, struct passwd and the strings. */
  >      if ((item = malloc(total)) == NULL)
  >         return NULL;
  >      cp = (char *) item + sizeof(struct cache_item);
  >  
  >      /*
  >       * Copy in passwd contents and make strings relative to space
  >       * at the end of the buffer.
  >       */
  >      newpw = (struct passwd *) cp;
  >      memcpy(newpw, pw, sizeof(struct passwd));
  >  *BUS ERROR*
  >  
  >  -- can somebody with sufficient SPARC fu comment on potential alignment
  >  issues of the "cp = (char *) item ..." line?
 
 Because item comes from malloc, it should be maximally aligned.
 Therefore, it depends on what the compiler thinks the required
 alignment of struct cache_item is, and that depends at least in part
 on what's in it.
 
 I've been meaning to go check before writing this response, but that
 could add another two weeks' latency...
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index