include/uapi/linux/raw.h leaks CONFIG_MAX_RAW_DEVS to userspace. Userspace programs cannot use MAX_RAW_MINORS since CONFIG_MAX_RAW_DEVS is not available anyway. Remove the MAX_RAW_MINORS definition from the exported header, and use CONFIG_MAX_RAW_DEVS in drivers/char/raw.c While I was here, I converted printk(KERN_WARNING ...) to pr_warn(...) and stretched the warning message.
Showing the changes to include/uapi/linux (1 of 3 files). Show all
Unified · Split
| @@ -14,6 +14,4 @@ struct raw_config_request · 13 unmodified lines | |||
| 14 | __u64 block_minor; | 14 | __u64 block_minor; |
| 15 | }; | 15 | }; |
| 16 | 16 | ||
| 17 | #define MAX_RAW_MINORS CONFIG_MAX_RAW_DEVS | ||
| 18 | |||
| 19 | #endif /* __LINUX_RAW_H */ | 17 | #endif /* __LINUX_RAW_H */ |