From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFE98C28B20 for ; Sun, 30 Mar 2025 14:20:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A823B280003; Sun, 30 Mar 2025 10:20:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A31F0280001; Sun, 30 Mar 2025 10:20:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F9AB280003; Sun, 30 Mar 2025 10:20:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 7238E280001 for ; Sun, 30 Mar 2025 10:20:12 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 98E61812CB for ; Sun, 30 Mar 2025 14:20:12 +0000 (UTC) X-FDA: 83278427064.01.BCAA5A7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf29.hostedemail.com (Postfix) with ESMTP id 8C98C120004 for ; Sun, 30 Mar 2025 14:20:10 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=I1mwHFe9; dmarc=pass (policy=quarantine) header.from=redhat.com; spf=pass (imf29.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743344410; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SRhCdRWKSEsLp14H52SVVZrecvb4ICcNMfXSkyqsTao=; b=DqdVsNhigsspre3NiLEpocmFELVKXeOlRj1pGvU2R8LQ2qoIOJznlZKTt9vyb5PcK8jw1X jUVzcVtjmOXdpBg0izC8VcqE9ZDvVwrVTlLNiLmApVfB7/xgvY8r4LBE1bpNvultTi8QH2 FahkeGCH8O5POmRqW8LlH55gDzYw+CY= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=I1mwHFe9; dmarc=pass (policy=quarantine) header.from=redhat.com; spf=pass (imf29.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743344410; a=rsa-sha256; cv=none; b=T00I8Iyc5yqZUoQDLyFpRovCR2vCTkN8MPDgTpKyY6TU08Y4wPyvzaGASlgbG/ZzeouSsi 1uYD7Mof1FFQBeHv2AchUjTiBY5wOB3xkWbIYMbW/TX41511FUjuFHiWKLUJQE6GnrBq98 lnW3fZBW9oQ6IyzPB8ajqE/4SPumzYA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1743344409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SRhCdRWKSEsLp14H52SVVZrecvb4ICcNMfXSkyqsTao=; b=I1mwHFe9bd7z0Iio3XbbMibzkXOOUIRn1JCcJs8KlVTefWIq3EIpfniXqKlorIDPyPtrcv LX5qbjX9zq7jv1kOCKGDmCZ2D/+45EQUjIo6TRy87L1in4NUwD0KOguWmiqobAmeEVHW33 Lqr+I9rcKmleXBBTpT+JYpKuXeFuX44= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-691-d4SuLccyPK2YurBOak7wBw-1; Sun, 30 Mar 2025 10:20:03 -0400 X-MC-Unique: d4SuLccyPK2YurBOak7wBw-1 X-Mimecast-MFC-AGG-ID: d4SuLccyPK2YurBOak7wBw_1743344402 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 48870180899B; Sun, 30 Mar 2025 14:20:02 +0000 (UTC) Received: from localhost (unknown [10.72.112.17]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E30291956095; Sun, 30 Mar 2025 14:20:00 +0000 (UTC) Date: Sun, 30 Mar 2025 22:19:55 +0800 From: Baoquan He To: kernel test robot Cc: akpm@linux-foundation.org, oe-kbuild-all@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/7] mm/gup: check if both GUP_GET and GUP_PIN are set in __get_user_pages() earlier Message-ID: References: <20250330121718.175815-3-bhe@redhat.com> <202503302151.MdrisJhx-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202503302151.MdrisJhx-lkp@intel.com> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Rspamd-Server: rspam01 X-Stat-Signature: bynut33ei6cty4318yiz7wbg7zithn31 X-Rspam-User: X-Rspamd-Queue-Id: 8C98C120004 X-HE-Tag: 1743344410-428457 X-HE-Meta: U2FsdGVkX18DvUv6dlRHYiuZMoo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zJeDOwwsWCW3opTJkeUorHz4ZzroHM3g5pktIw/DnW+wDzozwAkhW6thyciudC6aQ+3Q4VIZjcqGX1xvuEXIo1OQK9mDPyINEJPzGdrDhFI90veHw/BEmph/ThKwwDqOP7v77UI4Iwk/P6rz6c3okuB2Rhaf1S3Zbh2soB2vC8nd3GACLqvMXaq0WJK2pbCQPjZpb9g8sV0Ny4P5Sfxx2lsub4M0S3gJq4hy81aiuVU49Bpmu8iA8P63s7e80SuWbNDRQBRKyueZYNaDuA4eOmnzYHWlKnXIhcD3fTKAKQcmSsXlv8XL1PP17uZD0HoHRMVM2YqWx2zw/jdBRbX3vQiqJZYlg0Q0VwclZheN+zSuYUGmkSrXFQL8Twja7EteGhnV5+yBrU18elRe/Ph0LHNzm/79MZVoCTznyt4vInN3/HIqev6hlMubw+3sbg6O+0VmBJRxH+FFUJ72OTTjgPynksZ9fk4eeotg+Z0vuWxPAa X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 03/30/25 at 09:49pm, kernel test robot wrote: > Hi Baoquan, > > kernel test robot noticed the following build warnings: > > [auto build test WARNING on akpm-mm/mm-everything] > > url: https://github.com/intel-lab-lkp/linux/commits/Baoquan-He/mm-gup-fix-wrongly-calculated-returned-value-in-fault_in_safe_writeable/20250330-201949 > base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything > patch link: https://lore.kernel.org/r/20250330121718.175815-3-bhe%40redhat.com > patch subject: [PATCH 2/7] mm/gup: check if both GUP_GET and GUP_PIN are set in __get_user_pages() earlier > config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20250330/202503302151.MdrisJhx-lkp@intel.com/config) > compiler: gcc-11 (Debian 11.3.0-12) 11.3.0 > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250330/202503302151.MdrisJhx-lkp@intel.com/reproduce) > > 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 > | Closes: https://lore.kernel.org/oe-kbuild-all/202503302151.MdrisJhx-lkp@intel.com/ Thanks for testing this patchset and reporting this error. > > All warnings (new ones prefixed by >>): > > In file included from arch/x86/include/asm/bug.h:110, > from include/linux/bug.h:5, > from include/linux/thread_info.h:13, > from include/linux/spinlock.h:60, > from mm/gup.c:5: > mm/gup.c: In function '__get_user_pages': > mm/gup.c:1433:27: error: 'flags' undeclared (first use in this function) > 1433 | if (WARN_ON_ONCE((flags & (FOLL_PIN | FOLL_GET)) == > | ^~~~~ It's a copy-and-paste error, below change can fix it. It's weird my building didn't figure it out. I will re-run a building on the patchset, then send v2 for patch 2. diff --git a/mm/gup.c b/mm/gup.c index 3d2c57f59b4d..1ae41c1b2649 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1430,7 +1430,7 @@ static long __get_user_pages(struct mm_struct *mm, VM_BUG_ON(!!pages != !!(gup_flags & (FOLL_GET | FOLL_PIN))); /* FOLL_GET and FOLL_PIN are mutually exclusive. */ - if (WARN_ON_ONCE((flags & (FOLL_PIN | FOLL_GET)) == + if (WARN_ON_ONCE((gup_flags & (FOLL_PIN | FOLL_GET)) == (FOLL_PIN | FOLL_GET))) return ERR_PTR(-EINVAL);