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>] [day] [month] [year] [list]
Date:   Sat, 1 Oct 2022 22:09:13 +0200 (CEST)
From:   Julia Lawall <julia.lawall@...ia.fr>
To:     Christian Brauner <brauner@...nel.org>
cc:     linux-kernel@...r.kernel.org,
        GNU/Weeb Mailing List <gwml@...r.gnuweeb.org>,
        Ammar Faizi <ammarfaizi2@...weeb.org>, kbuild-all@...ts.01.org
Subject: [ammarfaizi2-block:brauner/linux/fs.acl.rework.v1 9/37]
 fs/orangefs/orangefs-utils.c:371:64-68: duplicated argument to & or |
 (fwd)

See line 371 where "mode" occurs twice.

julia

---------- Forwarded message ----------
Date: Sun, 2 Oct 2022 03:36:32 +0800
From: kernel test robot <lkp@...el.com>
To: kbuild@...ts.01.org
Cc: lkp@...el.com, Julia Lawall <julia.lawall@...6.fr>
Subject: [ammarfaizi2-block:brauner/linux/fs.acl.rework.v1 9/37]
    fs/orangefs/orangefs-utils.c:371:64-68: duplicated argument to & or |

BCC: lkp@...el.com
CC: kbuild-all@...ts.01.org
CC: Ammar Faizi <ammarfaizi2@...weeb.org>
CC: "GNU/Weeb Mailing List" <gwml@...r.gnuweeb.org>
CC: linux-kernel@...r.kernel.org
TO: Christian Brauner <brauner@...nel.org>

tree:   https://github.com/ammarfaizi2/linux-block brauner/linux/fs.acl.rework.v1
head:   6d56d354d97c08df55b4c06e1f45903f000b7c7c
commit: d52ec74bebeff1b13fd49bf91ee0f46063e0c418 [9/37] fs: pass dentry to set acl method
:::::: branch date: 9 days ago
:::::: commit date: 9 days ago
config: x86_64-randconfig-c022
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
| Reported-by: Julia Lawall <julia.lawall@...6.fr>

cocci warnings: (new ones prefixed by >>)
>> fs/orangefs/orangefs-utils.c:371:64-68: duplicated argument to & or |

vim +371 fs/orangefs/orangefs-utils.c

266626339b688e Martin Brandenburg 2016-03-17  235
d52ec74bebeff1 Christian Brauner  2022-09-06  236  int __orangefs_inode_getattr(struct inode *inode, umode_t mode, int flags)
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  237  {
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  238  	struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode);
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  239  	struct orangefs_kernel_op_s *new_op;
9f8fd53cd05596 Martin Brandenburg 2018-05-31  240  	loff_t inode_size;
266626339b688e Martin Brandenburg 2016-03-17  241  	int ret, type;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  242
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  243  	gossip_debug(GOSSIP_UTILS_DEBUG, "%s: called on inode %pU flags %d\n",
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  244  	    __func__, get_khandle_from_ino(inode), flags);
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  245
afd9fb2a31797b Martin Brandenburg 2018-02-13  246  again:
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  247  	spin_lock(&inode->i_lock);
8b60785c1d7c63 Martin Brandenburg 2018-02-07  248  	/* Must have all the attributes in the mask and be within cache time. */
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  249  	if ((!flags && time_before(jiffies, orangefs_inode->getattr_time)) ||
85ac799cf926a5 Martin Brandenburg 2018-02-22  250  	    orangefs_inode->attr_valid || inode->i_state & I_DIRTY_PAGES) {
afd9fb2a31797b Martin Brandenburg 2018-02-13  251  		if (orangefs_inode->attr_valid) {
afd9fb2a31797b Martin Brandenburg 2018-02-13  252  			spin_unlock(&inode->i_lock);
afd9fb2a31797b Martin Brandenburg 2018-02-13  253  			write_inode_now(inode, 1);
afd9fb2a31797b Martin Brandenburg 2018-02-13  254  			goto again;
afd9fb2a31797b Martin Brandenburg 2018-02-13  255  		}
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  256  		spin_unlock(&inode->i_lock);
71680c18c8f22d Martin Brandenburg 2016-06-09  257  		return 0;
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  258  	}
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  259  	spin_unlock(&inode->i_lock);
71680c18c8f22d Martin Brandenburg 2016-06-09  260
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  261  	new_op = op_alloc(ORANGEFS_VFS_OP_GETATTR);
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  262  	if (!new_op)
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  263  		return -ENOMEM;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  264  	new_op->upcall.req.getattr.refn = orangefs_inode->refn;
68a24a6cc4a602 Martin Brandenburg 2017-04-25  265  	/*
68a24a6cc4a602 Martin Brandenburg 2017-04-25  266  	 * Size is the hardest attribute to get.  The incremental cost of any
68a24a6cc4a602 Martin Brandenburg 2017-04-25  267  	 * other attribute is essentially zero.
68a24a6cc4a602 Martin Brandenburg 2017-04-25  268  	 */
8b60785c1d7c63 Martin Brandenburg 2018-02-07  269  	if (flags)
71680c18c8f22d Martin Brandenburg 2016-06-09  270  		new_op->upcall.req.getattr.mask = ORANGEFS_ATTR_SYS_ALL_NOHINT;
68a24a6cc4a602 Martin Brandenburg 2017-04-25  271  	else
68a24a6cc4a602 Martin Brandenburg 2017-04-25  272  		new_op->upcall.req.getattr.mask =
68a24a6cc4a602 Martin Brandenburg 2017-04-25  273  		    ORANGEFS_ATTR_SYS_ALL_NOHINT & ~ORANGEFS_ATTR_SYS_SIZE;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  274
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  275  	ret = service_operation(new_op, __func__,
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  276  	    get_interruptible_flag(inode));
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  277  	if (ret != 0)
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  278  		goto out;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  279
afd9fb2a31797b Martin Brandenburg 2018-02-13  280  again2:
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  281  	spin_lock(&inode->i_lock);
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  282  	/* Must have all the attributes in the mask and be within cache time. */
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  283  	if ((!flags && time_before(jiffies, orangefs_inode->getattr_time)) ||
85ac799cf926a5 Martin Brandenburg 2018-02-22  284  	    orangefs_inode->attr_valid || inode->i_state & I_DIRTY_PAGES) {
afd9fb2a31797b Martin Brandenburg 2018-02-13  285  		if (orangefs_inode->attr_valid) {
afd9fb2a31797b Martin Brandenburg 2018-02-13  286  			spin_unlock(&inode->i_lock);
afd9fb2a31797b Martin Brandenburg 2018-02-13  287  			write_inode_now(inode, 1);
afd9fb2a31797b Martin Brandenburg 2018-02-13  288  			goto again2;
afd9fb2a31797b Martin Brandenburg 2018-02-13  289  		}
85ac799cf926a5 Martin Brandenburg 2018-02-22  290  		if (inode->i_state & I_DIRTY_PAGES) {
85ac799cf926a5 Martin Brandenburg 2018-02-22  291  			ret = 0;
85ac799cf926a5 Martin Brandenburg 2018-02-22  292  			goto out_unlock;
85ac799cf926a5 Martin Brandenburg 2018-02-22  293  		}
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  294  		gossip_debug(GOSSIP_UTILS_DEBUG, "%s: in cache or dirty\n",
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  295  		    __func__);
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  296  		ret = 0;
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  297  		goto out_unlock;
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  298  	}
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  299
8b60785c1d7c63 Martin Brandenburg 2018-02-07  300  	if (!(flags & ORANGEFS_GETATTR_NEW)) {
480e5ae9b860c8 Martin Brandenburg 2018-02-06  301  		ret = orangefs_inode_is_stale(inode,
266626339b688e Martin Brandenburg 2016-03-17  302  		    &new_op->downcall.resp.getattr.attributes,
266626339b688e Martin Brandenburg 2016-03-17  303  		    new_op->downcall.resp.getattr.link_target);
266626339b688e Martin Brandenburg 2016-03-17  304  		if (ret) {
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  305  			ret = -ESTALE;
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  306  			goto out_unlock;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  307  		}
480e5ae9b860c8 Martin Brandenburg 2018-02-06  308  	}
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  309
480e5ae9b860c8 Martin Brandenburg 2018-02-06  310  	type = orangefs_inode_type(new_op->
480e5ae9b860c8 Martin Brandenburg 2018-02-06  311  	    downcall.resp.getattr.attributes.objtype);
266626339b688e Martin Brandenburg 2016-03-17  312  	switch (type) {
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  313  	case S_IFREG:
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  314  		inode->i_flags = orangefs_inode_flags(&new_op->
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  315  		    downcall.resp.getattr.attributes);
8b60785c1d7c63 Martin Brandenburg 2018-02-07  316  		if (flags) {
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  317  			inode_size = (loff_t)new_op->
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  318  			    downcall.resp.getattr.attributes.size;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  319  			inode->i_size = inode_size;
9f8fd53cd05596 Martin Brandenburg 2018-05-31  320  			inode->i_blkbits = ffs(new_op->downcall.resp.getattr.
9f8fd53cd05596 Martin Brandenburg 2018-05-31  321  			    attributes.blksize);
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  322  			inode->i_bytes = inode_size;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  323  			inode->i_blocks =
9f8fd53cd05596 Martin Brandenburg 2018-05-31  324  			    (inode_size + 512 - inode_size % 512)/512;
68a24a6cc4a602 Martin Brandenburg 2017-04-25  325  		}
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  326  		break;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  327  	case S_IFDIR:
8b60785c1d7c63 Martin Brandenburg 2018-02-07  328  		if (flags) {
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01  329  			inode->i_size = PAGE_SIZE;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  330  			inode_set_bytes(inode, inode->i_size);
68a24a6cc4a602 Martin Brandenburg 2017-04-25  331  		}
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  332  		set_nlink(inode, 1);
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  333  		break;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  334  	case S_IFLNK:
8b60785c1d7c63 Martin Brandenburg 2018-02-07  335  		if (flags & ORANGEFS_GETATTR_NEW) {
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  336  			inode->i_size = (loff_t)strlen(new_op->
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  337  			    downcall.resp.getattr.link_target);
2eacea74cc465e Martin Brandenburg 2016-04-08  338  			ret = strscpy(orangefs_inode->link_target,
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  339  			    new_op->downcall.resp.getattr.link_target,
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  340  			    ORANGEFS_NAME_MAX);
2eacea74cc465e Martin Brandenburg 2016-04-08  341  			if (ret == -E2BIG) {
2eacea74cc465e Martin Brandenburg 2016-04-08  342  				ret = -EIO;
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  343  				goto out_unlock;
2eacea74cc465e Martin Brandenburg 2016-04-08  344  			}
e8da254c415475 Martin Brandenburg 2016-03-18  345  			inode->i_link = orangefs_inode->link_target;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  346  		}
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  347  		break;
480e5ae9b860c8 Martin Brandenburg 2018-02-06  348  	/* i.e. -1 */
480e5ae9b860c8 Martin Brandenburg 2018-02-06  349  	default:
480e5ae9b860c8 Martin Brandenburg 2018-02-06  350  		/* XXX: ESTALE?  This is what is done if it is not new. */
480e5ae9b860c8 Martin Brandenburg 2018-02-06  351  		orangefs_make_bad_inode(inode);
480e5ae9b860c8 Martin Brandenburg 2018-02-06  352  		ret = -ESTALE;
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  353  		goto out_unlock;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  354  	}
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  355
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  356  	inode->i_uid = make_kuid(&init_user_ns, new_op->
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  357  	    downcall.resp.getattr.attributes.owner);
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  358  	inode->i_gid = make_kgid(&init_user_ns, new_op->
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  359  	    downcall.resp.getattr.attributes.group);
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  360  	inode->i_atime.tv_sec = (time64_t)new_op->
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  361  	    downcall.resp.getattr.attributes.atime;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  362  	inode->i_mtime.tv_sec = (time64_t)new_op->
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  363  	    downcall.resp.getattr.attributes.mtime;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  364  	inode->i_ctime.tv_sec = (time64_t)new_op->
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  365  	    downcall.resp.getattr.attributes.ctime;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  366  	inode->i_atime.tv_nsec = 0;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  367  	inode->i_mtime.tv_nsec = 0;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  368  	inode->i_ctime.tv_nsec = 0;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  369
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  370  	/* special case: mark the root inode as sticky */
d52ec74bebeff1 Christian Brauner  2022-09-06 @371  	inode->i_mode = type | (is_root_handle(inode) ? S_ISVTX : 0) | mode |
d52ec74bebeff1 Christian Brauner  2022-09-06  372  	    orangefs_inode_perms(&new_op->downcall.resp.getattr.attributes) |
d52ec74bebeff1 Christian Brauner  2022-09-06  373  	    mode;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  374
1d503617884ed4 Martin Brandenburg 2016-08-16  375  	orangefs_inode->getattr_time = jiffies +
1d503617884ed4 Martin Brandenburg 2016-08-16  376  	    orangefs_getattr_timeout_msecs*HZ/1000;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  377  	ret = 0;
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  378  out_unlock:
5e4f606e26d6a1 Martin Brandenburg 2018-02-12  379  	spin_unlock(&inode->i_lock);
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  380  out:
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  381  	op_release(new_op);
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  382  	return ret;
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  383  }
3c9cf98d7b4f27 Martin Brandenburg 2016-03-15  384

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (109594 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ