Hi Olaf,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on kbuild/for-next]
[also build test ERROR on linux/master linus/master v5.12-rc3 next-20210319]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Olaf-Hering/kbuild-enforce-Werro...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git
for-next
config: alpha-allyesconfig (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
#
https://github.com/0day-ci/linux/commit/635ecb94f0f38a005c528c2cddb9fc6f9...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Olaf-Hering/kbuild-enforce-Werror-unused-result/20210319-223913
git checkout 635ecb94f0f38a005c528c2cddb9fc6f9cfab1dc
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
fs/binfmt_em86.c: In function 'load_em86':
> fs/binfmt_em86.c:66:2: error: ignoring return value of
'remove_arg_zero', declared with attribute warn_unused_result
[-Werror=unused-result]
66 | remove_arg_zero(bprm);
| ^~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/remove_arg_zero +66 fs/binfmt_em86.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 25
71613c3b871c5a Al Viro 2012-10-20 26 static int load_em86(struct linux_binprm
*bprm)
^1da177e4c3f41 Linus Torvalds 2005-04-16 27 {
a310dcb7a43f97 Daniel Wagner 2016-08-02 28 const char *i_name, *i_arg;
a310dcb7a43f97 Daniel Wagner 2016-08-02 29 char *interp;
^1da177e4c3f41 Linus Torvalds 2005-04-16 30 struct file * file;
^1da177e4c3f41 Linus Torvalds 2005-04-16 31 int retval;
^1da177e4c3f41 Linus Torvalds 2005-04-16 32 struct elfhdr elf_ex;
^1da177e4c3f41 Linus Torvalds 2005-04-16 33
^1da177e4c3f41 Linus Torvalds 2005-04-16 34 /* Make sure this is a Linux/Intel ELF
executable... */
^1da177e4c3f41 Linus Torvalds 2005-04-16 35 elf_ex = *((struct elfhdr
*)bprm->buf);
^1da177e4c3f41 Linus Torvalds 2005-04-16 36
^1da177e4c3f41 Linus Torvalds 2005-04-16 37 if (memcmp(elf_ex.e_ident, ELFMAG,
SELFMAG) != 0)
^1da177e4c3f41 Linus Torvalds 2005-04-16 38 return -ENOEXEC;
^1da177e4c3f41 Linus Torvalds 2005-04-16 39
^1da177e4c3f41 Linus Torvalds 2005-04-16 40 /* First of all, some simple consistency
checks */
^1da177e4c3f41 Linus Torvalds 2005-04-16 41 if ((elf_ex.e_type != ET_EXEC &&
elf_ex.e_type != ET_DYN) ||
^1da177e4c3f41 Linus Torvalds 2005-04-16 42 (!((elf_ex.e_machine == EM_386) ||
(elf_ex.e_machine == EM_486))) ||
72c2d531920048 Al Viro 2013-09-22 43 !bprm->file->f_op->mmap) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 44 return -ENOEXEC;
^1da177e4c3f41 Linus Torvalds 2005-04-16 45 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 46
51f39a1f0cea1c David Drysdale 2014-12-12 47 /* Need to be able to load the file
after exec */
51f39a1f0cea1c David Drysdale 2014-12-12 48 if (bprm->interp_flags &
BINPRM_FLAGS_PATH_INACCESSIBLE)
51f39a1f0cea1c David Drysdale 2014-12-12 49 return -ENOENT;
51f39a1f0cea1c David Drysdale 2014-12-12 50
^1da177e4c3f41 Linus Torvalds 2005-04-16 51 /* Unlike in the script case, we
don't have to do any hairy
^1da177e4c3f41 Linus Torvalds 2005-04-16 52 * parsing to find our interpreter...
it's hardcoded!
^1da177e4c3f41 Linus Torvalds 2005-04-16 53 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 54 interp = EM86_INTERP;
^1da177e4c3f41 Linus Torvalds 2005-04-16 55 i_name = EM86_I_NAME;
^1da177e4c3f41 Linus Torvalds 2005-04-16 56 i_arg = NULL; /* We reserve the right
to add an arg later */
^1da177e4c3f41 Linus Torvalds 2005-04-16 57
^1da177e4c3f41 Linus Torvalds 2005-04-16 58 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 59 * Splice in (1) the interpreter's
name for argv[0]
^1da177e4c3f41 Linus Torvalds 2005-04-16 60 * (2) (optional) argument to
interpreter
^1da177e4c3f41 Linus Torvalds 2005-04-16 61 * (3) filename of emulated
file (replace argv[0])
^1da177e4c3f41 Linus Torvalds 2005-04-16 62 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 63 * This is done in reverse order,
because of how the
^1da177e4c3f41 Linus Torvalds 2005-04-16 64 * user environment and arguments are
stored.
^1da177e4c3f41 Linus Torvalds 2005-04-16 65 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 @66 remove_arg_zero(bprm);
986db2d14a6dca Christoph Hellwig 2020-06-04 67 retval =
copy_string_kernel(bprm->filename, bprm);
^1da177e4c3f41 Linus Torvalds 2005-04-16 68 if (retval < 0) return retval;
^1da177e4c3f41 Linus Torvalds 2005-04-16 69 bprm->argc++;
^1da177e4c3f41 Linus Torvalds 2005-04-16 70 if (i_arg) {
986db2d14a6dca Christoph Hellwig 2020-06-04 71 retval = copy_string_kernel(i_arg,
bprm);
^1da177e4c3f41 Linus Torvalds 2005-04-16 72 if (retval < 0) return retval;
^1da177e4c3f41 Linus Torvalds 2005-04-16 73 bprm->argc++;
^1da177e4c3f41 Linus Torvalds 2005-04-16 74 }
986db2d14a6dca Christoph Hellwig 2020-06-04 75 retval = copy_string_kernel(i_name,
bprm);
^1da177e4c3f41 Linus Torvalds 2005-04-16 76 if (retval < 0) return retval;
^1da177e4c3f41 Linus Torvalds 2005-04-16 77 bprm->argc++;
^1da177e4c3f41 Linus Torvalds 2005-04-16 78
^1da177e4c3f41 Linus Torvalds 2005-04-16 79 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 80 * OK, now restart the process with the
interpreter's inode.
^1da177e4c3f41 Linus Torvalds 2005-04-16 81 * Note that we use open_exec() as the
name is now in kernel
^1da177e4c3f41 Linus Torvalds 2005-04-16 82 * space, and we don't need to copy
it.
^1da177e4c3f41 Linus Torvalds 2005-04-16 83 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 84 file = open_exec(interp);
^1da177e4c3f41 Linus Torvalds 2005-04-16 85 if (IS_ERR(file))
^1da177e4c3f41 Linus Torvalds 2005-04-16 86 return PTR_ERR(file);
^1da177e4c3f41 Linus Torvalds 2005-04-16 87
bc2bf338d54b7a Eric W. Biederman 2020-05-18 88 bprm->interpreter = file;
bc2bf338d54b7a Eric W. Biederman 2020-05-18 89 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 90 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 91
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org