Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp517162imm; Thu, 26 Jul 2018 07:33:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe6BnOqWTF8/I+ng20+O2hyQpUByZIHGe1vWng84rbA2lhtaVHQgsGp7fusjBdrcYTzeT7P X-Received: by 2002:a63:e742:: with SMTP id j2-v6mr2258286pgk.114.1532615610121; Thu, 26 Jul 2018 07:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532615610; cv=none; d=google.com; s=arc-20160816; b=bVy8RF4jNN9kW6JomQ6xto3u7JaARt9oBKN5g5pjjKKDreB8HQP+9oqymUUqbfdceg kxNLz8rPMpgArCI9iqBTTVKdb+AgitZUm2I1qyINBsCPXK2f3esKD7fdWDXoGshu+IsV x9SnzuG1aTrRM6O7g8+M3icGfeZAxhJDXIttwHN9n8IufWf9IYk9+oMrQSO6sxxLur2e C21qiAh2u+PLTRL/3FwkV/WEeyPnSw8jAF2sgpY0jmbznXAgSbl1jDf/gKmLPsdFs1jc 6+NikJTIoX66Saa/OGZlvYJzICTLybx54jK0xuV1Ag2o/GI0bkAxuCwEqNqF1g4tvpVO QMqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=SU5eRuLVTml3ZKWH+0TslSZVgtRRGgTFIluQ+I54fXc=; b=eo4zLg3HzkM2Rg0r1wcbhWaquUOtDRthh9LewnfobKN5Tv/hkpk3qJufN6HXmKD/Qb pAXyu5fuPOXpaeeD+77uS9pYqa23jX4V6fP17hHr2J5XvuegVSy4CHn849LWA5TS6BLm AoGzoJhusI1BS56iwdZTpPU8Ul+fuuqIJZXe5sDjMWBgurfPGHFuVqkpp9bpGfTTDlXk VRZ4ifY26+g1vhSOkcj3K2/sjGrtOrx0GWxOj7KQHPIGtNZjsh/gsdnwUbaSQou8zhsr NxdO+v2dW4DkGt8ncTz5sHcbLSHKZT26F3+TobA5gBZbzAYEF2zBwda1PtvvtTJT9ttq x0Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oKTWNzmA; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h16-v6si1558370pgb.39.2018.07.26.07.33.12; Thu, 26 Jul 2018 07:33:30 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=oKTWNzmA; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730289AbeGZPt1 (ORCPT + 99 others); Thu, 26 Jul 2018 11:49:27 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:43583 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729506AbeGZPt1 (ORCPT ); Thu, 26 Jul 2018 11:49:27 -0400 Received: by mail-lj1-f194.google.com with SMTP id r13-v6so1698061ljg.10; Thu, 26 Jul 2018 07:32:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=SU5eRuLVTml3ZKWH+0TslSZVgtRRGgTFIluQ+I54fXc=; b=oKTWNzmApUSaZn53Hz3oYuIMGmNic15VpWGtGLIFTDQM+gbhDXK0yk36CWeqBPU5e/ FOvZurUlc5uMsC4fy8nDSw+jEZwDMsyDYancMisNHVnWgeSBLrZKviFqCSnjI0Y31A9X AlmHJDDTnZ5A14a18DWVN9+jTs49SVhZtwZ5OQxi1ucJ4MHLZ5VpbdxR2IugErGRDwVZ 6yCeyg6rBPV2h8lFesDcvs65GC9CKoiGX3ImLAXhz1inLkVMv8nf54hdkv1XjlN2nYKW e4/jcXr7vLJEksEoEf/bP1O6pTQVXjiNPDQWAeItKunFRzBuwgso/Ka4g4vsGHnj8CnL 4hOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=SU5eRuLVTml3ZKWH+0TslSZVgtRRGgTFIluQ+I54fXc=; b=b2Pd/TCerrdqUDN3otXwH3UTsMWfDtBJu4IFhoQFJPFeMTbw0hjik8+5FRWEMnhXXN BIF2234/7gH7NjDXxep6Bw5l8G0gtwGZhCV5eYj99//wFiRXo/WxnN2EgIaHxqCOdeVn BnO7CcRxNl8lhB9CyBCPjl68THFC2lAdlo8MFzYkhVH94BJtMSDfpSZZ/YwIcTv94JyZ M+V6Ybek/3PYlC1OU5N9JW4PqQ0di4wrwwN5sIlf0IFE5MS0Xqw8jSISBe43DpvHCpAQ 8BJfnXDcK+JTcQDuTxHRs/MVmKCdLvBvx1dEsckxTJnJJ5FwwhpZEtMF1cEJSbWmNIfU zdOw== X-Gm-Message-State: AOUpUlEy16LwUydSCJmcmAYX02x+T1gZY+6lSIXsoSpVPkXqelKEonyz 9Ld6LuSZtWAcRDwH8NoG7Gw= X-Received: by 2002:a2e:88d0:: with SMTP id a16-v6mr1855234ljk.63.1532615537088; Thu, 26 Jul 2018 07:32:17 -0700 (PDT) Received: from ?IPv6:2001:2012:22e:1b00:f2e2:9015:9262:3fde? ([2001:2012:22e:1b00:f2e2:9015:9262:3fde]) by smtp.gmail.com with ESMTPSA id o203-v6sm200428lff.28.2018.07.26.07.32.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 07:32:15 -0700 (PDT) Subject: Re: [PATCH] 9p: fix NULL pointer dereferences To: Dominique Martinet Cc: Dmitry Vyukov , David Miller , v9fs-developer@lists.sourceforge.net, netdev , LKML , syzkaller References: <20180726081049.10527-1-tomasbortoli@gmail.com> <20180726081727.GA6699@nautica> <20180726094849.GA18334@nautica> <20180726142109.GA4235@nautica> From: Tomas Bortoli Openpgp: preference=signencrypt Autocrypt: addr=tomasbortoli@gmail.com; prefer-encrypt=mutual; keydata= xsFNBFpCTZMBEADNZ1+Ibh0Z4pgGRcd1aOUMbe/YfHktmajjcoTnKmZZunjoUVAl8waeLITd BC2c8i1wHzHcnthrmb1izs5XlG6PZnl8n5tjysSNbwggzS1NcEK1qgn5VjNlHQ5aRMUwCC51 kicBiNmlQk2UuzzWwdheRGnaf+O1MNhC0GBeEDKQAL5obOU92pzflv6wWNACr+lHxdnpyies mOnRMjH16NjuTkrGbEmJe+MKp0qbjvR3R/dmFC1wczniRMQmV5w3MZ/N9wRappE+Atc1fOM+ wP7AWNuPvrKg4bN5uqKZLDFH7OFpxvjgVdWM40n0cQfqElWY9as+228Sltdd1XyHtUWRF2VW O1l5L0kX0+7+B5k/fpLhXqD3Z7DK7wRXpXmY59pofk7aFdcN97ZK+r6R7mqrwX4W9IpsPhkT kUyg3/Dx/khBZlJKFoUP325/hoH684bSiPEBroel9alB7gTq2ueoFwy6R3q5CMUw3D+CZWHA 3xllu46TRQ/Vt2g0cIHQNPoye2OWYFJ6kSEvaLpymjNDJ9ph2EuHegonDfOaYSq34ic2BcdB JkCgXRLP5K7KtRNJqqR+DM8xBye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i08Gq6mT6RkD6wV9HE5U3 EIU0rDPyJo54MW39wGjfC2+PM5I0xebbxtnuTewRchVVfm7UWgLAy11pV3xM4wMSJOuqVMOz jYpWKYxDTpvsZ0ginUUY993Gb8k/CxjABEMUGVHhQPZ0OzjHIKS6cTzN6ue8bB+CGOLCaQp1 C0NRT5Tn9zpLxtf5nBExFd/zVENY5vAV2ZbKQdemO54O7j6B9DSgVRrm83GCZxbL4d+qTYBF 3tSCWw/6SG1F3q9gR9QrSC2YRjCmhijUVEh6FhZwB58TNZ1sEEttrps8TDa5tUd9 Message-ID: Date: Thu, 26 Jul 2018 16:32:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180726142109.GA4235@nautica> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/26/2018 04:21 PM, Dominique Martinet wrote: > Tomas Bortoli wrote on Thu, Jul 26, 2018: >>> But I think trans=fd allows NULL addr today, no? >> >> How ? > > Just using the mount syscall with a NULL dev_name? I haven't checked > this syzcaller reproducer but it's probably what it does. > > p9_fd_create doesn't use 'addr' at all so it's safe to create a 9p mount > for trans=fd with no device name, as Dmitry pointed out > mmh, ok. > >>> On the other hand, virtio, rdma and xen all have the same problem, so >>> Thomas, please fix them instead :) >> >> So just by patching v9fs_mount ? > > If we want to preserve the current behaviour for trans=fd (and I don't > see why not) we just have to patch all the transports that use the > device, that is all .create functions but p9_fd_create() > > Basically exactly what you did, just for a few more functions - I > apparently was a little bit too optimistic thinking we could share > this check. > Does v9fs_mount() knows the transport ahead? Because in that case it'd be possible to check if addr!=NULL && trans!=fd then return error Otherwise, patching all the .create, ok.