lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 6 Dec 2021 16:46:01 +0100
From:   Lukas Bulwahn <lukas.bulwahn@...il.com>
To:     Akira Kawata <akirakawata1@...il.com>
Cc:     Alexey Dobriyan <adobriyan@...il.com>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Eric Biederman <ebiederm@...ssion.com>,
        Kees Cook <keescook@...omium.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        kernel-janitors <kernel-janitors@...r.kernel.org>
Subject: Unused local variable load_addr in load_elf_binary()

Dear Akira-san,

With commit 0c9333606e30 ("fs/binfmt_elf: Fix AT_PHDR for unusual ELF
files"), you have changed load_elf_binary() in ./fs/binfmt_elf.c in a
way such that the local variable load_addr in load_elf_binary() is not
used anymore.

I had a quick look at the code and I think the following refactoring
would be good:

1. Remove the definition of load_addr and its unneeded computation of load_addr

2. Rename load_addr_set to first (or a similar name) to represent that
this variable is not linked to the non-existing load_addr, but states
that it captures the first iteration of the loop. Note that first has
the inverse meaning of load_addr_set.

The issue was reported by make clang-analyzer:

./fs/binfmt_elf.c:1167:5: warning: Value stored to 'load_addr' is
never read [clang-analyzer-deadcode.DeadStores]
                                load_addr += load_bias;
                                ^            ~~~~~~~~~


Best regards,

Lukas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ