Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2392616pxb; Mon, 20 Sep 2021 21:11:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWzC4G2gk/GvVYgluVqMpZQXsfIsAM6eNrNKP1sRonVOEcNyAeGSF+o5wH1m+ImuLjfc6s X-Received: by 2002:a05:6402:21e6:: with SMTP id ce6mr32456409edb.153.1632197477453; Mon, 20 Sep 2021 21:11:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632197477; cv=none; d=google.com; s=arc-20160816; b=Vl68mwKIzwwET13qEmhixGciA+pjBtZrGoJAC6d4fEzwN96WJMlHtmTuXKRQq5+lff 9YH9Oqxx8QRfpw9H6wP1Y6b4jUzXqrwNBYYBt9cTl/k/NBqHOAgpPLLPvjqYFPNZNr1c OOmXGqVfaiyHVuW73/UEh9tjyqLD5NySGUO4WG1PingOy+td1IptB6xT/U4lSM1Xn8yT EGqX7rVPpDDat05FwY0dpR+vkvgIs7lRXowBLQujKmvVG9pkUD1HbRic1lanrryLiVp8 WHoTFinBrvN8VB7by6sVHY9fCZ7c5ZpBTKizeiyAq1X9uWz0XiX9TKzM2ByjxNftm4xr H4ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Bklc5LnpHbXXRZG1hQdUHVP8Fhs6SyMfJaYgRp3O//E=; b=NbBHEy+hVxcF5UssdycfFzj64rKLb/DOylOxDamWuK2xmi9XcdJ0np55XZxFU2KgH8 6lTZ+VGvsMno3tPrdJZJ3UgrvnWN+524xAusU4MBkub/lO1r4j8kHPVTszGlCj4PW0Ch 0vEqSLoNmM4AHO+Wrx+0ogO8hgcOA2c36lw3TjXQLLQfswI8sGIO7RcNxmtpUjsGWlqH RQpxKlHX26q9EC9mBV6IPFWRXND9njqnAL03ZtCnLbZTd11PtRvPykhXcvbj/MO53TAn X3gnJOHZ1yEeHNU/KiyD4qsMYuyTMarJL8AV89d1S/JbbZ0qnCu0aXeHkgdx5QG6+thb ev2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dsm+JAsu; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 28si9669916ejg.200.2021.09.20.21.10.54; Mon, 20 Sep 2021 21:11:17 -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=@gmail.com header.s=20210112 header.b=dsm+JAsu; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344581AbhIUC4E (ORCPT + 99 others); Mon, 20 Sep 2021 22:56:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351606AbhIUCkG (ORCPT ); Mon, 20 Sep 2021 22:40:06 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54663C08E9AC; Mon, 20 Sep 2021 19:16:29 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id u8so23935592lff.9; Mon, 20 Sep 2021 19:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Bklc5LnpHbXXRZG1hQdUHVP8Fhs6SyMfJaYgRp3O//E=; b=dsm+JAsusa9xNL32okfaioo2aQiS0BiadMNz2FsHDp4+QLFvhoqOtZD2YVdfKQa7JJ 7STYnQPwVTnDXCgGt+S/ckrydR/yId4oG8qMJ2JiRP2H1GTMMmYI0bxP0LtiW8zTzA63 6OIks84cyz5jmCMphJy9tqgSq2ooXxjs1GVEs+hSauO5dLdjFXJ71uvdXqZoeMdAtQSu C/ciiqyA1BFQmJnpmSnm9vmzYHldMU+aAG98k1K3rDVb14bnkQVkB9dSff2yw5Lk1Dj8 F1HyMHHa8w09chMVw9dReBuFUR+NsQtgYPV4mMMCsLI1bhJuZOOXfOfCIm2RprYtD5xu lmcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Bklc5LnpHbXXRZG1hQdUHVP8Fhs6SyMfJaYgRp3O//E=; b=IE999Vk1PVQtgayOLHgkKAljAbzRQqYQ/5O9gZYVJU5GWlszfkEm+pPeBYgJQzrqux hE0RybDy2/wLJ3E+4QjxmP/oKcx9aBG27borDBWminWbVl4LEIYC3Ch0Dl9ko1Je1qor lnCzMioBBwquLZw5ZrV4OLitMUURVZFL3h/6bKpl9YfyCPqYC1RKI6YPfA3VuBBXS5l+ cos0R9TODmmxIx9CoasYgBtxWKqMdvnCnC2j9v0HhMnErT1UQ60fOBDllO5oSTvsdW1c irvzhP785ktolgfXCsIpMeuEtb7jxa5C7RhBqM6ezk7ObI6+6rrCgEmg7yyKQtzKTCXy Tofg== X-Gm-Message-State: AOAM531knN+ZZIUTQtWNwfXu4T/RHLwDtUZQp/hK20hvJULCnKcA5Kzb azbNMbZmrdmP1+BrtcWMp2vv/oEl58meZsJASM323RTr X-Received: by 2002:ac2:44b6:: with SMTP id c22mr7348048lfm.601.1632190587579; Mon, 20 Sep 2021 19:16:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Steve French Date: Mon, 20 Sep 2021 21:16:16 -0500 Message-ID: Subject: Re: [GIT PULL] ksmbd server security fixes To: Linus Torvalds Cc: CIFS , LKML , Namjae Jeon Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 20, 2021 at 5:46 PM Linus Torvalds wrote: > > On Sun, Sep 19, 2021 at 7:22 AM Steve French wrote: > > > > 3 ksmbd fixes: including an important security fix for path > > processing, and a missing buffer overflow check, and a trivial fix for > > incorrect header inclusion > > > > There are three additional patches (and also a patch to improve > > symlink checks) for other buffer overflow cases that are being > > reviewed and tested. > > Note that if you are working on a path basis, you should really take a > look at our vfs lookup_flags, and LOOKUP_BENEATH in particular. This was also something that Ralph brought up, and Namjae is looking at now. > The way to deal with '..' and symlinks is not to try to figure it out > yourself. You'll get it wrong, partly because the races with rename > are quite interesting. The VFS layer knows how to limit pathname > lookup to the particular directory you started in these days. > > Of course, that is only true for the actual path lookup functions. > Once you start doing things manually one component at a time yourself, > you're on your own. Agreed. Also FYI I removed the "ksmbd: Use LOOKUP_NO_SYMLINKS" changeset from for-next (I left the first two buffer validation changesets in, since those have been reviewed), since Namjae is working on an updated version following your suggestion (and others' review feedback). -- Thanks, Steve