linux/security/selinux
Ondrej Mosnacek 4e551db042 selinux: clarify return code in filename_trans_read_helper_compat()
For the "conflicting/duplicate rules" branch in
filename_trans_read_helper_compat() the Smatch static checker reports:

    security/selinux/ss/policydb.c:1953 filename_trans_read_helper_compat()
    warn: missing error code 'rc'

While the value of rc will already always be zero here, it is not
obvious that it's the case and that it's the intended return value
(Smatch expects rc to be assigned within 5 lines from the goto).
Therefore, add an explicit assignment just before the goto to make the
intent more clear and the code less error-prone.

Fixes: c3a276111e ("selinux: optimize storage of filename transitions")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/selinux/722b90c4-1f4b-42ff-a6c2-108ea262bd10@moroto.mountain/
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
2024-04-04 16:38:37 -04:00
..
include selinux: fix style issues in security/selinux/include/initial_sid_to_string.h 2023-12-22 18:09:31 -05:00
ss selinux: clarify return code in filename_trans_read_helper_compat() 2024-04-04 16:38:37 -04:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
avc.c selinux: update my email address 2023-07-19 11:27:02 -04:00
hooks.c selinux: make more use of current_sid() 2024-03-27 18:25:18 -04:00
ibpkey.c selinux: stop passing selinux_state pointers and their offspring 2023-03-14 15:22:45 -04:00
ima.c selinux: adjust typos in comments 2023-05-08 16:44:01 -04:00
Kconfig selinux: improve debug configuration 2023-09-13 13:46:57 -04:00
Makefile selinux: improve debug configuration 2023-09-13 13:46:57 -04:00
netif.c selinux: avoid implicit conversions in the netif code 2023-07-18 18:29:48 -04:00
netlabel.c selinux: prevent KMSAN warning in selinux_inet_conn_request() 2023-08-15 18:23:22 -04:00
netlink.c selinux: mark some global variables __ro_after_init 2021-01-12 10:08:55 -05:00
netnode.c selinux: stop passing selinux_state pointers and their offspring 2023-03-14 15:22:45 -04:00
netport.c selinux: stop passing selinux_state pointers and their offspring 2023-03-14 15:22:45 -04:00
nlmsgtab.c selinux: use unsigned iterator in nlmsgtab code 2023-08-09 19:07:49 -04:00
selinuxfs.c selinux: improve error checking in sel_write_load() 2024-03-26 16:42:09 -04:00
status.c selinux: avoid implicit conversions regarding enforcing status 2023-07-18 18:29:50 -04:00
xfrm.c selinux: make more use of current_sid() 2024-03-27 18:25:18 -04:00