ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Cc: Michail Yakushin <silicium@altlinux.org>,
	"Konstantin A. Lepikhov" <lakostis@unsafe.ru>,
	"Dmitry V. Levin" <ldv@altlinux.org>
Subject: [devel] suid binaries and ELF Auxiliary Vectors
Date: Fri, 25 Sep 2009 10:38:50 +0300
Message-ID: <cc557aab0909250038l20f2cdc3v9f89234b1732b2c@mail.gmail.com> (raw)

Может кто-нибудь подскажет, почему 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

             reply	other threads:[~2009-09-25  7:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-25  7:38 Kirill A. Shutemov [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cc557aab0909250038l20f2cdc3v9f89234b1732b2c@mail.gmail.com \
    --to=kirill@shutemov.name \
    --cc=devel@lists.altlinux.org \
    --cc=lakostis@unsafe.ru \
    --cc=ldv@altlinux.org \
    --cc=silicium@altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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