rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* next-20241101: rust/kernel/security.rs - error[E0061]: this function takes 2 arguments but 3 arguments were supplied
@ 2024-11-01  9:01 Naresh Kamboju
  2024-11-01  9:56 ` [PATCH] rust: lsm: replace context+len with lsm_context Alice Ryhl
  0 siblings, 1 reply; 11+ messages in thread
From: Naresh Kamboju @ 2024-11-01  9:01 UTC (permalink / raw)
  To: open list, lkft-triage, rust-for-linux, Linux Regressions
  Cc: Arnd Bergmann, aliceryhl, Miguel Ojeda, Christian Brauner,
	Paul Moore, kees, Dan Carpenter, Anders Roxell

The rustclang-lkftconfig-kselftest builds failed with rust clang on the
Linux next-20241101 tag.

First seen on Linux next-20241101 tag.
  Good: next-20241031
  Bad:  next-20241101

arm64:
  build:
    * rustclang-lkftconfig-kselftest

Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>

Build log:
---------
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
     --> rust/kernel/security.rs:32:28
      |
32    |         to_result(unsafe {
bindings::security_secid_to_secctx(secid, &mut secdata, &mut seclen)
})?;
      |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    ----------- unexpected argument #3 of type `&mut
u32`
      |
note: expected `*mut lsm_context`, found `&mut *mut _`
     --> rust/kernel/security.rs:32:70
      |
32    |         to_result(unsafe {
bindings::security_secid_to_secctx(secid, &mut secdata, &mut seclen)
})?;
      |
      ^^^^^^^^^^^^
      = note:    expected raw pointer `*mut bindings::lsm_context`
              found mutable reference `&mut *mut _`
note: function defined here
     --> /home/tuxbuild/.cache/tuxmake/builds/1/build/rust/bindings/bindings_generated.rs:76185:12
      |
76185 |     pub fn security_secid_to_secctx(secid: u32_, cp: *mut
lsm_context) -> core::ffi::c_int;
      |            ^^^^^^^^^^^^^^^^^^^^^^^^
help: consider removing the borrow
      |
32    -         to_result(unsafe {
bindings::security_secid_to_secctx(secid, &mut secdata, &mut seclen)
})?;
32    +         to_result(unsafe {
bindings::security_secid_to_secctx(secid, secdata, &mut seclen) })?;
      |
help: remove the extra argument
      |
32    -         to_result(unsafe {
bindings::security_secid_to_secctx(secid, &mut secdata, &mut seclen)
})?;
32    +         to_result(unsafe {
bindings::security_secid_to_secctx(secid, /* *mut
bindings::lsm_context */) })?;
      |

error[E0061]: this function takes 1 argument but 2 arguments were supplied
     --> rust/kernel/security.rs:72:18
      |
72    |         unsafe {
bindings::security_release_secctx(self.secdata, self.seclen as u32) };
      |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ------------------ unexpected argument #2 of type `u32`
      |
note: expected `*mut lsm_context`, found `*mut i8`
     --> rust/kernel/security.rs:72:52
      |
72    |         unsafe {
bindings::security_release_secctx(self.secdata, self.seclen as u32) };
      |                                                    ^^^^^^^^^^^^
      = note: expected raw pointer `*mut bindings::lsm_context`
                 found raw pointer `*mut i8`
note: function defined here
     --> /home/tuxbuild/.cache/tuxmake/builds/1/build/rust/bindings/bindings_generated.rs:76201:12
      |
76201 |     pub fn security_release_secctx(cp: *mut lsm_context);
      |            ^^^^^^^^^^^^^^^^^^^^^^^
help: remove the extra argument
      |
72    -         unsafe {
bindings::security_release_secctx(self.secdata, self.seclen as u32) };
72    +         unsafe { bindings::security_release_secctx(/* *mut
bindings::lsm_context */) };
      |

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0061`.
make[3]: *** [rust/Makefile:405: rust/kernel.o] Error 1

Build image:
-----------
- https://storage.tuxsuite.com/public/linaro/lkft/builds/2oEm06IqsdrtzGl1UIGSDghznWx/
- https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20241101/testrun/25629042/suite/build/test/rustclang-lkftconfig-kselftest/log

Steps to reproduce:
------------
 - # tuxmake --runtime podman --target-arch arm64 --toolchain rustclang \
             --kconfig defconfig \
             --kconfig-add
https://gitlab.com/Linaro/lkft/kernel-fragments/-/raw/main/systemd.config
\
             --kconfig-add tools/testing/selftests/rust/config \
             LLVM=1 LLVM_IAS=1 TARGETS=rust \
             debugkernel dtbs dtbs-legacy headers kernel kselftest modules
 - https://storage.tuxsuite.com/public/linaro/lkft/builds/2oEm06IqsdrtzGl1UIGSDghznWx/tuxmake_reproducer.sh

metadata:
----
  git describe: next-20241101
  git repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
  git sha: c88416ba074a8913cf6d61b789dd834bbca6681c
  kernel config:
https://storage.tuxsuite.com/public/linaro/lkft/builds/2oEm06IqsdrtzGl1UIGSDghznWx/config
  build url: https://storage.tuxsuite.com/public/linaro/lkft/builds/2oEm06IqsdrtzGl1UIGSDghznWx/
  toolchain: rustclang
  config: defconfig
  arch: arm64

--
Linaro LKFT
https://lkft.linaro.org

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-11-27  4:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-01  9:01 next-20241101: rust/kernel/security.rs - error[E0061]: this function takes 2 arguments but 3 arguments were supplied Naresh Kamboju
2024-11-01  9:56 ` [PATCH] rust: lsm: replace context+len with lsm_context Alice Ryhl
2024-11-01 16:56   ` Paul Moore
2024-11-01 17:02     ` Paul Moore
2024-11-27  4:17       ` Paul Moore
2024-11-01 17:03     ` Miguel Ojeda
2024-11-01 17:11       ` Paul Moore
2024-11-01 17:23         ` Alice Ryhl
2024-11-01 17:48           ` [PATCH] rust: security: add abstraction for secctx Alice Ryhl
2024-11-01 17:59           ` [PATCH] rust: lsm: replace context+len with lsm_context Paul Moore
2024-11-01 18:08             ` Alice Ryhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).