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-prev] [day] [month] [year] [list]
Message-ID: <CADrL8HXOPOhWXa9o36m5wh-YJyVoMOXyj4R0_7EdUQ6nhJ-avQ@mail.gmail.com>
Date: Wed, 8 Oct 2025 15:31:53 -0700
From: James Houghton <jthoughton@...gle.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: oe-kbuild@...ts.linux.dev, Paolo Bonzini <pbonzini@...hat.com>, 
	Sean Christopherson <seanjc@...gle.com>, lkp@...el.com, oe-kbuild-all@...ts.linux.dev, 
	kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] KVM: For manual-protect GET_DIRTY_LOG, do not hold
 slots lock

On Mon, Oct 6, 2025 at 12:33 AM Dan Carpenter <dan.carpenter@...aro.org> wrote:
>
> Hi James,
>
> kernel test robot noticed the following build warnings:
>
> url:    https://github.com/intel-lab-lkp/linux/commits/James-Houghton/KVM-selftests-Add-parallel-KVM_GET_DIRTY_LOG-to-dirty_log_perf_test/20251001-013306
> base:   a6ad54137af92535cfe32e19e5f3bc1bb7dbd383
> patch link:    https://lore.kernel.org/r/20250930172850.598938-1-jthoughton%40google.com
> patch subject: [PATCH 1/2] KVM: For manual-protect GET_DIRTY_LOG, do not hold slots lock
> config: x86_64-randconfig-161-20251004 (https://download.01.org/0day-ci/archive/20251004/202510041919.LaZWBcDN-lkp@intel.com/config)
> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@...el.com>
> | Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
> | Closes: https://lore.kernel.org/r/202510041919.LaZWBcDN-lkp@intel.com/
>
> New smatch warnings:
> arch/x86/kvm/../../../virt/kvm/kvm_main.c:2290 kvm_get_dirty_log_protect() error: uninitialized symbol 'flush'.
>
> vim +/flush +2290 arch/x86/kvm/../../../virt/kvm/kvm_main.c
>
> ba0513b5b8ffbcb virt/kvm/kvm_main.c    Mario Smarduch      2015-01-15  2255     n = kvm_dirty_bitmap_bytes(memslot);
> 82fb1294f7ad3ee virt/kvm/kvm_main.c    James Houghton      2025-09-30  2256     if (!protect) {
> 2a31b9db153530d virt/kvm/kvm_main.c    Paolo Bonzini       2018-10-23  2257             /*
> 82fb1294f7ad3ee virt/kvm/kvm_main.c    James Houghton      2025-09-30  2258              * Unlike kvm_get_dirty_log, we never flush, because no flush is
> 82fb1294f7ad3ee virt/kvm/kvm_main.c    James Houghton      2025-09-30  2259              * needed until KVM_CLEAR_DIRTY_LOG.  There is some code
> 82fb1294f7ad3ee virt/kvm/kvm_main.c    James Houghton      2025-09-30  2260              * duplication between this function and kvm_get_dirty_log, but
> 82fb1294f7ad3ee virt/kvm/kvm_main.c    James Houghton      2025-09-30  2261              * hopefully all architecture transition to
> 82fb1294f7ad3ee virt/kvm/kvm_main.c    James Houghton      2025-09-30  2262              * kvm_get_dirty_log_protect and kvm_get_dirty_log can be
> 82fb1294f7ad3ee virt/kvm/kvm_main.c    James Houghton      2025-09-30  2263              * eliminated.
> 2a31b9db153530d virt/kvm/kvm_main.c    Paolo Bonzini       2018-10-23  2264              */
> 2a31b9db153530d virt/kvm/kvm_main.c    Paolo Bonzini       2018-10-23  2265             dirty_bitmap_buffer = dirty_bitmap;
> 2a31b9db153530d virt/kvm/kvm_main.c    Paolo Bonzini       2018-10-23  2266     } else {
> 82fb1294f7ad3ee virt/kvm/kvm_main.c    James Houghton      2025-09-30  2267             bool flush;
>
> flush needs to be initialized to false.

I'll fix this and the other bug about not documenting the new
parameter, my mistake. :(

I think in a v2 I'll also merge kvm_get_dirty_log() into
kvm_get_dirty_log_protect(); might as well.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ