From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Salyzyn via Linux-f2fs-devel Subject: Re: [PATCH v15 1/4] Add flags option to get xattr method paired to __vfs_getxattr Date: Tue, 5 Nov 2019 07:37:04 -0800 Message-ID: <1de43656-e751-53a2-c0da-ff44ecbabbc4@android.com> References: <20191104215253.141818-1-salyzyn@android.com> <20191104215253.141818-2-salyzyn@android.com> <20191105094830.GL22379@quack2.suse.cz> Reply-To: Mark Salyzyn Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20191105094830.GL22379@quack2.suse.cz> Content-Language: en-GB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: Jan Kara Cc: Latchesar Ionkov , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, linux-doc@vger.kernel.org, linux-integrity@vger.kernel.org, Greg Kroah-Hartman , Martin Brandenburg , samba-technical@lists.samba.org, Dominique Martinet , Artem Bityutskiy , Adrian Hunter , David Howells , Chris Mason , "David S. Miller" , Andreas Dilger , Eric Paris , Mauro Carvalho Chehab , netdev@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-afs@lists.infradead.org, Mike Marshall , linux-xfs@vger.kernel.org, linux-unionfs@vger.kernel.org, Andreas Gruenbacher List-Id: ceph-devel.vger.kernel.org On 11/5/19 1:48 AM, Jan Kara wrote: >> @@ -228,11 +228,11 @@ static int afs_xattr_get_yfs(const struct xattr_handler *handler, >> break; >> case 1: >> data = buf; >> - dsize = snprintf(buf, sizeof(buf), "%u", yacl->inherit_flag); >> + dsize = scnprintf(buf, sizeof(buf), "%u", yacl->inherit_flag); >> break; >> case 2: >> data = buf; >> - dsize = snprintf(buf, sizeof(buf), "%u", yacl->num_cleaned); >> + dsize = scnprintf(buf, sizeof(buf), "%u", yacl->num_cleaned); >> break; >> case 3: > These scnprintf() changes (and there are more in the patch) probably > shouldn't be here... Otherwise the patch still looks good to me :). > > Honza > Good catch, they were done in locality, I forgot about them, this patch series has been living for almost a year now and time has become its enemy ... will spin this as a separate patch. They strike as a security issue with the possibility of fragile UAF when the code is maintained by future selves. -- Mark From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Salyzyn Date: Tue, 5 Nov 2019 07:37:04 -0800 Subject: [Cluster-devel] [PATCH v15 1/4] Add flags option to get xattr method paired to __vfs_getxattr In-Reply-To: <20191105094830.GL22379@quack2.suse.cz> References: <20191104215253.141818-1-salyzyn@android.com> <20191104215253.141818-2-salyzyn@android.com> <20191105094830.GL22379@quack2.suse.cz> Message-ID: <1de43656-e751-53a2-c0da-ff44ecbabbc4@android.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 11/5/19 1:48 AM, Jan Kara wrote: >> @@ -228,11 +228,11 @@ static int afs_xattr_get_yfs(const struct xattr_handler *handler, >> break; >> case 1: >> data = buf; >> - dsize = snprintf(buf, sizeof(buf), "%u", yacl->inherit_flag); >> + dsize = scnprintf(buf, sizeof(buf), "%u", yacl->inherit_flag); >> break; >> case 2: >> data = buf; >> - dsize = snprintf(buf, sizeof(buf), "%u", yacl->num_cleaned); >> + dsize = scnprintf(buf, sizeof(buf), "%u", yacl->num_cleaned); >> break; >> case 3: > These scnprintf() changes (and there are more in the patch) probably > shouldn't be here... Otherwise the patch still looks good to me :). > > Honza > Good catch, they were done in locality, I forgot about them, this patch series has been living for almost a year now and time has become its enemy ... will spin this as a separate patch. They strike as a security issue with the possibility of fragile UAF when the code is maintained by future selves. -- Mark From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AF8BC5DF60 for ; Tue, 5 Nov 2019 15:47:08 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 097B521882 for ; Tue, 5 Nov 2019 15:47:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.ozlabs.org header.i=@lists.ozlabs.org header.b="B86xxeK0"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=android.com header.i=@android.com header.b="R8lPpHZa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 097B521882 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=lists.ozlabs.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 476vDV0wD9zF581 for ; Wed, 6 Nov 2019 02:47:06 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.ozlabs.org; s=201707; t=1572968826; bh=nTlZ4bvuiZC3UZLmcNtt6grhl9XFvxhvTEusTR40j08=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=B86xxeK0vPfCjS9M217f8+gNSXaksoNazlxlK6/EKoHaQqfuqWcGCM63YK986jF2e Up6lysK8KhMpw8xTbEXhUQf2jPfbD7HSq4I300zqOPNV1U2h0Zo8dDNZRzRCD76eVB HsesNu8D2AIdInPZdIbKS9z5mR1tGdC5oD8Oaa3hvRDH8AesMLuAaLU0+givoSdzxk 15EK//fAkv6ItQ7SWCOVcM3osFkGEmDT2dXWBaa0iOsoca/bBsPm5Y91l9v+YC95Y2 NJT/y97QU4gn2SQ1hM27ED/kJA3yWQJ9fs+NH7Z1V+20TSOpOTSrLzK8/0yY6gqAAG rJO8/OtXMh7eg== Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=android.com (client-ip=2607:f8b0:4864:20::542; helo=mail-pg1-x542.google.com; envelope-from=salyzyn@android.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=reject dis=none) header.from=android.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=android.com header.i=@android.com header.b="R8lPpHZa"; dkim-atps=neutral Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 476v144BlSzF53t for ; Wed, 6 Nov 2019 02:37:11 +1100 (AEDT) Received: by mail-pg1-x542.google.com with SMTP id 29so3161023pgm.6 for ; Tue, 05 Nov 2019 07:37:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=2/8/BwrhtmEXI7dj68SMTpCzdsjoLETsRSfZ5j8yePw=; b=R8lPpHZaNTKC1//4X3YRy/co01wfSuPnFkkkoDrdRRcs8xZqXtNYPLgm9OjzsXnJfg w/sgCdd9n+99HdKAd13HjrpckBRQK4F+I41/fuJw7ICMDJgQ0tKfn8kAw++u9jIK9Pl7 wc3lGWI+tLAg5Fo7mlf+u1oz4ZCnt5dRpAwNiKM1EwVqGR4FwH3zMLPET/FX6DvXl/Cq XMn8MNwm1G21DoBMHo9twX6ox9SH+JhzmjDChdy5f2tzhmNnEaRv4FiGKkmYlD/OTP+l 39M21mPDgGHAV1JVejM/uCulS4TGW/MwgQAeZfS0L3/q73lP5U74GqdSjn6t5WS3czii QV3g== 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:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=2/8/BwrhtmEXI7dj68SMTpCzdsjoLETsRSfZ5j8yePw=; b=OO5XD1ffjdC1HaaEk5tbhiwTQLb/d9MsdETP2SHvXY3nCMeDj87+o5swiOKltoyaGw QW89+0KYSfO5bQB6iOV2Xjm2s1OUagX5IhcU7yCvCKTkIe70aB1P4hVzJ9RmODMtkMxO I/YoCHKFEirKure5e8LpJ5X6ZR61bVL7uGvVoHj7B1aGHV6I4wb0R6r6u/uWVir+ygTk qxbw9KxLQbLO0JI7It9CzKFqOPdABBJzVplmSIbMwW70wdKW7Il1xHDzESlsnJ7M08qy mfb1euA2Rqmfy9LPcuEPeGKMFbrQ/xzIVypq8CqmJ2iPCH5+rTJ9tlkJRYNa59DRNgUZ g8kg== X-Gm-Message-State: APjAAAXZSyQ2ZU0q07YMoGAKDwQTHH9dN70jwnG5xilXBY/mXnL0h1gP Xr27W5IWS0HztCWUPjBfc6Euew== X-Google-Smtp-Source: APXvYqy6Q+jW7Nx8yhUJvITL/ENlgb+bvGP0zh9whSnmepYB/pthS+WgqdQwDBfJOEs5VO1iezn2Pw== X-Received: by 2002:a62:e519:: with SMTP id n25mr38428065pff.144.1572968227784; Tue, 05 Nov 2019 07:37:07 -0800 (PST) Received: from nebulus.mtv.corp.google.com ([2620:15c:211:200:5404:91ba:59dc:9400]) by smtp.googlemail.com with ESMTPSA id m13sm18037460pga.70.2019.11.05.07.37.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Nov 2019 07:37:07 -0800 (PST) Subject: Re: [PATCH v15 1/4] Add flags option to get xattr method paired to __vfs_getxattr To: Jan Kara References: <20191104215253.141818-1-salyzyn@android.com> <20191104215253.141818-2-salyzyn@android.com> <20191105094830.GL22379@quack2.suse.cz> Message-ID: <1de43656-e751-53a2-c0da-ff44ecbabbc4@android.com> Date: Tue, 5 Nov 2019 07:37:04 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191105094830.GL22379@quack2.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mark Salyzyn via Linux-erofs Reply-To: Mark Salyzyn Cc: Latchesar Ionkov , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, linux-doc@vger.kernel.org, linux-integrity@vger.kernel.org, Greg Kroah-Hartman , Martin Brandenburg , samba-technical@lists.samba.org, Dominique Martinet , Artem Bityutskiy , Adrian Hunter , David Howells , Chris Mason , "David S. Miller" , Andreas Dilger , Eric Paris , Mauro Carvalho Chehab , netdev@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-afs@lists.infradead.org, Mike Marshall , linux-xfs@vger.kernel.org, linux-unionfs@vger.kernel.org, Andreas Gruenbacher , Sage Weil , "Darrick J . Wong" , Richard Weinberger , Mark Fasheh , Eric Biggers , Hugh Dickins , James Morris , Trond Myklebust , cluster-devel@redhat.com, selinux@vger.kernel.org, Benjamin Coddington , Casey Schaufler , v9fs-developer@lists.sourceforge.net, Ilya Dryomov , linux-ext4@vger.kernel.org, Stephen Smalley , linux-mm@kvack.org, Mark Salyzyn , Serge Hallyn , ecryptfs@vger.kernel.org, linux-cifs@vger.kernel.org, Eric Van Hensbergen , linux-erofs@lists.ozlabs.org, Josef Bacik , reiserfs-devel@vger.kernel.org, Miklos Szeredi , Joel Becker , linux-mtd@lists.infradead.org, Phillip Lougher , David Sterba , Jaegeuk Kim , ceph-devel@vger.kernel.org, devel@lists.orangefs.org, Gao Xiang , Mimi Zohar , Paul Moore , linux-nfs@vger.kernel.org, Theodore Ts'o , linux-fsdevel@vger.kernel.org, Joseph Qi , Mathieu Malaterre , kernel-team@android.com, Jonathan Corbet , Jeff Layton , linux-kernel@vger.kernel.org, Tyler Hicks , Steve French , linux-security-module@vger.kernel.org, ocfs2-devel@oss.oracle.com, Jan Kara , Bob Peterson , Tejun Heo , Andrew Morton , David Woodhouse , Anna Schumaker , linux-btrfs@vger.kernel.org, Alexander Viro Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On 11/5/19 1:48 AM, Jan Kara wrote: >> @@ -228,11 +228,11 @@ static int afs_xattr_get_yfs(const struct xattr_handler *handler, >> break; >> case 1: >> data = buf; >> - dsize = snprintf(buf, sizeof(buf), "%u", yacl->inherit_flag); >> + dsize = scnprintf(buf, sizeof(buf), "%u", yacl->inherit_flag); >> break; >> case 2: >> data = buf; >> - dsize = snprintf(buf, sizeof(buf), "%u", yacl->num_cleaned); >> + dsize = scnprintf(buf, sizeof(buf), "%u", yacl->num_cleaned); >> break; >> case 3: > These scnprintf() changes (and there are more in the patch) probably > shouldn't be here... Otherwise the patch still looks good to me :). > > Honza > Good catch, they were done in locality, I forgot about them, this patch series has been living for almost a year now and time has become its enemy ... will spin this as a separate patch. They strike as a security issue with the possibility of fragile UAF when the code is maintained by future selves. -- Mark From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C473C5DF62 for ; Tue, 5 Nov 2019 15:37:20 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F1DDE2087E for ; Tue, 5 Nov 2019 15:37:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.sourceforge.net header.i=@lists.sourceforge.net header.b="Tq7lLivi"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="AFXGvqGM"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="AMZVbpor"; dkim=neutral (0-bit key) header.d=android.com header.i=@android.com header.b="R8lPpHZa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F1DDE2087E Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=lists.sourceforge.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Type:Content-Transfer-Encoding:Cc: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:In-Reply-To:MIME-Version:Date:Message-ID: References:To:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=r2eE38FGpCOgBEuWocFCXrf19QHBihOvJgkOlA+aavw=; b=Tq7lLivit8ZFmYBWu5ijl4GlMH tLY8YnYUwgvmTKE5Ts9Cz/hNvOT0ILr/FdpHAxwKczyhVSIaiJepBCoIfGt+q45xxMvM7qhnkgz8h pmpRZ08kvsZOrSi1zg0bc7C+6WuohJ5OL+FW463a9R343RyRIEZ/3PelAmjkmiAYnzyU=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1iS0tT-0004Wm-H0; Tue, 05 Nov 2019 15:37:19 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iS0tS-0004Wa-30 for linux-f2fs-devel@lists.sourceforge.net; Tue, 05 Nov 2019 15:37:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2/8/BwrhtmEXI7dj68SMTpCzdsjoLETsRSfZ5j8yePw=; b=AFXGvqGMbX+60v6PtR/E8Q1kQl SGrkYXIc35qJIgDT/JdbmeHnB8QBZWddUhq61LNa3O7HL9NAMzndmKrMLC1JJNndh4aMrbHKPFYEj rhQ7Tf6lXZFZj5nZ5APZqJ6rMFg6QuSXxU6zkzfe1FWvXtvj7ygxrSOx8AEeaizy1RIw=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=2/8/BwrhtmEXI7dj68SMTpCzdsjoLETsRSfZ5j8yePw=; b=AMZVbporIAuKi6zkr59FI01o6+ I/pYqHWgLzcChKcX4E8f1zwl8IFC0CSMlMwsDwxou68QyYGQgG67hT2Gznsbmiu7DLNVzQTm1uKJD FeC9LPuwkQrqrq3WwkxRgiFeiRx12eaZ+bDfCVwcBBZA4pL3ZWNnzASyN9CF8k9OMLuo=; Received: from mail-pf1-f195.google.com ([209.85.210.195]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1iS0tN-000z3x-L4 for linux-f2fs-devel@lists.sourceforge.net; Tue, 05 Nov 2019 15:37:18 +0000 Received: by mail-pf1-f195.google.com with SMTP id 193so14440805pfc.13 for ; Tue, 05 Nov 2019 07:37:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=2/8/BwrhtmEXI7dj68SMTpCzdsjoLETsRSfZ5j8yePw=; b=R8lPpHZaNTKC1//4X3YRy/co01wfSuPnFkkkoDrdRRcs8xZqXtNYPLgm9OjzsXnJfg w/sgCdd9n+99HdKAd13HjrpckBRQK4F+I41/fuJw7ICMDJgQ0tKfn8kAw++u9jIK9Pl7 wc3lGWI+tLAg5Fo7mlf+u1oz4ZCnt5dRpAwNiKM1EwVqGR4FwH3zMLPET/FX6DvXl/Cq XMn8MNwm1G21DoBMHo9twX6ox9SH+JhzmjDChdy5f2tzhmNnEaRv4FiGKkmYlD/OTP+l 39M21mPDgGHAV1JVejM/uCulS4TGW/MwgQAeZfS0L3/q73lP5U74GqdSjn6t5WS3czii QV3g== 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:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=2/8/BwrhtmEXI7dj68SMTpCzdsjoLETsRSfZ5j8yePw=; b=hKmco9yAxVffhPgv0DJ86TR7YAZFIvrUKq2mGcBBhtkpCGtuUMebrfn9MQI3x+PqNJ 5jjPR3BiBEG1TsYvqGiXJbSZo2gL/uT+ttjiosCILHiJD7Z/MK/htfmsgeVuQwAwTEsz pvf/uEYGyCgjVMrLTtyZuI65cvoT2eS8k0ZotH7wIQZmSlNIF6z105k1+nPqGRRi46i2 nWHNhgMYSWHZ9vRRo5fg00V4zuXPgXbuKg/Fuo8dIThRElzOQ8efFmx6sN95RzedqTwX xfwmaoHRsyLFHn2orF63TNfLq2PJ3OaEuHhUnjFz35ODIbu3QSL7BzGtRjeNXc9U6BvE 6tuQ== X-Gm-Message-State: APjAAAWoTjKBqaNV7u2WdRJddmEMxMKamhuMsgX8w2t0hj1lynxc5kqJ FydVbD1sgO+VcwAubtT3C5rZfg== X-Google-Smtp-Source: APXvYqy6Q+jW7Nx8yhUJvITL/ENlgb+bvGP0zh9whSnmepYB/pthS+WgqdQwDBfJOEs5VO1iezn2Pw== X-Received: by 2002:a62:e519:: with SMTP id n25mr38428065pff.144.1572968227784; Tue, 05 Nov 2019 07:37:07 -0800 (PST) Received: from nebulus.mtv.corp.google.com ([2620:15c:211:200:5404:91ba:59dc:9400]) by smtp.googlemail.com with ESMTPSA id m13sm18037460pga.70.2019.11.05.07.37.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Nov 2019 07:37:07 -0800 (PST) To: Jan Kara References: <20191104215253.141818-1-salyzyn@android.com> <20191104215253.141818-2-salyzyn@android.com> <20191105094830.GL22379@quack2.suse.cz> Message-ID: <1de43656-e751-53a2-c0da-ff44ecbabbc4@android.com> Date: Tue, 5 Nov 2019 07:37:04 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191105094830.GL22379@quack2.suse.cz> Content-Language: en-GB X-Headers-End: 1iS0tN-000z3x-L4 Subject: Re: [f2fs-dev] [PATCH v15 1/4] Add flags option to get xattr method paired to __vfs_getxattr X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mark Salyzyn via Linux-f2fs-devel Reply-To: Mark Salyzyn Cc: Latchesar Ionkov , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, linux-doc@vger.kernel.org, linux-integrity@vger.kernel.org, Greg Kroah-Hartman , Martin Brandenburg , samba-technical@lists.samba.org, Dominique Martinet , Artem Bityutskiy , Adrian Hunter , David Howells , Chris Mason , "David S. Miller" , Andreas Dilger , Eric Paris , Mauro Carvalho Chehab , netdev@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-afs@lists.infradead.org, Mike Marshall , linux-xfs@vger.kernel.org, linux-unionfs@vger.kernel.org, Andreas Gruenbacher , Sage Weil , "Darrick J . Wong" , Richard Weinberger , Mark Fasheh , Eric Biggers , Hugh Dickins , James Morris , Trond Myklebust , cluster-devel@redhat.com, selinux@vger.kernel.org, Benjamin Coddington , Casey Schaufler , v9fs-developer@lists.sourceforge.net, Ilya Dryomov , linux-ext4@vger.kernel.org, Stephen Smalley , linux-mm@kvack.org, Mark Salyzyn , Serge Hallyn , ecryptfs@vger.kernel.org, linux-cifs@vger.kernel.org, Eric Van Hensbergen , linux-erofs@lists.ozlabs.org, Josef Bacik , reiserfs-devel@vger.kernel.org, Miklos Szeredi , Joel Becker , linux-mtd@lists.infradead.org, Phillip Lougher , David Sterba , Jaegeuk Kim , ceph-devel@vger.kernel.org, devel@lists.orangefs.org, Gao Xiang , Mimi Zohar , Paul Moore , linux-nfs@vger.kernel.org, Theodore Ts'o , linux-fsdevel@vger.kernel.org, Joseph Qi , Mathieu Malaterre , kernel-team@android.com, Jonathan Corbet , Jeff Layton , linux-kernel@vger.kernel.org, Tyler Hicks , Steve French , linux-security-module@vger.kernel.org, ocfs2-devel@oss.oracle.com, Jan Kara , Bob Peterson , Tejun Heo , Andrew Morton , David Woodhouse , Anna Schumaker , linux-btrfs@vger.kernel.org, Alexander Viro Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 11/5/19 1:48 AM, Jan Kara wrote: >> @@ -228,11 +228,11 @@ static int afs_xattr_get_yfs(const struct xattr_handler *handler, >> break; >> case 1: >> data = buf; >> - dsize = snprintf(buf, sizeof(buf), "%u", yacl->inherit_flag); >> + dsize = scnprintf(buf, sizeof(buf), "%u", yacl->inherit_flag); >> break; >> case 2: >> data = buf; >> - dsize = snprintf(buf, sizeof(buf), "%u", yacl->num_cleaned); >> + dsize = scnprintf(buf, sizeof(buf), "%u", yacl->num_cleaned); >> break; >> case 3: > These scnprintf() changes (and there are more in the patch) probably > shouldn't be here... Otherwise the patch still looks good to me :). > > Honza > Good catch, they were done in locality, I forgot about them, this patch series has been living for almost a year now and time has become its enemy ... will spin this as a separate patch. They strike as a security issue with the possibility of fragile UAF when the code is maintained by future selves. -- Mark _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5789C5DF60 for ; Tue, 5 Nov 2019 15:37:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B82382087E for ; Tue, 5 Nov 2019 15:37:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="h+hrz2J8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=android.com header.i=@android.com header.b="R8lPpHZa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B82382087E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=android.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XdbXUShe0aSGlrAreyhgXxrDjz5MmijTbTuRbmB4Iuc=; b=h+hrz2J88GoDtLZufKmstz9qC whOLR0EUdvFQPowlN8fybgyJrM7ZiwriMwLkpxHmqjHFX/33gaSPscojhSqNbKFJ8AD7xrI9W5Dia T/tJr5KxPhdJUzZUfHMUNHYnDNJd1nDIVvKNuBmD3RQC3GhQj/FZ4i6EtJXa3UrpAMy4s+peAtFlJ Zzu8uefZ/XsMqjx3sW/79Q2WHpuYhDwaszSVSiqpDoSyU/YXTtqodS/+JFXfqhsD299gqW89jyfzL g5sNS7yfZc1tUDNhvy6WU7JaepRy33q6QtpZeK9nnrX/+c+Hl7/8F5HB+ii1HytY41JINIbsGAvMU ZpfIfWHeA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iS0tL-0007ib-Vl; Tue, 05 Nov 2019 15:37:11 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iS0tJ-0007hi-9y for linux-mtd@lists.infradead.org; Tue, 05 Nov 2019 15:37:10 +0000 Received: by mail-pf1-x441.google.com with SMTP id r4so15735501pfl.7 for ; Tue, 05 Nov 2019 07:37:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=2/8/BwrhtmEXI7dj68SMTpCzdsjoLETsRSfZ5j8yePw=; b=R8lPpHZaNTKC1//4X3YRy/co01wfSuPnFkkkoDrdRRcs8xZqXtNYPLgm9OjzsXnJfg w/sgCdd9n+99HdKAd13HjrpckBRQK4F+I41/fuJw7ICMDJgQ0tKfn8kAw++u9jIK9Pl7 wc3lGWI+tLAg5Fo7mlf+u1oz4ZCnt5dRpAwNiKM1EwVqGR4FwH3zMLPET/FX6DvXl/Cq XMn8MNwm1G21DoBMHo9twX6ox9SH+JhzmjDChdy5f2tzhmNnEaRv4FiGKkmYlD/OTP+l 39M21mPDgGHAV1JVejM/uCulS4TGW/MwgQAeZfS0L3/q73lP5U74GqdSjn6t5WS3czii QV3g== 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:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=2/8/BwrhtmEXI7dj68SMTpCzdsjoLETsRSfZ5j8yePw=; b=fsOKcMTO8QKgrSR0pCeglJmXkpiKYIEvyhSsutaKicO8y4EDaE0vKQ48t5EVjZc7FL IGk7chUyTgNzbQUqEpy2LKQamHEQETRaAhA1j08smGvSnhiq2hrhdlrAHOC0ePo9qzZa 3cVSEsa0xGyhdVAmaDTnfPakRoPK/rAu5cZTe6MirHUuzah4Lf/Uo5lQJ7d4eZY3oGfg NLVJHz3zzsdMWGHmAU+EY31vbbFYkDYDORfcMX2Wu+CC4341WuVAj5RVGp7mN7sqdTwl a3m5lgpDKNADP8S3sq5iQuORTkzFHeSc2cebHDW80ayd1PgmaXAScYtcgofAIMLO28n0 mbbA== X-Gm-Message-State: APjAAAV/eZdS4p+Wv985Qgm7YCmuzvuR5ZcCTEHqGNBYGvOefzW/KGup xJDn2YG/uuSOVw/Vk+ULcVWTtw== X-Google-Smtp-Source: APXvYqy6Q+jW7Nx8yhUJvITL/ENlgb+bvGP0zh9whSnmepYB/pthS+WgqdQwDBfJOEs5VO1iezn2Pw== X-Received: by 2002:a62:e519:: with SMTP id n25mr38428065pff.144.1572968227784; Tue, 05 Nov 2019 07:37:07 -0800 (PST) Received: from nebulus.mtv.corp.google.com ([2620:15c:211:200:5404:91ba:59dc:9400]) by smtp.googlemail.com with ESMTPSA id m13sm18037460pga.70.2019.11.05.07.37.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Nov 2019 07:37:07 -0800 (PST) Subject: Re: [PATCH v15 1/4] Add flags option to get xattr method paired to __vfs_getxattr To: Jan Kara References: <20191104215253.141818-1-salyzyn@android.com> <20191104215253.141818-2-salyzyn@android.com> <20191105094830.GL22379@quack2.suse.cz> From: Mark Salyzyn Message-ID: <1de43656-e751-53a2-c0da-ff44ecbabbc4@android.com> Date: Tue, 5 Nov 2019 07:37:04 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191105094830.GL22379@quack2.suse.cz> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191105_073709_344974_23E49A5D X-CRM114-Status: GOOD ( 14.81 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Latchesar Ionkov , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, linux-doc@vger.kernel.org, linux-integrity@vger.kernel.org, Greg Kroah-Hartman , Martin Brandenburg , samba-technical@lists.samba.org, Dominique Martinet , Artem Bityutskiy , Adrian Hunter , David Howells , Chris Mason , "David S. Miller" , Andreas Dilger , Eric Paris , Mauro Carvalho Chehab , netdev@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-afs@lists.infradead.org, Mike Marshall , linux-xfs@vger.kernel.org, linux-unionfs@vger.kernel.org, Andreas Gruenbacher , Sage Weil , "Darrick J . Wong" , Richard Weinberger , Mark Fasheh , Eric Biggers , Hugh Dickins , James Morris , Trond Myklebust , cluster-devel@redhat.com, selinux@vger.kernel.org, Benjamin Coddington , Casey Schaufler , v9fs-developer@lists.sourceforge.net, Ilya Dryomov , linux-ext4@vger.kernel.org, Stephen Smalley , linux-mm@kvack.org, Mark Salyzyn , Serge Hallyn , ecryptfs@vger.kernel.org, linux-cifs@vger.kernel.org, Eric Van Hensbergen , Chao Yu , linux-erofs@lists.ozlabs.org, Josef Bacik , reiserfs-devel@vger.kernel.org, Miklos Szeredi , Joel Becker , linux-mtd@lists.infradead.org, Phillip Lougher , David Sterba , Jaegeuk Kim , ceph-devel@vger.kernel.org, devel@lists.orangefs.org, Gao Xiang , Mimi Zohar , Paul Moore , linux-nfs@vger.kernel.org, Theodore Ts'o , linux-fsdevel@vger.kernel.org, Joseph Qi , Mathieu Malaterre , kernel-team@android.com, Jonathan Corbet , Jeff Layton , linux-kernel@vger.kernel.org, Tyler Hicks , Steve French , linux-security-module@vger.kernel.org, ocfs2-devel@oss.oracle.com, Jan Kara , Bob Peterson , Tejun Heo , Andrew Morton , David Woodhouse , Anna Schumaker , linux-btrfs@vger.kernel.org, Alexander Viro Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On 11/5/19 1:48 AM, Jan Kara wrote: >> @@ -228,11 +228,11 @@ static int afs_xattr_get_yfs(const struct xattr_handler *handler, >> break; >> case 1: >> data = buf; >> - dsize = snprintf(buf, sizeof(buf), "%u", yacl->inherit_flag); >> + dsize = scnprintf(buf, sizeof(buf), "%u", yacl->inherit_flag); >> break; >> case 2: >> data = buf; >> - dsize = snprintf(buf, sizeof(buf), "%u", yacl->num_cleaned); >> + dsize = scnprintf(buf, sizeof(buf), "%u", yacl->num_cleaned); >> break; >> case 3: > These scnprintf() changes (and there are more in the patch) probably > shouldn't be here... Otherwise the patch still looks good to me :). > > Honza > Good catch, they were done in locality, I forgot about them, this patch series has been living for almost a year now and time has become its enemy ... will spin this as a separate patch. They strike as a security issue with the possibility of fragile UAF when the code is maintained by future selves. -- Mark ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB229C5DF60 for ; Tue, 5 Nov 2019 15:37:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8E9FB2087E for ; Tue, 5 Nov 2019 15:37:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=android.com header.i=@android.com header.b="R8lPpHZa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E9FB2087E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=android.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3AEF16B0003; Tue, 5 Nov 2019 10:37:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 35F9F6B0008; Tue, 5 Nov 2019 10:37:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 275916B000A; Tue, 5 Nov 2019 10:37:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0187.hostedemail.com [216.40.44.187]) by kanga.kvack.org (Postfix) with ESMTP id 125146B0003 for ; Tue, 5 Nov 2019 10:37:10 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id C25152490 for ; Tue, 5 Nov 2019 15:37:09 +0000 (UTC) X-FDA: 76122627378.30.hour28_2159944ed6225 X-HE-Tag: hour28_2159944ed6225 X-Filterd-Recvd-Size: 7121 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 Nov 2019 15:37:09 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id l3so14470891pgr.8 for ; Tue, 05 Nov 2019 07:37:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=2/8/BwrhtmEXI7dj68SMTpCzdsjoLETsRSfZ5j8yePw=; b=R8lPpHZaNTKC1//4X3YRy/co01wfSuPnFkkkoDrdRRcs8xZqXtNYPLgm9OjzsXnJfg w/sgCdd9n+99HdKAd13HjrpckBRQK4F+I41/fuJw7ICMDJgQ0tKfn8kAw++u9jIK9Pl7 wc3lGWI+tLAg5Fo7mlf+u1oz4ZCnt5dRpAwNiKM1EwVqGR4FwH3zMLPET/FX6DvXl/Cq XMn8MNwm1G21DoBMHo9twX6ox9SH+JhzmjDChdy5f2tzhmNnEaRv4FiGKkmYlD/OTP+l 39M21mPDgGHAV1JVejM/uCulS4TGW/MwgQAeZfS0L3/q73lP5U74GqdSjn6t5WS3czii QV3g== 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:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=2/8/BwrhtmEXI7dj68SMTpCzdsjoLETsRSfZ5j8yePw=; b=fTanKcrUY5X40uI4lpWQYv5MojZnjyzVxuQCYTzprkJ+gads8fZAyIPujK69sxP7rf skBmo6MtrP1QTCp9bavwIpM/WTvofzu85TUz+1XatqqrI/GLmdMQNehNoQsObT+M/xCo Jf82K231b8RFGsKV6IhRr2hMxXa8STYXDv94cLHBQ4x6HIT0iIGTym0BWmiQs7PVRrLA XUnkwPO9ZUBG67VDjWH5Fq++Bkxj4touDO8mdIIEXT87Ykxvr29kzqj0KcI+iSkGz4Vf U4XRKLtbQALxJJoucJ/bHlRtNroyEdFiOlsg7KUQzjfb9hpJ3gqm0leobMx8CS5tXeW1 7/3A== X-Gm-Message-State: APjAAAVoYIgK8SmEZqUjGVPa1Bz1b6QYvjI8evOe7GjUwIvsboVvVM01 BsbzejFtLPDGI8t3AO8BDKrfnw== X-Google-Smtp-Source: APXvYqy6Q+jW7Nx8yhUJvITL/ENlgb+bvGP0zh9whSnmepYB/pthS+WgqdQwDBfJOEs5VO1iezn2Pw== X-Received: by 2002:a62:e519:: with SMTP id n25mr38428065pff.144.1572968227784; Tue, 05 Nov 2019 07:37:07 -0800 (PST) Received: from nebulus.mtv.corp.google.com ([2620:15c:211:200:5404:91ba:59dc:9400]) by smtp.googlemail.com with ESMTPSA id m13sm18037460pga.70.2019.11.05.07.37.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Nov 2019 07:37:07 -0800 (PST) Subject: Re: [PATCH v15 1/4] Add flags option to get xattr method paired to __vfs_getxattr To: Jan Kara Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, Mark Salyzyn , Jeff Layton , David Sterba , "Darrick J . Wong" , Mike Marshall , Stephen Smalley , linux-security-module@vger.kernel.org, Jonathan Corbet , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , David Howells , Chris Mason , Josef Bacik , Sage Weil , Ilya Dryomov , Steve French , Tyler Hicks , Gao Xiang , Chao Yu , Jan Kara , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , Miklos Szeredi , Bob Peterson , Andreas Gruenbacher , David Woodhouse , Richard Weinberger , Dave Kleikamp , Greg Kroah-Hartman , Tejun Heo , Trond Myklebust , Anna Schumaker , Mark Fasheh , Joel Becker , Joseph Qi , Martin Brandenburg , Alexander Viro , Phillip Lougher , Artem Bityutskiy , Adrian Hunter , linux-xfs@vger.kernel.org, Hugh Dickins , "David S. Miller" , Serge Hallyn , James Morris , Mimi Zohar , Paul Moore , Eric Paris , Casey Schaufler , Benjamin Coddington , Mauro Carvalho Chehab , Eric Biggers , Andrew Morton , Mathieu Malaterre , linux-doc@vger.kernel.org, v9fs-developer@lists.sourceforge.net, linux-afs@lists.infradead.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, ecryptfs@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, cluster-devel@redhat.com, linux-mtd@lists.infradead.org, jfs-discussion@lists.sourceforge.net, linux-nfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, devel@lists.orangefs.org, linux-unionfs@vger.kernel.org, reiserfs-devel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-integrity@vger.kernel.org, selinux@vger.kernel.org References: <20191104215253.141818-1-salyzyn@android.com> <20191104215253.141818-2-salyzyn@android.com> <20191105094830.GL22379@quack2.suse.cz> From: Mark Salyzyn Message-ID: <1de43656-e751-53a2-c0da-ff44ecbabbc4@android.com> Date: Tue, 5 Nov 2019 07:37:04 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191105094830.GL22379@quack2.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 11/5/19 1:48 AM, Jan Kara wrote: >> @@ -228,11 +228,11 @@ static int afs_xattr_get_yfs(const struct xattr_handler *handler, >> break; >> case 1: >> data = buf; >> - dsize = snprintf(buf, sizeof(buf), "%u", yacl->inherit_flag); >> + dsize = scnprintf(buf, sizeof(buf), "%u", yacl->inherit_flag); >> break; >> case 2: >> data = buf; >> - dsize = snprintf(buf, sizeof(buf), "%u", yacl->num_cleaned); >> + dsize = scnprintf(buf, sizeof(buf), "%u", yacl->num_cleaned); >> break; >> case 3: > These scnprintf() changes (and there are more in the patch) probably > shouldn't be here... Otherwise the patch still looks good to me :). > > Honza > Good catch, they were done in locality, I forgot about them, this patch series has been living for almost a year now and time has become its enemy ... will spin this as a separate patch. They strike as a security issue with the possibility of fragile UAF when the code is maintained by future selves. -- Mark