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: <20061019082218.86aa5405.rdunlap@xenotime.net>
Date:	Thu, 19 Oct 2006 08:22:18 -0700
From:	Randy Dunlap <rdunlap@...otime.net>
To:	Vasily Tarasov <vtaras@...nvz.org>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...l.org>, Jan Kara <jack@...e.cz>,
	Dmitry Mishin <dim@...nvz.org>, Vasily Averin <vvs@...ru>,
	Kirill Korotaev <dev@...nvz.org>,
	OpenVZ Developers List <devel@...nvz.org>
Subject: Re: [PATCH] diskquota: 32bit quota tools on 64bit architectures

On Thu, 19 Oct 2006 16:32:07 +0400 Vasily Tarasov wrote:

> --- linux-2.6.18/arch/ia64/ia32/sys_ia32.c.quot32	2006-09-20 07:42:06.000000000 +0400
> +++ linux-2.6.18/arch/ia64/ia32/sys_ia32.c	2006-10-19 11:17:50.000000000 +0400
> @@ -2545,6 +2545,54 @@ long sys32_fadvise64_64(int fd, __u32 of
>  			       advice); 
>  } 
>  
> +asmlinkage long sys32_quotactl(unsigned int cmd, const char __user *special,
> +						qid_t id, void __user *addr)
> +{
> +
> +	switch (cmds) {
> +		case Q_GETQUOTA:
> +			old_fs = get_fs();
> +			set_fs(KERNEL_DS);
> +			ret = sys_quotactl(cmd, special, id, &dqblk);
> +			set_fs(old_fs);
> +			memcpy(&dqblk32, &dqblk, sizeof(dqblk32));
> +			dqblk32.dqb_valid = dqblk.dqb_valid;
> +			if (copy_to_user(addr, &dqblk32, sizeof(dqblk32)))
> +				return -EFAULT;
> +			break;
> +		case Q_SETQUOTA:
> +			if (copy_from_user(&dqblk32, addr, sizeof(dqblk32)))
> +				return -EFAULT;
> +			memcpy(&dqblk, &dqblk32, sizeof(dqblk32));
> +			dqblk.dqb_valid = dqblk32.dqb_valid;
> +			old_fs = get_fs();
> +			set_fs(KERNEL_DS);
> +			ret = sys_quotactl(cmd, special, id, &dqblk);
> +			set_fs(old_fs);
> +			break;
> +		default:
> +			return sys_quotactl(cmd, special, id, addr);
> +	}
> +	return ret;
> +}

Please align the switch and case/default source lines.
We prefer not to "double-indent" each case block inside a switch.

I suppose I should try to add this to CodingStyle since it's
not there.

> --- linux-2.6.18/arch/x86_64/ia32/sys_ia32.c.quot32	2006-09-20 07:42:06.000000000 +0400
> +++ linux-2.6.18/arch/x86_64/ia32/sys_ia32.c	2006-10-19 11:00:18.000000000 +0400
> @@ -915,3 +915,50 @@ long sys32_lookup_dcookie(u32 addr_low, 
>  	return sys_lookup_dcookie(((u64)addr_high << 32) | addr_low, buf, len);
>  }
>  
> +asmlinkage long sys32_quotactl(unsigned int cmd, const char __user *special,
> +						qid_t id, void __user *addr)
> +{
> +
> +	switch (cmds) {
> +		case Q_GETQUOTA:
> +			old_fs = get_fs();
> +			set_fs(KERNEL_DS);
> +			ret = sys_quotactl(cmd, special, id, &dqblk);
> +			set_fs(old_fs);
> +			memcpy(&dqblk32, &dqblk, sizeof(dqblk32));
> +			dqblk32.dqb_valid = dqblk.dqb_valid;
> +			if (copy_to_user(addr, &dqblk32, sizeof(dqblk32)))
> +				return -EFAULT;
> +			break;
> +		case Q_SETQUOTA:
> +			if (copy_from_user(&dqblk32, addr, sizeof(dqblk32)))
> +				return -EFAULT;
> +			memcpy(&dqblk, &dqblk32, sizeof(dqblk32));
> +			dqblk.dqb_valid = dqblk32.dqb_valid;
> +			old_fs = get_fs();
> +			set_fs(KERNEL_DS);
> +			ret = sys_quotactl(cmd, special, id, &dqblk);
> +			set_fs(old_fs);
> +			break;
> +		default:
> +			return sys_quotactl(cmd, special, id, addr);
> +	}


---
~Randy
-
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