If pam is compiled with gcc 3.1 and with -O3, pam accepts any random password when doing a login or an su. Dropping the optimisation level to -O2 solves this problem.
Seemant, I can't reproduce this as described. I'd rather someone else with some pam knowledge take a look at it.
My experience PAM compiled with "-march=pentium3 -O3 -pipe -mfpmath=sse -funroll-all-loops -fomit-frame-pointer -ffast-math -fprefetch-loop-arrays" no password needed to get into system PAM compiled with "-march=pentium3 -O3 -pipe -mfpmath=sse" password needed
Some more info on my compile flags. Things go wrong with "-O3 -march=pentium3 -funroll-all-loops -fomit-frame-pointer -ffast-math -mfpmath=sse -pipe" Keeping the same flags, but changing -O3 to -O2 solved the problem.
after some trial an error i am not able to reproduce this error when i take out "-funroll-all-loops" but leave in "-O3" so "-march=pentium3 -O3 -pipe -mfpmath=sse -fomit-frame-pointer -ffast-math -fprefetch-loop-arrays" =OK "-march=pentium3 -O3 -pipe -mfpmath=sse -funroll-all-loops -fomit-frame-pointer -ffast-math -fprefetch-loop-arrays" =BAD
can't reproduce it with flags "-march=athlon-tbird -O3 -pipe -m3dnow -mmmx -fomit-frame-pointer -funroll-loops -finline-functions -fexpensive-optimizations"
can you test this on gcc3.2 to see if the issue still exists ? cause if it doesnt i say we punt this bug since 3.1 was never a real gcc version we want to support anyways ;)
Could have been the memory corruption bug in pre gcc-3.2.1 (we patched 3.2 to fix this). Can you try this again with 3.2.1, and close if fixed ?