Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2768539imj; Mon, 11 Feb 2019 08:11:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IbQkVe2L+okeZ2rCIUUWyUCPeUbYoY5Spe91oHr7FoFx//o9RPm1j6xbUBqU6PpmYlM0TWy X-Received: by 2002:a17:902:7202:: with SMTP id ba2mr11437654plb.147.1549901470298; Mon, 11 Feb 2019 08:11:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901470; cv=none; d=google.com; s=arc-20160816; b=SikdF89EdJHw8jU7xjO1uNyKb3y4eHSoaKY5hwF5qpJ/ZXWjH6HoqSV+XPpQwNJHYS mbCDtww/Xh3GXwk3MID2tteu2AKyoo5glYTSmQvWBKNnJI1HsVWM2bYEfduj2HVZXE6D klC4DenI5Xvsl24gwVg2hp2rIZMUhxtDtGIVWJLmA9pilB7UnrDW7JxF0Jr7nnuFRbe8 CDJOR02CwCrKZrwzCi3F7pt2H1JoVHC2MRznzkWL8DSkWn9n0wAKneYxCunSCNZOhS+S 6aknVFnQC9aw+StaI7chmqw2DbUyB8vKPoeQth5UMvhgmHlWXwmE9F9nNu2J7eF9/LUx mmMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=Bjd850XNZXI4fTB7GkNTYWYXmyT8nYTFelIdNuUjk3I=; b=DdoGOStPUD+V3uAxOxra9TVeU/qTqk0VXPFnOvjnNyZnPFXb4iCqzAhY0iotU7S9k6 8lqLVo/FsfM49mtMk78d9DY2c/u9z4WOeWeBpxQwA0R9mgSy6G1sQ0ZS3IMw0W7df/J7 l02pxVkBjWPq2KF9JEUf30Cq6lpRYC7oVe4J2gIqNXjgfxwYU2RplhR05SRPMgfgG01n 6igYSZI87Q8Sf3V5q/MwZPUdYiipxvvQtc0HVyKOD+tdNFmgETL4/LWQECftcjItgS22 4qL/2Nl2OmgCbcZ/02/O4zFUyObfbrQXs+zErky0L4XgPBSgAq2m5I/uC6KpeQoT8NPo tjZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digidescorp.com header.s=google header.b=TJu5dp7U; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si8038189pgk.201.2019.02.11.08.10.53; Mon, 11 Feb 2019 08:11:10 -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=@digidescorp.com header.s=google header.b=TJu5dp7U; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728211AbfBKOZG (ORCPT + 99 others); Mon, 11 Feb 2019 09:25:06 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:37816 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729317AbfBKOZD (ORCPT ); Mon, 11 Feb 2019 09:25:03 -0500 Received: by mail-it1-f195.google.com with SMTP id b5so26579723iti.2 for ; Mon, 11 Feb 2019 06:25:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digidescorp.com; s=google; h=from:to:cc:subject:date:message-id; bh=Bjd850XNZXI4fTB7GkNTYWYXmyT8nYTFelIdNuUjk3I=; b=TJu5dp7UGIivCkh7lXhsMgPxt2HtBF5nsD3z3tfWFWiiDjBMVq3T4RsVXuJUNsBjix mw9UWVTH6f5fC310sEcTHICcPu7cssiFTVu+rKbrAoOH0KQ11byAsAvkxH4ivkRB1Twa Hxyw1rM6LlemSF8FDDZ45UAY7aN6aRPxXU9bw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Bjd850XNZXI4fTB7GkNTYWYXmyT8nYTFelIdNuUjk3I=; b=sgxI4CIjD0WeTpmi800isVBU2rEFvC0CbbjDri1CyfVQlJEA6QnhfBfJF3fx7GiYpK HF60tyVlK0DGctWsMPcKJQbvFj72TN33BIL/iu0rurvIcDNd56elzHxJWp+qsS4ZdoMJ AeuCIJ7TQ0DjSVAn+GwxQMhzWDa2Jx4D0DxmQ8hjqBgAUf623rKxMVRM2oFi6Im+/gA/ v4RGK7v6yH21a9OXorDmUezUMEMX8dWI2UEdUT5/E8+njznABgOTehJez4mHC0uuRnSl lRib09DYoDW4O+QAXMXRY/AJTdd6qssWDEDsioicJejjwt0AVzmcGP1kSf+rYmD+NFTB wMJw== X-Gm-Message-State: AHQUAuZH5aDcgNA6Nx8to+IfHp6Gz37RKrSFPcF7bUkK6wAD9eOfzUK7 v9sQYsTdys5p1C4zouC2Aru4Qg== X-Received: by 2002:a6b:ee19:: with SMTP id i25mr19099596ioh.149.1549895103038; Mon, 11 Feb 2019 06:25:03 -0800 (PST) Received: from iscandar.digidescorp.com ([50.73.98.161]) by smtp.googlemail.com with ESMTPSA id j142sm5300878itj.40.2019.02.11.06.25.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 06:25:02 -0800 (PST) From: Steve Magnani X-Google-Original-From: Steve Magnani To: jack@suse.com Cc: linux-kernel@vger.kernel.org, "Steven J . Magnani" Subject: [PATCH] udf: disallow RW mount without valid integrity descriptor Date: Mon, 11 Feb 2019 08:24:38 -0600 Message-Id: <20190211142438.16599-1-steve@digidescorp.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Refuse to mount a volume read-write without a coherent Logical Volume Integrity Descriptor, because we can't generate truly unique IDs without one. This fixes a bug where all inodes created on a UDF filesystem following mount without a coherent LVID are assigned UID 0. Signed-off-by: Steven J. Magnani --- --- a/fs/udf/super.c 2018-11-16 06:43:00.622344354 -0600 +++ b/fs/udf/super.c 2019-02-11 08:08:00.478331631 -0600 @@ -1474,6 +1474,17 @@ static int udf_load_logicalvol(struct su if (lvd->integritySeqExt.extLength) udf_load_logicalvolint(sb, leea_to_cpu(lvd->integritySeqExt)); ret = 0; + + if (!sbi->s_lvid_bh) { + /* We can't generate UIDs without a valid LVID */ + if (sb_rdonly(sb)) + UDF_SET_FLAG(sb, UDF_FLAG_RW_INCOMPAT); + else { + udf_warn(sb, "Damaged or missing LVID, forcing " + "readonly mount\n"); + ret = -EACCES; + } + } out_bh: brelse(bh); return ret;