Received: by 10.223.176.46 with SMTP id f43csp776186wra; Sat, 20 Jan 2018 04:40:58 -0800 (PST) X-Google-Smtp-Source: AH8x225odhEiObNBpK7volW+Y5uyNKY9UlbVBfPUw+jUI51zhrkJ9SP0gV2psloQRWsn1Cd7A4pl X-Received: by 10.98.107.71 with SMTP id g68mr2184378pfc.96.1516452058039; Sat, 20 Jan 2018 04:40:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516452058; cv=none; d=google.com; s=arc-20160816; b=pD7MRmtjYyiFTfQnEmvW7Nxs3sVQu62SIgk294R8y2yhVgx9eDX8Sh3Tu9a2uiB8dC q6yYvJU+GB9eK1wyT1oCvW5yDvZACBUPMUvdvXVFtXcPgGnt48PQBODwBLgnxazaHezU xY0mgy3qwLEnqrHVhnQUuy10vFLJpOelqXZslQzQ1EdYZoaeCDw86G80xACZgEca5xr6 a9v/iyMpuRG046E1Z24Fr6EI/gK+6fNmVQYwFxyRWkHgGXnwQwPHbbLW/vEida5QMwMO AJSBSpKRoAJ3hAE8zwg6nrtMScIR/or+1qP6RmRqicBcQil9L9DnCfv4Rw6s7MvMin/y ihmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=KWUvA7KMAxbUn3RRldcQNzTiEE8WWxH7jlq3bht753k=; b=TIsEo7HzIdLDimAGG594mwLl4Tq1RoYbnSBg+4zSXekkbHXFxfiNHjAaGG1bK81HP9 T5+xz3Rv9h1Y3nI6LJfCJRjxlm7zK+/c3FGQl/+ypkfbgmdEr+PADm6tya9hpACAv3AW CfsXiBRRgJPpXCu9glz5ZNYBIb+nIyYKTdN0/lS7IBk8h8YuiZbpWZcuPFKWPE3C9iq2 Iomr21EkOb5O5GX4LGYRX8OgD/aZiei/G2fbBc5ZLDbkaptTwW15owXNNXuxaT9g5dcl Uuy2sRlEKgO/WalVURT4m+YpPgbRT4Bv/OeYnl9qZae2Tex1PRSmQhD3rAPOJmeTpIbq 1/tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qWAsRMir; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i9si9751401pgq.0.2018.01.20.04.40.44; Sat, 20 Jan 2018 04:40:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qWAsRMir; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755527AbeATMjU (ORCPT + 99 others); Sat, 20 Jan 2018 07:39:20 -0500 Received: from mail-pg0-f44.google.com ([74.125.83.44]:41354 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751269AbeATMjN (ORCPT ); Sat, 20 Jan 2018 07:39:13 -0500 Received: by mail-pg0-f44.google.com with SMTP id 136so3479994pgd.8 for ; Sat, 20 Jan 2018 04:39:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=KWUvA7KMAxbUn3RRldcQNzTiEE8WWxH7jlq3bht753k=; b=qWAsRMirvKM14as6wlkOk7AXAS6ZN+ueyhpGXKH0lf9d/CArVd9iDsnRHqaevToa4x DFDHiAkBgLPxe4uRWfI5jcGFQ9Nt8rnbquYx8eweJ/giXF1nVijprwde3VY7css5m4V2 r6Rbw3qDfSimEwr8xmpQ7xiIh5MKEB0KAeNUCSGNW5K94FpnCImB2zqGiuuk2hhacHy1 rrCbHPpKurQUc7YdKI2KhHPHEaceV34Twi4kQq/3aUXzxEH+P5VSPnzHHFA2HE1AGxGO azR8SsyCQfazB0wgy8+lQZhBTMP6biUB7xOvrRE3IPW26RFiUf8RgRrXoCKCKP17LAfX PUJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=KWUvA7KMAxbUn3RRldcQNzTiEE8WWxH7jlq3bht753k=; b=UkjMz6nmHzEuPQsmMUqjoij3pOHCzLwjtZspZk4x+6/FTmZUScTNqMpVaUCRn8SAvu 8Ptlu71WUoq9sr/ZFdmjMdwaSD2RQAcwtgcV7/D+qy1W8WrNf8FUKayvn/60wy17mfP2 +47+cU6mDd04m9Qfn/Qu1NudBK9zrXoy66r+9/IfPU32oKxPTWheg/qpimLuwhOPBNV3 RyLeTUbtpD3t0iasEnWAWexWe+b37px4HggoXVI2q8M9Tz/V6fnHlRFbYzWp/9PhnGgO mG+qBcOrgBldsgiwK5Xsb1SXnW827FtzTOsIrlJftutmuKYt9tKTqnLHwfhE4iBW+q59 unfg== X-Gm-Message-State: AKwxytcs2++a9UFlNcgiNgf6mUPqvOgZz2X+duS8iex2GGngO2HI0I4t 5sdoM5KXRWgIyrDAj2v0NJdzOZlDOO6/YR07oJglJyp5m3s= X-Received: by 10.98.107.71 with SMTP id g68mr2180035pfc.96.1516451952471; Sat, 20 Jan 2018 04:39:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.140.151 with HTTP; Sat, 20 Jan 2018 04:38:51 -0800 (PST) In-Reply-To: References: From: Dmitry Vyukov Date: Sat, 20 Jan 2018 13:38:52 +0100 Message-ID: Subject: Re: Possible Memory Leak in KCOV Linux 4.15-rc1 To: Shankara Pailoor Cc: LKML , syzkaller Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 19, 2018 at 8:29 PM, Shankara Pailoor wrote: > Hi Dmitry, > > I added support for kcov in strace and I have been tracing a fairly > large program but after a little while, I notice that when I mmap a > new cover buffer, the call fails with ENOMEM. After killing the > program, I try and rerun and I notice that there is nearly no memory > on the system. When I do a kmemleak scan I get the following reports: > > I believe the problem occurs when I try and setup the kcov buffer > again after an exec. Instead of reusing the old file descriptor I open > kcov again within that process. In that case, I don't know what > happens to the old kcov struct. > > I don't see a maintainers list for kcov so I decided to email you > directly. Let me know what more information I can provide. Hi Shankara, Looks bad. Can you provide a reproducer? We extensively use kcov with syzkaller, but have not observed such leaks. Also I don't see anything obvious in the code. Thanks