TUCoPS :: HP Unsorted G :: b06-1681.htm

Gcc 4.1 bug miscompiles pointer range checks, may place you at risk
gcc 4.1 bug miscompiles pointer range checks, may place you at risk
gcc 4.1 bug miscompiles pointer range checks, may place you at risk



I wrote a small library of functions to do typical range checks as they
are needed in code that handles incoming packets or messages from
untrusted sources.  My impetus was SMB code, in case you want to know.

Here is one of my functions:

static inline int range_ptrinbuf(const void* buf,unsigned long len,const void* ptr) {
  register const char* c=(const char*)buf;      /* no pointer arithmetic on void* */
  return (c && c+len>c && (const char*)ptr-cc" is the code with which you would
typically check for integer overflows, which is a check that for example
an IP stack would do, or Samba.  So, if you compiled your kernel with
gcc 4.1, or your Samba, or some other packet handling code in a security
relevant context, you might want to recompile with gcc 3.

Felix

TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2024 AOH