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]
Date:	Tue, 06 May 2008 04:45:02 +0900
From:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To:	Miklos Szeredi <miklos@...redi.hu>
Cc:	akpm@...ux-foundation.org, hch@...radead.org,
	viro@...IV.linux.org.uk, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org
Subject: Re: [patch 08/15] fat: dont call notify_change

Miklos Szeredi <miklos@...redi.hu> writes:

> From: Miklos Szeredi <mszeredi@...e.cz>
>
> The FAT_IOCTL_SET_ATTRIBUTES ioctl() calls notify_change() to change
> the file mode before changing the inode attributes.  Replace with
> explicit call to fat_setattr().
>
> This is equivalent, except that security_inode_setattr() is not called
> before fat_setattr().  I think this is not needed, since the mode
> change is just a side effect of the attribute change.
>
> Signed-off-by: Miklos Szeredi <mszeredi@...e.cz>
> CC: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>

Looks good. I'm not sure about the intent of security_inode_setattr()
though.

> Index: linux-2.6/fs/fat/file.c
> ===================================================================
> --- linux-2.6.orig/fs/fat/file.c	2008-05-05 11:29:20.000000000 +0200
> +++ linux-2.6/fs/fat/file.c	2008-05-05 11:29:26.000000000 +0200
> @@ -16,6 +16,7 @@
>  #include <linux/writeback.h>
>  #include <linux/backing-dev.h>
>  #include <linux/blkdev.h>
> +#include <linux/fsnotify.h>
>  
>  int fat_generic_ioctl(struct inode *inode, struct file *filp,
>  		      unsigned int cmd, unsigned long arg)
> @@ -65,6 +66,7 @@ int fat_generic_ioctl(struct inode *inod
>  
>  		/* Equivalent to a chmod() */
>  		ia.ia_valid = ATTR_MODE | ATTR_CTIME;
> +		ia.ia_ctime = current_fs_time(inode->i_sb);
>  		if (is_dir) {
>  			ia.ia_mode = MSDOS_MKMODE(attr,
>  				S_IRWXUGO & ~sbi->options.fs_dmask)
> @@ -92,10 +94,11 @@ int fat_generic_ioctl(struct inode *inod
>  		}
>  
>  		/* This MUST be done before doing anything irreversible... */
> -		err = notify_change(filp->f_path.dentry, &ia);
> +		err = fat_setattr(filp->f_path.dentry, &ia);
>  		if (err)
>  			goto up;
>  
> +		fsnotify_change(filp->f_path.dentry, ia.ia_valid);
>  		if (sbi->options.sys_immutable) {
>  			if (attr & ATTR_SYS)
>  				inode->i_flags |= S_IMMUTABLE;
>
> --

-- 
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
--
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