Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp262131ybg; Tue, 2 Jun 2020 23:34:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyz95CFkSWBB+eEH+lrfmo/t62VnebDFs8x2YBAzMnMhe8zDtQjoL5sI5vDwbRz0wyNyRrR X-Received: by 2002:a50:b082:: with SMTP id j2mr30425175edd.201.1591166087521; Tue, 02 Jun 2020 23:34:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591166087; cv=none; d=google.com; s=arc-20160816; b=N8TDhkPTtjtwdkonAte4uyDEzYVRcwJe5TsNtiiOdVZ99m0Wj4FGVGlqwF9YvgMsnr uLQOmn22YcK+XttlOhGuhmR3MnbSqs+kC/hA7IQf9W/tJ8vQB6qRFzDGmuC6peCOXXrM XAPZXadoqZ+g0kZsbdCo/Zpzbp3BLB8KG7EOEfbcTk7N7n5lLJWbh1Hutciogd+kch2x U6ebSRS6i8BSNFZN9kGDpKpfpY503L6yqymTManoPmq/aP58n/aM0Wm2Oz+7l1Nk0lhZ VGosImfiR5rLNBTFuCzTd5GblSGtO390Ygff2zdgwf1iVbpJUsquHlrr+jeG2LfPrOh4 QpSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:autocrypt :from:to:subject:cc:dkim-signature; bh=hVOaBp1/H7N5lPeg3KGLJi2shQykHyy6SuuocJKMg+Q=; b=VqikXZ+5QgcaHnYWnynZPChtaaK5eZrt4E0yzHyyeBYNmSMX6Ia9q9xOcoWxvuiKoY GevzQsBWuIldJglRtZbKpT+QhvsJVVWwj2lMUgz9LR56XTJN1B5bOXiHxJyg0M91HGXI YjorUYlIGSc9EbbjkRD5Dy+UdUT02g9BgP9DZBOgAQqMiYgEj7JXg3b2UaimBEW+F0DX zvLt0TKr3E1upM2XnYVwQcZGVhkTToir67v2vNc+rqy81Bufp4t0cy3W5tihxpiqJ3WM W0Sp4tHwpO2wVJ5YXw6fBGBsyMqC9ZdeKjfKAlzwUptNyV3dg+Qrh0pvBFzmXUW89EGl 9rmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=KjPJpsiy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r15si606467ejs.733.2020.06.02.23.34.23; Tue, 02 Jun 2020 23:34:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=KjPJpsiy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726024AbgFCGa6 (ORCPT + 99 others); Wed, 3 Jun 2020 02:30:58 -0400 Received: from mout.web.de ([212.227.15.3]:58611 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725810AbgFCGa5 (ORCPT ); Wed, 3 Jun 2020 02:30:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1591165849; bh=cTgwzYgW6iZx0BywIpBGa55ko5vfSGTY0u8M5uDF5sg=; h=X-UI-Sender-Class:Cc:Subject:To:From:Date; b=KjPJpsiycKjjP0dbXGHQrc4KcsgYfpmlHId7uaaQI99afb5r6KPTr/C2KRGs+32IZ SuO9mgEg43j71XzyPDmPc3GlYyPyXhkiRViHYxp/dtJrO2ooSqYWqXh32VA09FH94d MzEx6ipzJXCiCeVjj4m7L7ZzMQOeZaZmmwW62UAk= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.1.2] ([93.131.82.231]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LeLWP-1jCb121cXl-00qExW; Wed, 03 Jun 2020 08:30:49 +0200 Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, stable@vger.kernel.org, syzkaller@googlegroups.com, Al Viro , Sungjong Seo , Xiaolong Huang Subject: Re: [PATCH v2] exfat: fix memory leak in exfat_parse_param() To: Namjae Jeon , linux-fsdevel@vger.kernel.org From: Markus Elfring Autocrypt: addr=Markus.Elfring@web.de; prefer-encrypt=mutual; keydata= mQINBFg2+xABEADBJW2hoUoFXVFWTeKbqqif8VjszdMkriilx90WB5c0ddWQX14h6w5bT/A8 +v43YoGpDNyhgA0w9CEhuwfZrE91GocMtjLO67TAc2i2nxMc/FJRDI0OemO4VJ9RwID6ltwt mpVJgXGKkNJ1ey+QOXouzlErVvE2fRh+KXXN1Q7fSmTJlAW9XJYHS3BDHb0uRpymRSX3O+E2 lA87C7R8qAigPDZi6Z7UmwIA83ZMKXQ5stA0lhPyYgQcM7fh7V4ZYhnR0I5/qkUoxKpqaYLp YHBczVP+Zx/zHOM0KQphOMbU7X3c1pmMruoe6ti9uZzqZSLsF+NKXFEPBS665tQr66HJvZvY GMDlntZFAZ6xQvCC1r3MGoxEC1tuEa24vPCC9RZ9wk2sY5Csbva0WwYv3WKRZZBv8eIhGMxs rcpeGShRFyZ/0BYO53wZAPV1pEhGLLxd8eLN/nEWjJE0ejakPC1H/mt5F+yQBJAzz9JzbToU 5jKLu0SugNI18MspJut8AiA1M44CIWrNHXvWsQ+nnBKHDHHYZu7MoXlOmB32ndsfPthR3GSv jN7YD4Ad724H8fhRijmC1+RpuSce7w2JLj5cYj4MlccmNb8YUxsE8brY2WkXQYS8Ivse39MX BE66MQN0r5DQ6oqgoJ4gHIVBUv/ZwgcmUNS5gQkNCFA0dWXznQARAQABtCZNYXJrd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QFc1xxJhbzN+r9djSGGN/5IBDfUqSANC8cWzHpWaHmSuU3JSAMB/N+yQjIad2ztTckZY pwT6oxng29LzZspTYUEzMz3wK2jQHw+U66qBFk8whA7B2uAU1QdGyPgahLYSOa4XAEGb6wbI FEE= Message-ID: Date: Wed, 3 Jun 2020 08:30:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:mIHKvtfLhuIOyoNGc4V7Mx3NGtic38gULadTLZqbsEfB1hSbn23 6mi/jF5bm6GFwfF4rtT8exSljVQ6h0rg+oUnCIq0i9xBUmb2kv6SG84JbtSIM412rB+4TpX wTW++4+TfhBpmAZUFRVKVXpM1j8vM6bnJ/WJQcklePxl3Cq8dhNLTFR5IKsLyjYEqrXDpoI wyRPnE82RJa7SgvxObDIA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:o3o83DNXZkY=:UxQAMDqqSmr8KQCip4obXo LFfW38PTtCtm8b2qHneqtkX8u3TFKNw186zL8HVDaJoU6kmD64MmWv6NXtRa2prnC5f9pD5Jx Ec4SViohqTljv3wRPhThQtFPV/+Hw9z4yW1KqDoM047U6P9/qW3D20Q6opmL075betcmLb4eI DgUO4Ip7166oJMYDZ8s/Oq9JyTc0pwY7PKax2ELH8ouPirUKZ969j3bYt4mbvT4oG3p5LcoYL we1/nbN0ny41HqUOdEGye4KDnSLlu03LWCuaEHf4zQlAD3Z+Sxsxva7W+aKwvW4Avzvvx2KFN lk6JKvS7cp4NpHXFN01RrQ+kznSekDEyThgU7TR6J4Sf64PqJBUp5aI87OmS3T0BGyKzpwhKA d1Bo2tKrGUBVycKW6GX2Jz9v5aeMJ0wtOZCLKtg0f0EwTVqX13LwciOrtO1EF7PrC9oNfTzjv B8RuIVWB2a4pO+imfMiX4A56vjxwJY6eF3A5EIH5nYniISWv5MKKEhfybkd7ZXqmUgv8lIJC0 IHyGdfoaUxbtWCzxxOSd8k3Y/9WVRW8SkO5f980dDjUiYf0MYI2Ph03HzJPDxf8wjJ4zYXUJj tdiy/HaMfLi/s+0cQy/YXyS2EkvZGi+8xDQe3dR+uj7Cl+2BrjFfb37Xiu0y+ak2Sb7qVnyT2 Jr/q0qQKHy8xfh65dcbNMhqWUTu6kC0IW/Fc0lbd3jpgor8Ei0cMV2KWkiQmJQgS7Y7AM6sxn nROhOLNAXJ9UT/zNDsijKFPOt/lKwjkPDDXPvvDQVtgQsx4OFPSi6FoSh8o6g0mrMt4tZAV5Z 3+Gs4Obgnkn0+izD/z5vptvViTKUSVnAGlnN+Ko1+4eShPHu7YSPrqr/SJzh0l+bnSyNwckiX bvuCgA/2JXFabeQAaPKYfEZ3p6Hzoz70d6CVou7bzCQtTrpNPiWahNwJOH8UKTDmt4n9BnZK9 TZ4GlLqKoH9cBsCQclx138XqFAo7SCpcAw0hup8NqOjVNW9N2FIZidso/dkQ9cgcdfcKkHDTi vE/JKuOtgPMGGoK0rwO6hbYMxiXkUeMRiQpGPKQ3UQNdYrvQkmBt8hdIoFprmCvnlc2SNuQXf 6g9rPkcetg0MkZ9a3mmEBAaaaGJCUOgvYqe90dmJUNkjyZGzlMqoYh/Ed5YUtq96PLW8YiUsd 68ZuEufsWY8wzByHLaKpFURi1aILoNik6qNtUuGa6wvinOJsH9wajEgSWLpxo/ab87JEgX+KK J0YYo7qt4xIRvWw6g Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Additionally, there's no point copying param->string in > exfat_parse_param() - just steal it, leaving NULL in param->string. > That's independent from the leak or fix thereof - it's simply > avoiding an extra copy. I find it clearer to provide such a source code adjustment by a separate update step. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Do= cumentation/process/submitting-patches.rst?id=3Dd6f9469a03d832dcd17041ed67= 774ffb5f3e73b3#n138 Please move it into another patch. =E2=80=A6 > +++ b/fs/exfat/super.c =E2=80=A6 > @@ -686,7 +685,12 @@ static int exfat_get_tree(struct fs_context *fc) > > static void exfat_free(struct fs_context *fc) > { > - kfree(fc->s_fs_info); > + struct exfat_sb_info *sbi =3D fc->s_fs_info; > + > + if (sbi) { > + exfat_free_iocharset(sbi); > + kfree(sbi); > + } > } =E2=80=A6 Can it be helpful to annotate the added check according to branch predicti= on? Are valid pointers likely at this place? Regards, Markus