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: <200705030009.11502.arnd@arndb.de>
Date:	Thu, 3 May 2007 00:09:11 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Paul Fulghum <paulkf@...rogate.com>
Cc:	Andrew Morton <akpm@...l.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] synclink_gt add compat_ioctl

On Wednesday 02 May 2007, Paul Fulghum wrote:
> +	switch (cmd) {
> +
> +	case MGSL_IOCSPARAMS32:
> +		rc = set_params32(info, (struct MGSL_PARAMS32 __user *)compat_ptr(arg));
> +		break;
> +
> +	case MGSL_IOCGPARAMS32:
> +		rc = get_params32(info, (struct MGSL_PARAMS32 __user *)compat_ptr(arg));
> +		break;

No need for the cast here.

> +
> +	spin_lock_irqsave(&info->lock, flags);

no need for _irqsave, just use spin_{,un}lock_irq() when you know that
interrupts are enabled.

> --- a/include/linux/synclink.h	2007-04-25 22:08:32.000000000 -0500
> +++ b/include/linux/synclink.h	2007-05-02 14:59:17.000000000 -0500
> @@ -167,6 +167,24 @@ typedef struct _MGSL_PARAMS
>  
>  } MGSL_PARAMS, *PMGSL_PARAMS;
>  
> +/* provide 32 bit ioctl compatibility on 64 bit systems */
> +struct MGSL_PARAMS32
> +{
> +	unsigned int	mode;
> +	unsigned char	loopback;
> +	unsigned short	flags;
> +	unsigned char	encoding;
> +	unsigned int	clock_speed;
> +	unsigned char	addr_filter;
> +	unsigned short	crc_type;
> +	unsigned char	preamble_length;
> +	unsigned char	preamble;
> +	unsigned int	data_rate;
> +	unsigned char	data_bits;
> +	unsigned char	stop_bits;
> +	unsigned char	parity;
> +};

The definition is correct, but by convention it would be better to use
compat_ulong_t instead of unsigned int for those fields that are an
unsigned long in native mode.

	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