From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AB8AC2D0E4 for ; Fri, 27 Nov 2020 09:08:04 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8BD6420809 for ; Fri, 27 Nov 2020 09:08:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OIf9q7Nl"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OIf9q7Nl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BD6420809 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4Cj80x2p58zDrgP for ; Fri, 27 Nov 2020 20:08:01 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=216.205.24.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=hsiangkao@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OIf9q7Nl; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OIf9q7Nl; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Cj80l5GtrzDrBk for ; Fri, 27 Nov 2020 20:07:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606468067; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LOyp5qrAuEK5VI28blGnE0Zm0JfJdklUohIkT1cALGc=; b=OIf9q7NlaiTWpNaB++N9kMoYnjP/mnQxJLbE8Axp8FRrplFz1AVgseHvD9kunO617wKtJ5 zSCf3g7hxZfgRiBVNjxlAm0POV2iZEHNAUjUE+75a9ysQf1M1R4JQg2xz7dtmCdP/26bWY XzKc3KPRNq6aSe4QTM9LEdcZ5nErtBQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606468067; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LOyp5qrAuEK5VI28blGnE0Zm0JfJdklUohIkT1cALGc=; b=OIf9q7NlaiTWpNaB++N9kMoYnjP/mnQxJLbE8Axp8FRrplFz1AVgseHvD9kunO617wKtJ5 zSCf3g7hxZfgRiBVNjxlAm0POV2iZEHNAUjUE+75a9ysQf1M1R4JQg2xz7dtmCdP/26bWY XzKc3KPRNq6aSe4QTM9LEdcZ5nErtBQ= Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-475-uL_WVOo5M-a7qwWHCvNYxA-1; Fri, 27 Nov 2020 04:07:45 -0500 X-MC-Unique: uL_WVOo5M-a7qwWHCvNYxA-1 Received: by mail-pg1-f199.google.com with SMTP id b35so3354863pgl.8 for ; Fri, 27 Nov 2020 01:07:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=LOyp5qrAuEK5VI28blGnE0Zm0JfJdklUohIkT1cALGc=; b=ttkTLbgB6IAL/+gVh4LdL9n8X/+bNQmqNOOkuei8nHSIgGgndNsxl1YE2aovDuh2gD JvDeZHGtNO1lHTRmw354vOrXTqqIUCr97iYoORWZK9CCCiFjanl3ooNsGn5im0oK6g3x tK8OCh44tFRnWI39av7h5FZsc2pFcysdILADn6X6jMDcx4fUkVfVnPMWMdnh5xzw0YAq Mzw1RMMMg1VfAgfA6E2OZv8goBls182HtmoyUKbv2DNyQ2MCenN2mwDq6oyaGrotxNhW qcbVHKFlyLj0Ha2qJCLFI6xJb7iTbtiBEyChwg1rrARl4iKh4z+Rp6uoYiPksi9j4vJ3 Vq3w== X-Gm-Message-State: AOAM533R4n6sOpMrqPLyfPErdJYC3EErZHNbQ3ncPYNRiooU8oT4oHmf rBEfU5QzDWFjWSVMduzzbPN4v57aJSJR3puxbWsNWEkynXLaxTQ38A/++Fjb7fXQQPzRGQEY7xs tAdV12PpJf8ZKcHVWQOzsQ+Ju X-Received: by 2002:a17:90b:11d3:: with SMTP id gv19mr8728580pjb.232.1606468064184; Fri, 27 Nov 2020 01:07:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzAgeqjTGXl3qforlMQC/cegoFf1R9dr2+lxh2o7Ama2MzmDw2MR1H0juwd6U3RjJrjNeZZIg== X-Received: by 2002:a17:90b:11d3:: with SMTP id gv19mr8728558pjb.232.1606468063939; Fri, 27 Nov 2020 01:07:43 -0800 (PST) Received: from xiangao.remote.csb ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id x24sm6834852pgh.17.2020.11.27.01.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Nov 2020 01:07:43 -0800 (PST) Date: Fri, 27 Nov 2020 17:07:32 +0800 From: Gao Xiang To: Huang Jianan Subject: Re: [PATCH] erofs-utils: fix random data in shared xattrs Message-ID: <20201127090732.GA598572@xiangao.remote.csb> References: <20201127083334.32738-1-huangjianan@oppo.com> MIME-Version: 1.0 In-Reply-To: <20201127083334.32738-1-huangjianan@oppo.com> User-Agent: Mutt/1.10.1 (2018-07-13) Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hsiangkao@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guoweichao@oppo.com, linux-erofs@lists.ozlabs.org, zhangshiming@oppo.com Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On Fri, Nov 27, 2020 at 04:33:34PM +0800, Huang Jianan wrote: > There will be holes between xattr entry after EROFS_XATTR_ALIGN, so > we should clear shared xattrs buff to avoid random data. > > Signed-off-by: Huang Jianan > Signed-off-by: Guo Weichao > --- Looks good, Reviewed-by: Gao Xiang It's mandatory for reproducable build. Also, need to fix the bufops out-of-bound access as well (Will check this weekend). Thanks, Gao Xiang > lib/xattr.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/xattr.c b/lib/xattr.c > index 1ce3fb3..f9ec78c 100644 > --- a/lib/xattr.c > +++ b/lib/xattr.c > @@ -547,7 +547,7 @@ int erofs_build_shared_xattrs_from_path(const char *path) > if (!shared_xattrs_size) > goto out; > > - buf = malloc(shared_xattrs_size); > + buf = calloc(1, shared_xattrs_size); > if (!buf) > return -ENOMEM; > > -- > 2.25.1 > > ________________________________ > OPPO > > 本电子邮件及其附件含有OPPO公司的保密信息,仅限于邮件指明的收件人使用(包含个人及群组)。禁止任何人在未经授权的情况下以任何形式使用。如果您错收了本邮件,请立即以电子邮件通知发件人并删除本邮件及其附件。 > > This e-mail and its attachments contain confidential information from OPPO, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! >