Skip to contentSkip to conversation

fs: Drop CAP_SYS_RAWIO requirement for FIBMAP

PATCH In review Seth Forshee 2 participants 2 messages Dec 5, 2015 – Dec 9, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: Drop CAP_SYS_RAWIO requirement for FIBMAP

The information exposed by FIBMAP is not privileged and is similar to the information provided by FIEMAP, which does not require privileges. According to [1] the reason the capability check was originally added was to prevent crashing the kernel by passing invalid arguments, but this should no longer be a problem, so this requirement can be removed.

[1] http://www.gossamer-threads.com/lists/linux/kernel/103611

Cc "Serge E. Hallyn" <[email protected]>
Cc Theodore Ts'o <[email protected]>
---
 fs/ioctl.c | 2 --
 1 file changed, 2 deletions(-)
fs/ioctl.c +0 -2
index 5d01d2638ca5..c963d82b0de8 100644
@@ -55,8 +55,6 @@ static int ioctl_fibmap(struct file *filp, int __user *p)
 	/* do we support this mess? */
 	if (!mapping->a_ops->bmap)
 		return -EINVAL;
-	if (!capable(CAP_SYS_RAWIO))
-		return -EPERM;
 	res = get_user(block, p);
 	if (res)
 		return res;
Signature · 1 line
1.9.1
Acked-by Serge Hallyn on v1 1/1
#1 lore raw
Quoted 7 lines · Seth Forshee

The information exposed by FIBMAP is not privileged and is similar to the information provided by FIEMAP, which does not require privileges. According to [1] the reason the capability check was originally added was to prevent crashing the kernel by passing invalid arguments, but this should no longer be a problem, so this requirement can be removed.

Quoted 5 lines

[1] http://www.gossamer-threads.com/lists/linux/kernel/103611

Cc "Serge E. Hallyn" <[email protected]>
Cc Theodore Ts'o <[email protected]>
Quoted 19 lines
---
 fs/ioctl.c | 2 --
 1 file changed, 2 deletions(-)
fs/ioctl.c +0 -2
index 5d01d2638ca5..c963d82b0de8 100644
@@ -55,8 +55,6 @@ static int ioctl_fibmap(struct file *filp, int __user *p)
 	/* do we support this mess? */
 	if (!mapping->a_ops->bmap)
 		return -EINVAL;
-	if (!capable(CAP_SYS_RAWIO))
-		return -EPERM;
 	res = get_user(block, p);
 	if (res)
 		return res;
Signature · 1 line
1.9.1