lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200812181334.33719.arnd@arndb.de>
Date:	Thu, 18 Dec 2008 13:34:33 +0100
From:	Arnd Bergmann <arnd@...db.de>
To:	Gerd Hoffmann <kraxel@...hat.com>
Cc:	linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
	linux-api@...r.kernel.org, aarcange@...hat.com
Subject: Re: [PATCH v4 2/3] Add preadv and pwritev system calls.

On Thursday 18 December 2008, Gerd Hoffmann wrote:
> This prototype has one problem though:  On 32bit archs is the (64bit)
> offset argument unaligned, which the syscall ABI of several archs
> doesn't allow to do.  At least s390 needs a wrapper in glibc to handle
> this.  As we'll need a wrappers in glibc anyway I've decided to push
> problem to glibc entriely and use a syscall prototype which works
> without arch-specific wrappers inside the kernel:  The offset argument
> is explicitly splitted into two 32bit values.

Obviously, the interface looks good to me now.

Please remember to add the function prototypes to
include/linux/syscalls.h.

> +asmlinkage ssize_t
> +compat_sys_preadv(unsigned long fd, const struct compat_iovec __user *vec,
> +                  unsigned long vlen, u32 pos_high, u32 pos_low)
> +{
> +        loff_t pos = ((loff_t)pos_high << 32) | pos_low;

This is whitespace damaged, as are the other four functions in the
same place.

> +	struct file *file;
> +	ssize_t ret = -EBADF;
> +
> +	if (pos < 0)
> +		return -EINVAL;
> +
> +	file = fget(fd);
> +	if (!file)
> +		return -EBADF;

Any reason for using fget() here, but fget_light() in sys_preadv?

> +	if (!(file->f_mode & FMODE_READ))
> +		goto out;
> +
> +	ret = -EINVAL;
> +	if (!file->f_op || (!file->f_op->aio_read && !file->f_op->read))
> +		goto out;

Maybe this logic could get moved into a compat_readv() function,
similar to vfs_readv(). The advantage would be that we can make
the native and compat paths more similar.

	Arnd <><
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ