Thread (75 messages) 75 messages, 5 authors, 2020-12-02

Re: [PATCH v3 04/38] fs: add mount_setattr()

From: Christoph Hellwig <hch@lst.de>
Date: 2020-12-02 09:48:40
Also in: fstests, linux-ext4, linux-fsdevel, linux-integrity, linux-security-module, selinux

On Wed, Dec 02, 2020 at 10:42:18AM +0100, Christian Brauner wrote:
quoted
quoted
+	if (upper_32_bits(attr->attr_set))
+		return -EINVAL;
+	if (build_attr_flags(lower_32_bits(attr->attr_set), &kattr->attr_set))
+		return -EINVAL;
+
+	if (upper_32_bits(attr->attr_clr))
+		return -EINVAL;
+	if (build_attr_flags(lower_32_bits(attr->attr_clr), &kattr->attr_clr))
+		return -EINVAL;
What is so magic about the upper and lower 32 bits?
Nothing apart from the fact that they arent't currently valid. I can
think about reworking these lines. Or do you already have a preferred
way of doing this in mind?
Just turn the attr_flags argument to build_attr_flags into a u64 and
the first sanity check there will catch all invalid flags, no matter
where they are places.  That should also generate more efficient code.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help