Re: Problems with Race condition (binfmt_misc)

Dr. Werner Fink (werner@suse.de)
Thu, 15 May 1997 11:47:50 +0200


> This is the following part from sys_read from fs/read_write.c:
> error = -EBADF;
> if (!(file->f_mode & 1))
> goto out;
> error = -EINVAL;
> if (!file->f_op || !file->f_op->read)

On the first try this should look like

if (!file->f_op && !file->f_op->read)

shouldn't it?

> goto out;
> error = 0;
> if (count <= 0)
> goto out;
>
> The Oops occures at the !file->f_op->read test, i.e. file->f_op is invalid!

Werner