Received: by 2002:ab2:5c0e:0:b0:1ef:a325:1205 with SMTP id i14csp294423lqk; Thu, 14 Mar 2024 03:26:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUeqCHp9Mfboc16lm8tJ4bDGzRaGkiLzvHh1rBJekVDB1hlu5Fra0LUfuHx85HRTrfK9FD3NOWDgbh33iyi/x7xJx0vrurELevjLsb8Lw== X-Google-Smtp-Source: AGHT+IHYJlgXiE+NtX7LnpWKBItwZ4UdFJnx2aMmHxxhwd1+qp7/aUu160gDUGiQT24d20PH5IQF X-Received: by 2002:a17:907:33d3:b0:a46:1a14:3563 with SMTP id zk19-20020a17090733d300b00a461a143563mr886600ejb.50.1710412015772; Thu, 14 Mar 2024 03:26:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710412015; cv=pass; d=google.com; s=arc-20160816; b=jIyjVhY5nOg5ZLYOdYdVxrne3q2Iees3MBwhNJtFkVEXUh9Os2x/RTYNn7wXska+Si 30vM+1CpFCRjzISvud24u9KLzr3Bx2RB5g9QXNOFDe2Q9KcceJZEgcKOLrjG48BO3Oyy JPtxApYKUTVVJG0EDjh+6q8XJgg7UB3dK1wQhe7Z1xDE9K5mUuDwWnLFPCHpEEWO3hRM LEFq42V73Dlo+NFs3ACq481HZy2i/cBoz4eNrrFm/lRBFPiX+Cf4jDtaklK08uDFGna/ DjjcT0HrATN7kEGMDH6t/16NkCnb76gDccIaic5XJRqF0Q8qDxdijDCp1QN/gCXulmEQ chuA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=BXmd1smb+1tQUSUN5Krj3Ey1bflfCa1N+wP3Jumbn2E=; fh=Y0iKJJH7vozH2KxIp/YXEtVAOebrwY6suqVXhFFgVaM=; b=h+gS2INxbNUccczoSaTfcusYkLTB86giOvoV6puheAJZpoYQd9//dH6P9KDwKYROvw 2IxYkWvdsoQcmFs4bAuhvSnr4sYU2naBVYK56dbQ1mTxmt1v2Ztn6VUUWXt/Bbz2A8I5 J+C8nfCR0Dq6rvAYW8+g/svCv/S3iafjWzOYcIM2Q33ofk50N9IurXiFh09P1g/EPq+O NJ1Q4GzVDovnMa38efcxyPAymFf9tI1ZcpUP1Vf0pNYUftF6/kb858lyziHn9iDPAEYG t+rNchyVJYvF68p1y+fxg36ZaJNTqjEP+rKWi7j9Ypjm44eyhDBsMIMI5ybNvhRg3GCd mukA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=hn8Ssc0k; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-103111-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103111-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cf20-20020a170906b2d400b00a45ead7b3f0si581201ejb.400.2024.03.14.03.26.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 03:26:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103111-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=hn8Ssc0k; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-103111-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103111-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7B10B1F239AC for ; Thu, 14 Mar 2024 10:20:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2FE5B6EB4B; Thu, 14 Mar 2024 10:20:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="hn8Ssc0k"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dTlw/6Zs" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 E89BD6BFAC; Thu, 14 Mar 2024 10:20:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710411639; cv=none; b=IMrmVV1ngbVvrlRtaaU96mfK8VDHLxcc8IxXsve3a9wZYGQ1QO85InBIo1q2d1VdLYUU+CsmcWWIg/FHsmOx9OtO0PlW7sgH1wq/J8D8cl7e5UTlf8Z6dJ/mRcF065U4IJHn7Z9Urx6neMpVHCQtYJlxCVuCyYW/afA7dqs2MN8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710411639; c=relaxed/simple; bh=82h2+iV8XEivGIcdU7fx2Zr3EONorrMCWp43nILiMs8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=gD25wOnjPFGrEjxTJZ6ojdZMJ0X7gVWVeVxlavLKIO9u/BKT/GR3RyqIaeW2lUJLcLmB7TBk/DuCCJBt3cHEfqkrh8jvB9yum16Y5Cwj1QqugeXVb4s11V/w2sfm/b1HDghqjwXpoy7j05OgAO8taQPHLPlCE2H/B+4C0TTztOE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=hn8Ssc0k; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=dTlw/6Zs; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1710411635; 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=BXmd1smb+1tQUSUN5Krj3Ey1bflfCa1N+wP3Jumbn2E=; b=hn8Ssc0k+eh0KolOc/wmr+q4lV5wTdlJ3Xek93r4teQW7VWYCY04nA2sj2/8BSfzfrS391 6XQrINZsiAquijkpKCMCbVTK42BRrPyL2u0bJqdmU3eI5cIHwPs38j1CIutv05SMQkLHJz LDcA2PqoabQ6Xv7FHdIQWJYhT4sllcybadTMDonOYZ/83mlNgPrpLzGV2V05oUtzMW79MX jtXjo8CzqlEfloPxf4Hq3RJKxU8vFlkq+oQ+k3OncQESvs8x7+xmWeawQZzZcpllr5r0Qo tkwQ74pfDYur7XU6pc56Aor87NSrdY2ajm3ApmZyeeMYApjHO5iu8jLWiv5c+w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1710411635; 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=BXmd1smb+1tQUSUN5Krj3Ey1bflfCa1N+wP3Jumbn2E=; b=dTlw/6ZsGM11mKS4bdM5Tgz3NTKNWgJRaOm82bPrYO/VhsDz2Z0LQ8Gc2GMo+aRcYswG3t SZsDEn15Txp3APCw== To: Z qiang , =?utf-8?B?5p+z6I+B5bOw?= Cc: "richardcochran@gmail.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "syzkaller@googlegroups.com" , "secalert@redhat.com" Subject: Re: memory leak in posix_clock_open In-Reply-To: References: Date: Thu, 14 Mar 2024 11:20:35 +0100 Message-ID: <87frwtm7ws.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Mon, Mar 11 2024 at 17:46, Z qiang wrote: > > diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c > index 9de66bbbb3d1..71d9d8c394fa 100644 > --- a/kernel/time/posix-clock.c > +++ b/kernel/time/posix-clock.c > @@ -137,6 +137,8 @@ static int posix_clock_open(struct inode *inode, > struct file *fp) > > if (!err) { > get_device(clk->dev); > + } else { > + kfree(pccontext); > } > out: > up_read(&clk->rwsem); Looks about right. Can you please send a proper patch?