broken kernel syscalls on ppc64

Denis J Barrow DJ at de.ibm.com
Wed May 28 02:57:52 EST 2003


Hi Anton/Others,

I am opening & reading a file from the kernel in the context of a 32 bit
bash process,

i.e.
I am echoing 1 to a sysfs file to cause the kernel to read a file.
echo 1 > /sys/file

the kludge I am doing at the moment & it is working is.


int   saved_32bit=test_and_clear_thread_flag(TIF_32BIT);

& when I am finished loading the file ( doing the kernel syscalls ) I am
doing.

if(saved_32bit)
      set_thread_flag(TIF_32BIT);

P.S.I added a fstat64 to my copy misc.S to get the file size.

D.J. Barrow
Linux Kernel Developer
dj at de.ibm.com,barrow_dj at yahoo.com
Phone:0049-7031-16-2943



                      Anton Blanchard
                      <anton at samba.org>        To:       Denis J Barrow/Germany/Contr/IBM at IBMDE
                                               cc:       paulus at samba.org, David
                      05/27/03 06:13 PM         Boutcher/Rochester/IBM at IBMUS, mfrueh at suse.de,
                                                linuxppc64-dev at lists.linuxppc.org
                                               Subject:  Re: broken kernel syscalls on ppc64







> I am developing with 2.5.66 & SLES 8 from suse
> as most of the apps on SLES8 are 32 bit the check below is broken.
>
> The reason being if a syscall is made from the kernel in the context of a
> 32 bit process
> e.g. bash the syscall code below will incorrectly assume it the syscall
is
> being made with 32 bit
> parameters.

Interesting. Could you summarise what the application/kernel is doing
here exactly? There are only a few syscalls we allow to be called out
of the kernel, and they only seem to be used during boot.

extern pid_t setsid(void);
extern int write(int fd, const char *buf, off_t count);
extern int read(int fd, char *buf, off_t count);
extern off_t lseek(int fd, off_t offset, int count);
extern int dup(int fd);
extern int execve(const char *file, char **argv, char **envp);
extern int open(const char *file, int flag, int mode);
extern int close(int fd);
extern pid_t waitpid(pid_t pid, int *wait_stat, int options);

Anton


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list