smack: removal of global rule list
authorVishal Goel <vishal.goel@samsung.com>
Thu, 7 Mar 2019 11:25:24 +0000 (16:55 +0530)
committerCasey Schaufler <cschaufler@localhost.localdomain>
Tue, 2 Apr 2019 18:45:22 +0000 (11:45 -0700)
commit460d95a1d69d5c0352379a3651c9cb6ec09e4ddb
treeb3208c50a93062822aa1ad7e4509d6d4427d066c
parent9d7b7bfbafba5e6cad609f1188243a7f0cd0d293
smack: removal of global rule list

In this patch, global rule list has been removed. Now all
smack rules will be read using "smack_known_list". This list contains
all the smack labels and internally each smack label structure
maintains the list of smack rules corresponding to that smack label.
So there is no need to maintain extra list.

1) Small Memory Optimization
For eg. if there are 20000 rules, then it will save 625KB(20000*32),
which is critical for small embedded systems.
2) Reducing the time taken in writing rules on load/load2 interface
3) Since global rule list is just used to read the rules, so there
will be no performance impact on system

Signed-off-by: Vishal Goel <vishal.goel@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
Signed-off-by: Casey Schaufler <cschaufler@localhost.localdomain>
security/smack/smackfs.c