Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1132251pxf; Fri, 2 Apr 2021 02:00:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwL3w1lXHeCywwFRQj5jtHftjt7ZzBhd2dpGi1cMSJ1FqKC2REavJubeNOicETxSDqLaYr9 X-Received: by 2002:a92:4b05:: with SMTP id m5mr10853773ilg.188.1617354043687; Fri, 02 Apr 2021 02:00:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617354043; cv=none; d=google.com; s=arc-20160816; b=aca6v3bHMgWCnfuQQZdQMHrsIAkIOAgr8/Kad2lca7fFL/Gp1NkZeWzvj1gwOD9Yn8 FggF3xLoQzBXHFBrWuqjfSoLwlDDI8asd84Ego5F65SV25UJmsDHMFFYMKw1U9jZ1Lxd AB8tWklt5+M56EjKMIqmJBIOGFUdpYNP0L4ATBRFSCGO3z8cfavwIqJKj5bRDLiZGISs X6JxMQqEKo9mka0zgdZhYlSkvUVfLOcetAfn3ovMdr42jacvBzd8C+blixZaJoznoLb2 /28u2qLgjqQh87L0rzt6jujWMNJa3YN/YfDRDWzeRoDwchIoVn4Q1Oobd+lCNStK5vNz 89zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HywOIhb5prU0SvgCATKvH+ZBrrrzKF5XQkM0MZqr0LA=; b=YaHA5yQLHZy6zLcFXUXB0n4IwF1nTEst2ECS1g3czYynLvooaYu/6/ikyN1HX3zOO8 Jp7PHfSntXafmhkuXQXy0zCOOTo6ggto0djP/mlNFzwKUroARnRSh7q/qhdI208m3c3J JMf/Ww2/aMmhWofcBTKzF0Bj2IUJIJz3iK9ymOg1FTKRmJQ7nUBTugxPcgOYD+DfTl/u PyhX1GOktcaMhSCQLoQ1YsXZnMsCsMYxewt109gT4+cLLUjeoJXAgbN9/qarqecQ5Sc0 IDEEmga5VwrUXmtaAS4rIL/xXE0qN9P1qnr9UaYlCMes8bWdCKnm4HeqCYEYLRow3N3d NbqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K58phw+I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id u28si6983795jaq.75.2021.04.02.02.00.29; Fri, 02 Apr 2021 02:00:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K58phw+I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233894AbhDBI72 (ORCPT + 99 others); Fri, 2 Apr 2021 04:59:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbhDBI7U (ORCPT ); Fri, 2 Apr 2021 04:59:20 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77F23C0613E6; Fri, 2 Apr 2021 01:59:18 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id s17so4978043ljc.5; Fri, 02 Apr 2021 01:59:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HywOIhb5prU0SvgCATKvH+ZBrrrzKF5XQkM0MZqr0LA=; b=K58phw+IpQ//OZE32Gwyp+hDyT7tu3gNVxEMtandIn2kAiffLXdmEdS04bVlL12zRL 3Ll05xL2x9/Gk+5wivRKbqrgR3LpQX0vyVTpJ69ZwbzSUeBmc2PKqPI6MKznUgBhI/Z5 6ei4DP+DUVX4r6T4Cb+PdXQWv0olcT9mOewLrjdl4pA2deoUzXoSDrNBwAImjMo8/q/v RlMq/+aPVcFbNJQjRQ7XrCzv6wcTnjmm2dpsciA1HKIKMp+qf36tyl4KBeDJIK1iwFCc CBIe9O1zsPBiX7cYdtK+nVIP3tr2MzJS7DIaCW1+LORojLEFSCg9UKN1WXHWls0FqOkm Ks2g== 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:from:date :message-id:subject:to:cc; bh=HywOIhb5prU0SvgCATKvH+ZBrrrzKF5XQkM0MZqr0LA=; b=KxIZG03I8U4sHiC8JIgaKrKcgsbOD6HkB7EjRJjXP4gviYymLGiWgnQyg4O+nSq7on WDtxImH4qPsjp8PyOCarK4P1hhu/qv6JmfBlggVgwDW6LPEnrq6Ez1gnmC5sa6LkYrM3 QVG5SIcUhGLScfBTMKSCbT2b89iLC/5DakPdiGWAkAGMlaSFLxWKUP8pGbr5rhZoOqgK F3fgQCSSg6OE1W7oirS2f5RpNmIC1Jo0Y8hSD5Y5XgfzZHrxH1fQGqkw0AZuSihjJSDs 7GLn2QOgvHfKQuELU5JP0WZJ7TotlX5Un6W3EV6POPygCmvAe1fy9MLgtxyl28lyi4JR qiYg== X-Gm-Message-State: AOAM5318wHIn5zPT8IeCN66qB0ofMqbzhjvwSIWYihUEI9H7qJJuewBR OoP2qO9rdO76M2oMiVbVvaStmXZw6W1QmbkgX9W1yWKQrjY= X-Received: by 2002:a05:651c:384:: with SMTP id e4mr7528065ljp.500.1617353956993; Fri, 02 Apr 2021 01:59:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Abdurachmanov Date: Fri, 2 Apr 2021 11:58:40 +0300 Message-ID: Subject: Re: [PATCH] riscv: Bump COMMAND_LINE_SIZE value to 1024 To: Dmitry Vyukov Cc: Palmer Dabbelt , macro@orcam.me.uk, Alex Ghiti , Paul Walmsley , Linux API , linux-riscv , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 2, 2021 at 11:43 AM Dmitry Vyukov wrote: > > On Fri, Apr 2, 2021 at 6:37 AM Palmer Dabbelt wrote: > > > > On Tue, 30 Mar 2021 13:31:45 PDT (-0700), macro@orcam.me.uk wrote: > > > On Mon, 29 Mar 2021, Palmer Dabbelt wrote: > > > > > >> > --- /dev/null > > >> > +++ b/arch/riscv/include/uapi/asm/setup.h > > >> > @@ -0,0 +1,8 @@ > > >> > +/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ > > >> > + > > >> > +#ifndef _UAPI_ASM_RISCV_SETUP_H > > >> > +#define _UAPI_ASM_RISCV_SETUP_H > > >> > + > > >> > +#define COMMAND_LINE_SIZE 1024 > > >> > + > > >> > +#endif /* _UAPI_ASM_RISCV_SETUP_H */ > > >> > > >> I put this on fixes, but it seemes like this should really be a Kconfig > > >> enttry. Either way, ours was quite a bit smaller than most architectures and > > >> it's great that syzbot has started to find bugs, so I'd rather get this in > > >> sooner. > > > > > > This macro is exported as a part of the user API so it must not depend on > > > Kconfig. Also changing it (rather than say adding COMMAND_LINE_SIZE_V2 or > > > switching to an entirely new data object that has its dimension set in a > > > different way) requires careful evaluation as external binaries have and > > > will have the value it expands to compiled in, so it's a part of the ABI > > > too. > > > > Thanks, I didn't realize this was part of the user BI. In that case we > > really can't chage it, so we'll have to sort out some other way do fix > > whatever is going on. > > > > I've dropped this from fixes. > > Does increasing COMMAND_LINE_SIZE break user-space binaries? I would > expect it to work the same way as adding new enum values, or adding > fields at the end of versioned structs, etc. > I would assume the old bootloaders/etc will only support up to the > old, smaller max command line size, while the kernel will support > larger command line size, which is fine. > However, if something copies /proc/cmdline into a fixed-size buffer > and expects that to work, that will break... that's quite unfortunate > user-space code... is it what we afraid of? > > Alternatively, could expose the same COMMAND_LINE_SIZE, but internally > support a larger command line? Looking at kernel commit history I see PowerPC switched from 512 to 2048, and I don't see complaints about the ABI on the mailing list. If COMMAND_LINE_SIZE is used by user space applications and we increase it there shouldn't be problems. I would expect things to work, but just get truncated boot args? That is the application will continue only to look at the initial 512 chars. https://linuxppc-dev.ozlabs.narkive.com/m4cj8nBa/patch-1-1-powerpc-increase-command-line-size-to-2048-from-512