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 E387037FF52 for ; Tue, 17 Mar 2026 18:34: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=1773772494; cv=none; b=gb23zjAJ+ybVaFXvxyKAq0uF5f6PvoKhGm0TGYMiZ54snK7yaaJW4YJIqJ8JZxHLV8mo3mO4OY0l5yB1o6obQRPdeXlqM/eMQdClfECdnx0yawnqEEkr+jl6L/3igwv/L27hSP21tWGITdYnCq5zIKeZ1u0rtvmJYpzk4dSe3Sk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773772494; c=relaxed/simple; bh=RVsjb7gSf8Tl+ZYDVu7R87RYo7eeBrQ5V3crBd21s4Q=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=BxdDZ878R6Ck9qrs/9QP9/KWWXCJ+iEyw/72/51+dII+WiTtdD8Li/LwrXgV58PaAL+5IQyG7btdiZs7hyyy52yh95g4vy2ZLEWNHmSFAibbWdi6su+KzYRknsFiYUMH7LePC9soFxP0bO92+7wKIMNRm4I5HUjmG/+gNkke9mM= 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=VJmIiWTA; 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="VJmIiWTA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FEFDC4CEF7; Tue, 17 Mar 2026 18:34:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1773772493; bh=RVsjb7gSf8Tl+ZYDVu7R87RYo7eeBrQ5V3crBd21s4Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VJmIiWTA0SPyUd6NSFdCQFTKb6GeSYwPjILc5D1E8i7ClalIhZ9mdBAqtzS0SHYYU At3POUaIk2b3XJJmmlb19kMgI80FrM9kOY8UrTQuTHQe0p2cmad7gzZMCXbMDHBqqo Cq4rvbeMeBVC4cE8g4+V9vm0ZsVBfhPy9BnerRmI= Date: Tue, 17 Mar 2026 11:34:52 -0700 From: Andrew Morton To: Oleg Nesterov Cc: Deepanshu Kartikey , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH -mm v2] do_notify_parent: sanitize the valid_signal() checks Message-Id: <20260317113452.cede9a514dfed36a1cb0e5a9@linux-foundation.org> In-Reply-To: References: <20260316151956.563558-1-kartikey406@gmail.com> 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 On Tue, 17 Mar 2026 14:58:18 +0100 Oleg Nesterov wrote: > Now that kernel_clone() checks valid_signal(args->exit_signal), the "sig" > argument of do_notify_parent() must always be valid or we have a bug. > > However, do_notify_parent() only checks that sig != -1 at the start, then > it does another valid_signal() check before __send_signal_locked(). > > This is confusing. Change do_notify_parent() to WARN and return early if > valid_signal(sig) is false. Sashiko has a question: https://sashiko.dev/#/patchset/abld-ilvMEZ7VgMw%40redhat.com