Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overflow risk in ioctl.cpp #1

Closed
mjmeehan opened this issue May 20, 2014 · 2 comments
Closed

overflow risk in ioctl.cpp #1

mjmeehan opened this issue May 20, 2014 · 2 comments
Labels

Comments

@mjmeehan
Copy link

cmd in ioctl.cpp is an int, but the case variables (FS_IOC_GETFLAGS and FS_IOC_SETFLAGS) are longs.

@trapexit
Copy link
Owner

FUSE's callback signature for ioctl is:

int (*ioctl) (const char *, int cmd, void *arg, struct fuse_file_info *, unsigned int flags, void *data);

The man page on my Ubuntu 14.04LTS machine indicates:

int ioctl(int d, int request, ...);

http://man7.org/linux/man-pages/man2/ioctl.2.html indicates it's an unsigned long.

Sounds like a fuse issue. Nothing I can do about it. I'm given an int.

Also... the header also sets FS_IOC32_GETFLAGS as an int. So it seems unlikely the value is larger than such.

Need to see how switch does value promotion for comparison.

@trapexit trapexit reopened this May 20, 2014
@trapexit
Copy link
Owner

GCC warns with "overflow in implicit constant conversion" if the value had been an issue. I'll put in an explicit cast just in case.

@trapexit trapexit added the bug label May 31, 2014
@momkin momkin mentioned this issue Mar 25, 2020
7 tasks
@ghost ghost mentioned this issue Jul 27, 2020
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants