Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754543AbbKQSqh (ORCPT ); Tue, 17 Nov 2015 13:46:37 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:36281 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752728AbbKQSqg (ORCPT ); Tue, 17 Nov 2015 13:46:36 -0500 Date: Tue, 17 Nov 2015 18:46:27 +0000 From: Mark Brown To: Anton Bondarenko Cc: Joshua Clayton , Jonathan Corbet , Adrian Remonda , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org Message-ID: <20151117184627.GC31303@sirena.org.uk> References: <564B716E.5020605@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Ro1PRY3Rtw8g7IwX" Content-Disposition: inline In-Reply-To: <564B716E.5020605@gmail.com> X-Cookie: Does the name Pavlov ring a bell? User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH 3/8] Documentation/spi/spidev_test.c: accept input from a file X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1766 Lines: 44 --Ro1PRY3Rtw8g7IwX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Nov 17, 2015 at 07:26:54PM +0100, Anton Bondarenko wrote: > On 17.11.2015 16:24, Joshua Clayton wrote: > >+ if (sb.st_size > 4096) > >+ pabort("input file exceeds spidev's 4k limit"); > This is not a true. IIRC PAGE_SIZE is the default buffer size for spidev, > but can be changed using bufsiz module parameter. > Just 'insmod spidev bufsiz=X', where X is number of bytes. Right, there's also various options for changing PAGE_SIZE on some architectures. I was going to go and check what we actually do here but in general it does seem better to just let the kernel worry about validating things like this - it needs to do that anyway and it means that if someone improves the kernel code to accept larger buffers then the tool will automatically be able to use them instead of requiring people to remember to separately update the tool. --Ro1PRY3Rtw8g7IwX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWS3YCAAoJECTWi3JdVIfQ5cwH/03NtgsAaODQWGkSBdvdwEeE LwNu60Ugkbrm84t43aT2AW5sgKRFWhpkIzzxjGJem9Dm0Imv2s8jFNWfwemdSjzC Cvm0eUYjcMRyfBVL6yQtEcquAXk9mUrIQdiB7vaIhGZ6+6S8H50E5/nurbBG8V5N 71r2ul6yqBNG9EzsltD1ErLa89LF650kQXwA6aklZNhby5SBxOKsKu0Qq7hqWLZE 4yrmU5AZr/2sQfzmbdF5vb801j1ZiU+/bHk1KMGbT98uIS8dp5LdBV4ZGJt0vQpZ 8/weAaE+Ln7orWNF0aniZQUncORMKA/Wyctq8Y8l458wtbBhVf3lliSjS/KyfwI= =HsA1 -----END PGP SIGNATURE----- --Ro1PRY3Rtw8g7IwX-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/