ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] suid binaries and ELF Auxiliary Vectors
@ 2009-09-25  7:38 Kirill A. Shutemov
                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Kirill A. Shutemov @ 2009-09-25  7:38 UTC (permalink / raw)
  To: ALT Linux Team development discussions
  Cc: Michail Yakushin, Konstantin A. Lepikhov, Dmitry V. Levin

Может кто-нибудь подскажет, почему suid'ый бинарник получает пустой
auxv?

Маленький testcase:

#include <elf.h>
#include <stdio.h>
#include <unistd.h>

int main(int argc, char **argv, char **envp)
{
        Elf32_auxv_t *auxv;
        while(*envp++ != NULL);

        for (auxv = (Elf32_auxv_t *)envp; auxv->a_type != AT_NULL; auxv++)
                printf("%d: 0x%08x\n", auxv->a_type, auxv->a_un.a_val);

        printf("uid: %d\n", geteuid());

        return 0;
}

Для x86_64, его нужно немного поправить.

Если у исполняемого файла нет suid-бита(или owner == uid), то auxv
печатается нормально иначе получаем только uid. Есть идеи почему?
И где код кторый это делает?

Немного о себе:
$ uname -r
2.6.30-lks-wks-alt1
$ rpm -q glibc-core
glibc-core-2.10.1-alt6

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-09-25 10:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-25  7:38 [devel] suid binaries and ELF Auxiliary Vectors Kirill A. Shutemov
2009-09-25  8:15   ` Kirill A. Shutemov
2009-09-25  8:23     ` Kirill A. Shutemov
2009-09-25  9:12       ` Dmitry V. Levin
2009-09-25  9:24 ` Sergey Vlasov
2009-09-25 10:05   ` Kirill A. Shutemov
2009-09-25 10:20   ` Kirill A. Shutemov
2009-09-25  9:29 ` Andrey Rahmatullin
2009-09-25  9:35   ` Dmitry V. Levin

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git