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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1576DCCA47B for ; Thu, 2 Jun 2022 18:41:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238239AbiFBSlh (ORCPT ); Thu, 2 Jun 2022 14:41:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238235AbiFBSlf (ORCPT ); Thu, 2 Jun 2022 14:41:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70A6113CE0 for ; Thu, 2 Jun 2022 11:41:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AA99661702 for ; Thu, 2 Jun 2022 18:41:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1B92C385A5; Thu, 2 Jun 2022 18:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1654195293; bh=BiBtVCnOnVCnBb/s+KIDqG6XVHJWq/doHqTwPsrqDDg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=wcfwJ2N6m6iYkyLPXAvxRttyDCvkGAqeByInXKFMdk9RkuPrnImtmzX0YBMzcdDw5 1luGPe9SVVlz0r6sPFfRuMQgvEfILrNJZPihvvI2uKazI53rfhy38KX9b7BkUgtnMD CuPQREkUiB1ovWxFj1XxqayxFBkbwg4GW5TJpvyc= Date: Thu, 2 Jun 2022 11:41:32 -0700 From: Andrew Morton To: Roman Gushchin Cc: linux-mm@kvack.org, Dave Chinner , linux-kernel@vger.kernel.org, Kent Overstreet , Hillf Danton , Christophe JAILLET , Muchun Song Subject: Re: [PATCH v5 6/6] mm: shrinkers: add scan interface for shrinker debugfs Message-Id: <20220602114132.f6e5675b2d2a4085b9b1e8c4@linux-foundation.org> In-Reply-To: References: <20220601032227.4076670-1-roman.gushchin@linux.dev> <20220601032227.4076670-7-roman.gushchin@linux.dev> <20220601142351.5e04fea5586ca51898d8785f@linux-foundation.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 1 Jun 2022 17:56:22 -0700 Roman Gushchin wrote: > > > > > + ssize_t ret; > > > + > > > + if (copy_from_user(kbuf, buf, read_len)) > > > + return -EFAULT; > > > + kbuf[read_len] = '\0'; > > > + > > > + if (sscanf(kbuf, "%lu %d %lu", &ino, &nid, &nr_to_scan) < 2) > > > > Was it intentional to permit more than three args? > > Good catch! No, of course it wasn't intentional. > > Below is an updated version of this patch. > > ... > > + if (sscanf(kbuf, "%lu %d %lu", &ino, &nid, &nr_to_scan) != 2) > + return -EINVAL; s/2/3/methinks?