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 8218831A553 for ; Fri, 14 Nov 2025 13:52:15 +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=1763128337; cv=none; b=G2kZpcM8POSfHC4QvnKBRPg5i7a+2eCGfuBOd6oqBe4PTV5xzGn4bjQpafRX/gXzNe/eNn0hrKHIpD1mJfeekF9Ihj64zkvAzUNI6Cbam9xZ8UUUUlmJCk0iFZvmFWWF3LVJ+33USqQEowdCc+M31RhzSGt9wmUFVVcSBofAIto= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763128337; c=relaxed/simple; bh=igG5VMmWoHKLnwf6CijiKZdSI+7fNZg6xHGQzdiZQfw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CZbdQzMClaUsUo5pl2wQ6huLCq9vXgU/QeKTKq72enccMObz8nz7k26vIt8QNICxdZ6gICmzVh4O849NMQfCiXoXIM8KgVx7w2oJQr0gfxhiYxlpQYADPZ40+CNtlE3XqGB8IarOrIeuiEb+3Cipd9SUQ0YkyNh51otOLhEZcQM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Lr7N3CI2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Lr7N3CI2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C09E7C4CEF8; Fri, 14 Nov 2025 13:52:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763128335; bh=igG5VMmWoHKLnwf6CijiKZdSI+7fNZg6xHGQzdiZQfw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Lr7N3CI25BnFp1HGJdualoqhk5aZxS25B+vk10TsOBwjyEwIVkDwUBBtVDTJigLsj jcVhyl5QSON/4UKv+cWstoAVG9JrZc3VP5dBWjyee933BN2WGf66btxwvcncSZ+AoY 5O8OjL93B3SJ2TM5Naakw25tyFt7PLqniIoXPk8fDvyF2NmWSIYSzDneXM6dh43Spd Xh1zqrfL8y5Lz+I+mfP53/1i42PkVT37MsQ70cPZvfmxfd9DLIt2Op9d9Nsae6jgpm l1fMeiRQAbVITUBzVe36ZblBFHWuWbQx1oGDH7iUsXelWlFr6uNaxcvqBSlHB7oWgO GP5j7JZqdj2Yw== Date: Fri, 14 Nov 2025 14:52:12 +0100 From: Frederic Weisbecker To: Eslam Khafagy Cc: anna-maria@linutronix.de, tglx@linutronix.de, gorcunov@gmail.com, syzkaller-bugs@googlegroups.com, linux-kernel@vger.kernel.org, syzbot+9c47ad18f978d4394986@syzkaller.appspotmail.com Subject: Re: [PATCH v2] posix-timers: Fix potential memory leak in do_timer_create() Message-ID: References: <20251114122739.994326-1-eslam.medhat1993@gmail.com> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20251114122739.994326-1-eslam.medhat1993@gmail.com> Le Fri, Nov 14, 2025 at 02:27:39PM +0200, Eslam Khafagy a écrit : > potential memory leak may happen if user space pointer created_timer_id > is invallid. or the value it points to is invalid. the call will > prematurely return. > However it doesn't free the memory it allocates with > alloc_posix_timer(). This patch attempts to fix that by moving parameter > check before alloc_posix_timer(). > > Reported-by: syzbot+9c47ad18f978d4394986@syzkaller.appspotmail.com > Closes: https://lore.kernel.org/all/69155df4.a70a0220.3124cb.0017.GAE@google.com/T/ > Fixes: ec2d0c04624b3 ("posix-timers: Provide a mechanism to allocate a given timer ID") > Suggested-by: Cyrill Gorcunov > Signed-off-by: Eslam Khafagy Reviewed-by: Frederic Weisbecker -- Frederic Weisbecker SUSE Labs