{"push_id":691195937,"size":1,"distinct_size":1,"ref":"refs/heads/modparams","head":"9e95ec40ac651e64f8c069169ca1554442723cd6","before":"781ac2369429964fe487786ef68b7106ddfe4265","commits":[{"sha":"9e95ec40ac651e64f8c069169ca1554442723cd6","author":{"email":"9cf7b61c8faa5cbb1bbe4dcb6838d42eed5e6946@ieee.org","name":"Dan Streetman"},"message":"module: make perm const, change BUG_ON to BUILD_BUG_ON\n\nChange the struct kernel_param.perm field to a const, as it should never\nbe changed.  Add inline functions, for each module param, that return a\nconst value (so they are compiled out) for kparam_[un]block_sysfs_r/w()\nmacros to use, and change the BUG_ON() in those macros to BUILD_BUG_ON().\n\nThis will enforce that the kernel_param permissions are never changed,\nand it will fail at build instead of runtime for any misuse of\nsysfs param blocking.\n\nI initially wanted to just use the const param.perm in the block_sysfs\nchecks, but unfortunately that also requires the param itself to be\nconst, in order to do const folding into a constant compiletime\ncondition to BUILD_BUG_ON(), and on some archs the params aren't defined\nas const:\n\n/* On alpha, ia64 and ppc64 relocations to global data cannot go into\n   read-only sections (which is part of respective UNIX ABI on these\n   platforms). So 'const' makes no sense and even causes compile failures\n   with some compilers. */\n\nSo instead, this copies the idea from __param_check() to add inline\nconstant functions to check the param permissions.  That way no extra\nbits are needed.\n\nSigned-off-by: Dan Streetman <ddstreet@ieee.org>","distinct":true,"url":"https://api.github.com/repos/ddstreet/linux/commits/9e95ec40ac651e64f8c069169ca1554442723cd6"}]}