From owner-svn-src-all@freebsd.org Thu Mar 7 18:36:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BFED1510811; Thu, 7 Mar 2019 18:36:57 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f182.google.com (mail-it1-f182.google.com [209.85.166.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DB946C95E; Thu, 7 Mar 2019 18:36:56 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f182.google.com with SMTP id v2so16822195ith.3; Thu, 07 Mar 2019 10:36:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=UIQZ/q2Pl7hRAvWk+qP1TVxN4/48jCUARDD1aUkz9/I=; b=f9av+Y8si+/13dS8p5gwNUMgW8TojgeOFhzGCLazJGfw4gXqAtzE3oVo+o3Uq+HRri Ar9/1OrCvuXSbW1GR1VFXXN4IvQKSSUo+iYUZ1RN7NUQM1aKGC4uO85VTCP2MmGPJK0J VYDd63AP492IT0pZARnXVboJgI3cj/C3LqJoBjnNCzNEx3fPAZW/RxICwDFq44+Gydje qA/JuifiXFpOIaoyS520JBrDWUh56D8uXQAsemAhbAi4ngaOh9/AAINHwKjc2xX857ud UleEhLCt25OteNfNGwZFOnqDvcIPN0mvVsOYo6kFaLUo0OOQa3k7CMaTNMjZ6QWhHEGE ExXg== X-Gm-Message-State: APjAAAVqZWTcUYXb4AwbOq0xfJ0xR+p7tPrdDPPvq20WeuC1VjW7bgVc jw/dt7eut6IVoSn3BZxGfwZHwE3/ X-Google-Smtp-Source: APXvYqwFSalgsOZwGw9CVpVx9axdZ7Dw5PhA+EjIlkYgm2yWaTBOafQUKOWZDzdxZMoUAm4qho+Afw== X-Received: by 2002:a24:eb0e:: with SMTP id h14mr6097260itj.100.1551983810349; Thu, 07 Mar 2019 10:36:50 -0800 (PST) Received: from mail-it1-f180.google.com (mail-it1-f180.google.com. [209.85.166.180]) by smtp.gmail.com with ESMTPSA id 203sm2801534itv.6.2019.03.07.10.36.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 10:36:50 -0800 (PST) Received: by mail-it1-f180.google.com with SMTP id f186so4491521ita.0; Thu, 07 Mar 2019 10:36:50 -0800 (PST) X-Received: by 2002:a24:e4d:: with SMTP id 74mr5814119ite.32.1551983809937; Thu, 07 Mar 2019 10:36:49 -0800 (PST) MIME-Version: 1.0 References: <201903062256.x26Munf3054948@repo.freebsd.org> <20190307105959.GJ2492@kib.kiev.ua> In-Reply-To: <20190307105959.GJ2492@kib.kiev.ua> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 7 Mar 2019 10:36:39 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344857 - head/sys/fs/fuse To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 0DB946C95E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2019 18:36:57 -0000 Hi Konstantin, On Thu, Mar 7, 2019 at 3:00 AM Konstantin Belousov wrote: > > On Wed, Mar 06, 2019 at 10:56:49PM +0000, Conrad Meyer wrote: > > FUSE: Prevent trivial panic > > > > When open(2) was invoked against a FUSE filesystem with an unexpected flags > > value (no O_RDONLY / O_RDWR / O_WRONLY), an assertion fired, causing panic. > > Did you miss O_EXEC ? Nope. > O_RDONLY is defined as zero, and we interpret the > flags as having O_RDONLY if no other flags were passed. The commit message probably could have been more clear. The check that we actually perform (and guard against with this change) is ((flags & (FREAD | FWRITE)) == 0). FREAD is non-zero. Alan has empirically demonstrated that O_EXEC at the open(2) layer does not translate into a FREAD flag at the VOP_OPEN() layer. > VFS guarantees that one of the O_EXEC/FREAD/FWRITE flag is always > there. If it does not, it is bug. See the code at the start of > kern_openat(). Sure. FUSE is not prepared to handle (flags & (O_EXEC|FREAD|FWRITE)) == O_EXEC at this time. This revision just changes that (user-inducible) scenario into an error, instead of a panic. Like the commit message says, it is not intended to be the correct long-term solution. Best, Conrad