From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web09.3871.1608155115346989409 for ; Wed, 16 Dec 2020 13:45:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Vrf+A6tR; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608155114; 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=F/3QXlxxYmFd+HogchmavkxhvdX2j7pBECYqBa62SGw=; b=Vrf+A6tRsV3S3lVPC/dnAUYekP2yf+9V/lrOoQ7jfNkIQ60itnbrW+NFJLzuOZC3PD+/oM 1VgLCmfJPQVad+Gln/rHeKdnXed7wKhJPHzgiXDfaiLe4L9GL99Hh0Z6kcCGAwrgdPwxlQ VrVPFvX/jFWGra52LI2BkuBfX6Y4s8M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-379-QL2vaVxWO-usxFQy8A3QnA-1; Wed, 16 Dec 2020 16:45:12 -0500 X-MC-Unique: QL2vaVxWO-usxFQy8A3QnA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 76127180E475; Wed, 16 Dec 2020 21:45:11 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-152.ams2.redhat.com [10.36.114.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10458271A4; Wed, 16 Dec 2020 21:45:04 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io, virtio-fs@redhat.com, lersek@redhat.com Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2 PATCH 16/48] OvmfPkg/VirtioFsDxe: add helper for appending and sanitizing paths Date: Wed, 16 Dec 2020 22:10:53 +0100 Message-Id: <20201216211125.19496-17-lersek@redhat.com> In-Reply-To: <20201216211125.19496-1-lersek@redhat.com> References: <20201216211125.19496-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 RUZJX0ZJTEVfUFJPVE9DT0wuT3BlbigpIC0tIGZvciBvcGVuaW5nIGZpbGVzIC0tIGFuZApFRklf RklMRV9QUk9UT0NPTC5TZXRJbmZvKCkgLS0gIGZvciByZW5hbWluZyBmaWxlcyAtLSB3aWxsIHJl cXVpcmUgdXMgdG8KYXBwZW5kIGEgcmVsYXRpdmUgVUVGSSBwYXRobmFtZSB0byBhbiBhYnNvbHV0 ZSBiYXNlIHBhdGhuYW1lLiBJbiB0dXJuLApjb21wb25lbnRzIG9mIHRoZSByZXN1bHRhbnQgcGF0 aG5hbWVzIHdpbGwgaGF2ZSB0byBiZSBzZW50IHRvIHZpcnRpb2ZzZCwKd2hpY2ggZG9lcyBub3Qg Y29uc3VtZSBVRUZJLXN0eWxlIHBhdGhuYW1lcy4KCldlJ3JlIGdvaW5nIHRvIG1haW50YWluIHRo ZSBiYXNlIHBhdGhuYW1lcyBpbiBjYW5vbmljYWwgUE9TSVggZm9ybWF0OgotIGFic29sdXRlIChz dGFydHMgd2l0aCAiLyIpLAotIGRvdCAoLikgYW5kIGRvdC1kb3QgKC4uKSBjb21w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l0aW9uICBPbiBlbnRyeSwgcG9pbnRz IGF0IHRoZSBuZXh0IGNoYXJhY3RlciB0byBwcm9kdWNlDQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgKGkuZS4sIHJpZ2h0IHBhc3QgdGhlIGVuZCBvZiB0aGUgb3V0cHV0IHdyaXR0ZW4gYnkN CisgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgcGFyc2VyIHRodXMgZmFyKS4gVGhlIGxh c3QgY2hhcmFjdGVyIGluIHRoZQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlcidz IG91dHB1dCBidWZmZXIgaXMgYSBzbGFzaC4gT24gcmV0dXJuLCB0aGUNCisgICAgICAgICAgICAg ICAgICAgICAgICAgICBzbGFzaCBpcyBzdHJpcHBlZCwgYnkgZGVjcmVtZW50aW5nIFBvc2l0aW9u IGJ5IG9uZS4NCisgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiB0aGlzIGFjdGlvbiB3b3Vs ZCByZW1vdmUgdGhlIHNsYXNoIGNoYXJhY3Rlcg0KKyAgICAgICAgICAgICAgICAgICAgICAgICAg IHN0YW5kaW5nIGZvciB0aGUgcm9vdCBkaXJlY3RvcnksIHRoZW4gdGhlIGZ1bmN0aW9uDQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgaGFzIG5vIGVmZmVjdC4NCisqKi8NCitTVEFUSUMNCitW T0lEDQorUGFyc2VyU3RyaXBTbGFzaCAoDQorICBJTiAgICAgQ0hBUjggKkJ1ZmZlciwNCisgIElO IE9VVCBVSU5UTiAqUG9zaXRpb24NCisgICkNCit7DQorICBBU1NFUlQgKCpQb3NpdGlvbiA+PSAx KTsNCisgIEFTU0VSVCAoQnVmZmVyWypQb3NpdGlvbiAtIDFdID09ICcvJyk7DQorICBpZiAoKlBv c2l0aW9uID09IDEpIHsNCisgICAgcmV0dXJuOw0KKyAgfQ0KKyAgKCpQb3NpdGlvbiktLTsNCit9 DQorDQorLyoqDQorICBQcm9kdWNlIG9uZSBjaGFyYWN0ZXIgaW4gdGhlIHBhcnNlcidzIG91dHB1 dCBidWZmZXIuDQorDQorICBAcGFyYW1bb3V0XSBCdWZmZXIgICAgICAgVGhlIHBhcnNlcidzIG91 dHB1dCBidWZmZXIuIE9uIHJldHVybiwgQ2hhcjggd2lsbA0KKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIGhhdmUgYmVlbiB3cml0dGVuLg0KKw0KKyAgQHBhcmFtW2luLG91dF0gUG9zaXRpb24g IE9uIGVudHJ5LCBwb2ludHMgYXQgdGhlIG5leHQgY2hhcmFjdGVyIHRvIHByb2R1Y2UNCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAoaS5lLiwgcmlnaHQgcGFzdCB0aGUgZW5kIG9mIHRoZSBv dXRwdXQgd3JpdHRlbiBieQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBwYXJzZXIg dGh1cyBmYXIpLiBPbiByZXR1cm4sIFBvc2l0aW9uIGlzDQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgaW5jcmVtZW50ZWQgYnkgb25lLg0KKw0KKyAgQHBhcmFtW2luXSBTaXplICAgICAgICAg IFRvdGFsIGFsbG9jYXRlZCBzaXplIG9mIHRoZSBwYXJzZXIncyBvdXRwdXQgYnVmZmVyLg0KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgIFVzZWQgZm9yIHNhbml0eS1jaGVja2luZy4NCisNCisg IEBwYXJhbVtpbl0gQ2hhcjggICAgICAgICBUaGUgY2hhcmFjdGVyIHRvIHBsYWNlIGluIHRoZSBv dXRwdXQgYnVmZmVyLg0KKyoqLw0KK1NUQVRJQw0KK1ZPSUQNCitQYXJzZXJDb3B5ICgNCisgICAg IE9VVCBDSEFSOCAqQnVmZmVyLA0KKyAgSU4gT1VUIFVJTlROICpQb3NpdGlvbiwNCisgIElOICAg ICBVSU5UTiBTaXplLA0KKyAgSU4gICAgIENIQVI4IENoYXI4DQorICApDQorew0KKyAgQVNTRVJU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OICAgICBDSEFSOCAqQnVmZmVyLA0KKyAg SU4gT1VUIFVJTlROICpQb3NpdGlvbg0KKyAgKQ0KK3sNCisgIEFTU0VSVCAoKlBvc2l0aW9uID49 IDIpOw0KKyAgQVNTRVJUIChCdWZmZXJbKlBvc2l0aW9uIC0gMV0gPT0gJy4nKTsNCisgIEFTU0VS VCAoQnVmZmVyWypQb3NpdGlvbiAtIDJdID09ICcvJyk7DQorICAoKlBvc2l0aW9uKS0tOw0KK30N CisNCisvKioNCisgIFJld2luZCB0aGUgbGFzdCBkb3QtZG90IGluIHRoZSBwYXJzZXIncyBvdXRw dXQgYnVmZmVyLg0KKw0KKyAgQHBhcmFtW2luXSBCdWZmZXIgICAgICAgIFRoZSBwYXJzZXIncyBv dXRwdXQgYnVmZmVyLiBPbmx5IHVzZWQgZm9yDQorICAgICAgICAgICAgICAgICAgICAgICAgICAg c2FuaXR5LWNoZWNraW5nLg0KKw0KKyAgQHBhcmFtW2luLG91dF0gUG9zaXRpb24gIE9uIGVudHJ5 LCBwb2ludHMgYXQgdGhlIG5leHQgY2hhcmFjdGVyIHRvIHByb2R1Y2UNCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAoaS5lLiwgcmlnaHQgcGFzdCB0aGUgZW5kIG9mIHRoZSBvdXRwdXQgd3Jp dHRlbiBieQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBwYXJzZXIgdGh1cyBmYXIp OyB0aGUgcGFyc2VyJ3Mgb3V0cHV0IGJ1ZmZlcg0KKyAgICAgICAgICAgICAgICAgICAgICAgICAg IGVuZHMgd2l0aCB0aGUgY2hhcmFjdGVycyAoJy8nLCAnLicsICcuJykuIE9uIHJldHVybiwNCisg ICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgKCcuJywgJy4nKSBwYWlyIGlzIHJld291bmQg dW5jb25kaXRpb25hbGx5LCBieQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlY3JlbWVu dGluZyBQb3NpdGlvbiBieSB0d287IGEgc2xhc2ggY2hhcmFjdGVyDQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgcmVzaWRlcyBhdCB0aGUgbmV3IGVuZCBvZiB0aGUgcGFyc2VyJ3Mgb3V0cHV0 DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLg0KKw0KKyAgICAgICAgICAgICAg ICAgICAgICAgICAgIElmIHRoaXMgc2xhc2ggY2hhcmFjdGVyIHN0YW5kcyBmb3IgdGhlIHJvb3QN CisgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXJlY3RvcnksIHRoZW4gUm9vdEVzY2FwZSBp cyBzZXQgdG8gVFJVRS4NCisNCisgICAgICAgICAgICAgICAgICAgICAgICAgICBPdGhlcndpc2Ug KGkuZS4sIGlmIHRoaXMgc2xhc2ggY2hhcmFjdGVyIGlzIG5vdCB0aGUNCisgICAgICAgICAgICAg ICAgICAgICAgICAgICBvbmUgc3RhbmRpbmcgZm9yIHRoZSByb290IGRpcmVjdG9yeSksIHRoZW4g dGhlIHNsYXNoDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhcmFjdGVyLCBhbmQgdGhl IHBhdGhuYW1lIGNvbXBvbmVudCBwcmVjZWRpbmcgaXQsDQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgYXJlIHJlbW92ZWQgYnkgZGVjcmVtZW50aW5nIFBvc2l0aW9uIGZ1cnRoZXIuIEluDQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyBjYXNlLCB0aGUgc2xhc2ggY2hhcmFjdGVy IHByZWNlZGluZyB0aGUgcmVtb3ZlZA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhu YW1lIGNvbXBvbmVudCB3aWxsIHJlc2lkZSBhdCB0aGUgbmV3IGVuZCBvZiB0aGUNCisgICAgICAg ICAgICAgICAgICAgICAgICAgICBwYXJzZXIncyBvdXRwdXQgYnVmZmVyLg0KKw0KKyAgQHBhcmFt W291dF0gUm9vdEVz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ICAgICAgcHJvZHVjaW5nIFJlc3VsdFBhdGg4LiBPdGhl cndpc2UgKGkuZS4sIGlmIFJoc1BhdGgxNg0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGlz IHJlbGF0aXZlKSwgUmhzUGF0aDE2IGlzIHRyYW5zbGl0ZXJhdGVkIHRvIENIQVI4LA0KKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIGFuZCBuYWl2ZWx5IGFwcGVuZGVkIHRvIExoc1BhdGg4LiBU aGUgcmVzdWx0YW50DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVzZWQgcGF0aG5hbWUg aXMgdGhlbiBzYW5pdGl6ZWQsIHRvIHByb2R1Y2UNCisgICAgICAgICAgICAgICAgICAgICAgICAg ICBSZXN1bHRQYXRoOC4NCisNCisgIEBwYXJhbVtvdXRdIFJlc3VsdFBhdGg4ICBUaGUgUE9TSVgt c3R5bGUsIGNhbm9uaWNhbCBmb3JtYXQgcGF0aG5hbWUgdGhhdA0KKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIGxlYWRzIHRvIHRoZSBmaWxlIGRlc2lyZWQgYnkgdGhlIGNhbGxlci4gQWZ0ZXIg dXNlLA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBjYWxsZXIgaXMgcmVzcG9uc2li bGUgZm9yIGZyZWVpbmcgUmVzdWx0UGF0aDguDQorDQorICBAcGFyYW1bb3V0XSBSb290RXNjYXBl ICAgU2V0IHRvIFRSVUUgaWYgYXQgbGVhc3Qgb25lIGRvdC1kb3QgY29tcG9uZW50IGluDQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgUmhzUGF0aDE2IGF0dGVtcHRlZCB0byBlc2NhcGUgdGhl IHJvb3QgZGlyZWN0b3J5Ow0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldCB0byBGQUxT RSBvdGhlcndpc2UuDQorDQorICBAcmV0dmFsIEVGSV9TVUNDRVNTICAgICAgICAgICAgUmVzdWx0 UGF0aDggaGFzIGJlZW4gcHJvZHVjZWQuIFJvb3RFc2NhcGUgaGFzDQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYmVlbiBvdXRwdXQuDQorDQorICBAcmV0dmFsIEVGSV9JTlZBTElE X1BBUkFNRVRFUiAgUmhzUGF0aDE2IGlzIHplcm8tbGVuZ3RoLg0KKw0KKyAgQHJldHZhbCBFRklf SU5WQUxJRF9QQVJBTUVURVIgIFJoc1BhdGgxNiBmYWlsZWQgdGhlDQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgVklSVElPX0ZTX01BWF9QQVRITkFNRV9MRU5HVEggY2hlY2suDQor DQorICBAcmV0dmFsIEVGSV9PVVRfT0ZfUkVTT1VSQ0VTICAgTWVtb3J5IGFsbG9jYXRpb24gZmFp bGVkLg0KKw0KKyAgQHJldHZhbCBFRklfT1VUX09GX1JFU09VUkNFUyAgIFJlc3VsdFBhdGg4IHdv dWxkIGhhdmUgZmFpbGVkIHRoZQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZJ UlRJT19GU19NQVhfUEFUSE5BTUVfTEVOR1RIIGNoZWNrLg0KKw0KKyAgQHJldHZhbCBFRklfVU5T VVBQT1JURUQgICAgICAgIFJoc1BhdGgxNiBjb250YWlucyBhIGNoYXJhY3RlciB0aGF0IGVpdGhl cg0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbGxzIG91dHNpZGUgb2YgdGhl IHByaW50YWJsZSBBU0NJSSBzZXQsIG9yDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgaXMgYSBmb3J3YXJkIHNsYXNoLg0KKyoqLw0KK0VGSV9TVEFUVVMNCitWaXJ0aW9Gc0FwcGVu ZFBhdGggKA0KKyAgSU4gICAgIENIQVI4ICAgKkxoc1BhdGg4LA0KKyAgSU4gICAgIENIQVIxNiAg KlJoc1BhdGgxNiwNCisgICAgIE9VVCBDSEFSOCAgICoqUmVzdWx0UGF0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2VySW5pdDogLy8ganVzdCBzdGFydGlu Zw0KKyAgICAgIEFTU0VSVCAoQ2hyOCA9PSAnLycpOw0KKyAgICAgIFBhcnNlckNvcHkgKFNhbml0 aXplZEJ1ZmZlciwgJlNhbml0aXplZFBvc2l0aW9uLCBTaXplVG9TYW5pdGl6ZSwgQ2hyOCk7DQor ICAgICAgU3RhdGUgPSBQYXJzZXJTbGFzaDsNCisgICAgICBicmVhazsNCisNCisgICAgY2FzZSBQ YXJzZXJTbGFzaDogLy8gc2xhc2goZXMpIHNlZW4NCisgICAgICBzd2l0Y2ggKENocjgpIHsNCisg ICAgICBjYXNlICdcMCc6DQorICAgICAgICBQYXJzZXJTdHJpcFNsYXNoIChTYW5pdGl6ZWRCdWZm ZXIsICZTYW5pdGl6ZWRQb3NpdGlvbik7DQorICAgICAgICBQYXJzZXJDb3B5IChTYW5pdGl6ZWRC dWZmZXIsICZTYW5pdGl6ZWRQb3NpdGlvbiwgU2l6ZVRvU2FuaXRpemUsIENocjgpOw0KKyAgICAg ICAgU3RhdGUgPSBQYXJzZXJFbmQ7DQorICAgICAgICBicmVhazsNCisgICAgICBjYXNlICcvJzoN CisgICAgICAgIC8vDQorICAgICAgICAvLyBza2lwICYgc3RheSBpbiBzYW1lIHN0YXRlDQorICAg ICAgICAvLw0KKyAgICAgICAgYnJlYWs7DQorICAgICAgY2FzZSAnLic6DQorICAgICAgICBQYXJz ZXJDb3B5IChTYW5pdGl6ZWRCdWZmZXIsICZTYW5pdGl6ZWRQb3NpdGlvbiwgU2l6ZVRvU2FuaXRp emUsIENocjgpOw0KKyAgICAgICAgU3RhdGUgPSBQYXJzZXJEb3Q7DQorICAgICAgICBicmVhazsN CisgICAgICBkZWZhdWx0Og0KKyAgICAgICAgUGFyc2VyQ29weSAoU2FuaXRpemVkQnVmZmVyLCAm U2FuaXRpemVkUG9zaXRpb24sIFNpemVUb1Nhbml0aXplLCBDaHI4KTsNCisgICAgICAgIFN0YXRl ID0gUGFyc2VyTm9ybWF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