The LD_PRELOAD environment variable is used by the Linux dynamic linker/loader ld.so and, if set, contains a list of shared objects to be loaded with the executable before any other shared object is loaded, including libc.so. This means that we may create a shared object, which would export a symbol named gets, and specify this shared object in LD_PRELOAD, which would guarantee, that if the executable we are attempting to run imports a symbol with the same name, our implementation of gets would be linked instead of the one from libc.so, which would be loaded afterward.