From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2549A18D for ; Tue, 24 Dec 2024 01:25:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735003554; cv=none; b=b8rEo1hxdwctEftB+m9R4HqLBA/ixBTBkv+/tG2zvyzWLVXpnYceUwDvSEsPknI4N/yijVfZ5knyVv4742z2ZGBPXOvx/esRnkJ7wvkfz4y75PPm/Mrz1P0s2N0cLrqxifWWlAZRiton8nwfBNim+uomfYQ5XNU0f1irfCn6eBY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735003554; c=relaxed/simple; bh=cItGcb5nH7woZpAMNIbcKjWVx7CGAISKqSfFEPuxkaQ=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=Dxr/lySbnRJgWtYadKUCpjdRFG0tteP1gQCim7vuUoFz/0KlFHunBpJNVbdLKa2TBQJgjAV1JGl+b6XOw3pxHydwkh3pXscy2eHOEGwZmsm45mCfb4GPNzG3bAczhxr06o2UB9JETWo7hvW6FXdcMea+dmwsZ77RUVnCCSAxVc0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=Fcw+/5R9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="Fcw+/5R9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84AECC4CED3; Tue, 24 Dec 2024 01:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1735003553; bh=cItGcb5nH7woZpAMNIbcKjWVx7CGAISKqSfFEPuxkaQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Fcw+/5R9kcw8LsyJoA6ElyEpGOjcE2m3FUGmYoCrPJfNrPtwsC4ivvDoGLsTJucS1 AA93jh/leEV2XywhnKRMNbUnT3g1vrn+//65Wd+jTBmYjn1+V0Cr7J3zFHg/YigFRF QUrSNVo/MOAHgb7zeMhe65S2TUsXZw2UXAbolFwY= Date: Mon, 23 Dec 2024 17:25:52 -0800 From: Andrew Morton To: Tetsuo Handa Cc: linux-mm , LKML Subject: Re: [PATCH] mm/util: make memdup_user_nul() similar to memdup_user() Message-Id: <20241223172552.133f4e293f1dfbb6aa86b5ef@linux-foundation.org> In-Reply-To: <014cd694-cc27-4a07-a34a-2ae95d744515@I-love.SAKURA.ne.jp> References: <014cd694-cc27-4a07-a34a-2ae95d744515@I-love.SAKURA.ne.jp> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit tl;dr: patch does three different things, some of which appear to be needed in -stable kernels. On Sat, 21 Dec 2024 16:47:29 +0900 Tetsuo Handa wrote: > Since the string data to copy from userspace is likely less than PAGE_SIZE > bytes, replace GFP_KERNEL with GFP_USER like commit 6c2c97a24f09 > ("memdup_user(): switch to GFP_USER") does Please provide a reason for this change. Does it have user-visible effects? If so, what are they? > and add __GFP_NOWARN like commit > 6c8fcc096be9 ("mm: don't let userspace spam allocations warnings") does. Ditto. > Also, use dedicated slab buckets like commit d73778e4b867 ("mm/util: Use > dedicated slab buckets for memdup_user()") does. Ditto. > Reported-by: syzbot+7e12e97b36154c54414b@syzkaller.appspotmail.com > Closes: https://syzkaller.appspot.com/bug?extid=7e12e97b36154c54414b That's a userspace-triggered WARN, so we'll want to backport the fix into -stable kernels. But we won't necessarly want to backport the other two changes, depending upon what their effects are. In other words, it would be better to present this as a series of three (fully changelogged!) patches, with one or more of them cc:stable. If we really do want to roll all three changes into a single patch and backport that then please let's justify all three backports within the changelog.