From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934131AbbDXXQz (ORCPT ); Fri, 24 Apr 2015 19:16:55 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:53895 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933797AbbDXXQw (ORCPT ); Fri, 24 Apr 2015 19:16:52 -0400 Message-ID: <553ACEE2.3030407@fb.com> Date: Fri, 24 Apr 2015 16:16:50 -0700 From: "Daniel Colascione (SEATTLE)" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Subject: Shouldn't mangle_path always mangle '\\'? Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bKBvW98Rl234WwlHtbA7G5WgefNTBTjgt" X-Originating-IP: [192.168.52.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-04-24_06:2015-04-24,2015-04-24,1970-01-01 signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --bKBvW98Rl234WwlHtbA7G5WgefNTBTjgt Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable mangle_path accepts a string listing the characters it's supposed to escape. Some, but not all, callers put backslash in this set. Shouldn't we be escaping '\' regardless, since it's the character used to signal all other escapes? diff --git a/fs/seq_file.c b/fs/seq_file.c index 555f821..02dcd5c 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c @@ -443,7 +443,7 @@ char *mangle_path(char *s, const char *p, const char *esc) char c =3D *p++; if (!c) { return s; - } else if (!strchr(esc, c)) { + } else if (s !=3D '\\' && !strchr(esc, c)) { *s++ =3D c; } else if (s + 4 > p) { break; --bKBvW98Rl234WwlHtbA7G5WgefNTBTjgt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJVOs7iAAoJEN4WImmbpWBlVskQAKNSmD8siRKJHxh8LESoX8oM KBwDJpTcP1Yr6cJq1rDskNYdKknfdX6DsvghwxhzJFgzI94DWDBwgNQA5g9eMLYc OUB3aiEw2wf4e8du6UC3qtaUskLQMtqum504muUTqqAJXHmmes8ITSxAlEHVwvkB Qe1qnxzSTrmgA1a7XD/rILhA0rwnePYmO0Kys8JsvabxjxGJpajpJHwr8LWOr/iV I1sk/m1+Tbo8riLLoMe6TjAHeZNzvlVNEw794FqlxMYK2K3L/26TBjEUTtLhVeqG PuShHwA7KYWwXHBpl4URGoA3uvr1WNUf7xSs1o5sEAP3mMKDfILMJ6gLOiLZwP6H D494atvbRR00TLuG8QF7AeKYx7WZQmm78HAc6qFT21ZdaSHayYHSF6x+RdpWCNEG ca5mnXKlTpdoqFV/RcSPgNWQwYz5Xeb1t1PQyoaJ0rPOzPbB9OP/vPXvJpiFwYFy ePqZ26nbsrgGumOcaF0rLCaY6ZpEHHu5/amfMDgo+35+2eTc9C1wWePU6BINNxdn EntSpgiqaTzBV1r8le5HvRZ4NnIAnU1Fex43o9hk+cOSJNCYEqAJ+Pd+lTZoPEvD HL+rAn2xJQwdyoc47i0ZaY4oaQpO4HImPqMCvthjsY9Mtr62Ay38m7xlxeCvI7Yk BJoddoVR0HQyldXHaHoV =UIOa -----END PGP SIGNATURE----- --bKBvW98Rl234WwlHtbA7G5WgefNTBTjgt--