mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* setgroups32 syscall changes RCX register
@ 2010-06-09 10:57 Pavel N. Iakovenko
  0 siblings, 0 replies; only message in thread
From: Pavel N. Iakovenko @ 2010-06-09 10:57 UTC (permalink / raw)
  To: linux-kernel

Hello

I noticed that setgroups32 syscall changes the value of RCX register. In my
case  - it is increased by PAGE_SIZE. Is it an acceptable behavior?
Kernel version is 2.6.31.6. Testing program is enclosed.

Please CC me on reply.

Best regards,
Pavel Iakovenko

#include <unistd.h>
#include <sys/types.h>
#include <syscall.h>
#include <grp.h>
#include <stdio.h>
#include <errno.h>

int main()
{
            gid_t groups;
            unsigned long rcx;
            int r ;

            r = initgroups("root", groups);
            if (r) {
                printf("initgroups failed\n");
                goto out;
            }
            
            printf("before setgroups32: RCX = 0x%lx\n", (unsigned
long)&groups);

            asm
            (
                        "int $0x80"
                        : "=a" (r), "=c" (rcx)
                        : "a" (SYS_setgroups32), "b"(1), "c" (&groups)
            );

            if (r) {
                printf("setgroups32 failed\n");
                goto out;
            }
            
            printf("after setgroups32: RCX = 0x%lx\n", rcx);

out:
            return 0;
}
 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5184 (20100609) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml
 
ЪТХ╨{.nг+┴╥÷╝┴╜├+%┼кЪ╠Ищ╤\x17╔┼wЪ╨{.nг+┴╥╔┼{╠ЧG╚²ИЪ┼{ay╨\x1dй┤з≥К,j\a╜╒fё╒╥h ▐О│ЙЪ▒ЙГz_Х╝\x03(╜И ▌┼щ╒j"²З\x1a╤^[m╖ЪЪ╬\a╚ЧG╚²ИЪ╒╦?≥╗Х╜з&ёЬ╖~▐А╤iO∙Ф╛z╥ vь^\x14\x04\x1a╤^[m╖ЪЪц\fЪ╤ЛЪ╒╦?√I╔

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-09 10:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-09 10:57 setgroups32 syscall changes RCX register Pavel N. Iakovenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®