Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp31836pxt; Wed, 4 Aug 2021 14:56:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpN+YHxC3i3zJpPyNnf/YKTAueNwo5t2R2LVKLfWU58KRyFpDOLnqbc0PMbk98H1fJufSt X-Received: by 2002:a05:6402:10d7:: with SMTP id p23mr2229011edu.74.1628114172061; Wed, 04 Aug 2021 14:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628114172; cv=none; d=google.com; s=arc-20160816; b=Ti+utmkzVXKdbWdS++CeQAq7pkd8uuUsVOeiI49MnQztRZhC5h6QKHMktUJ2g1xrgH Jg/IY8aqoZYztwT1b+ZU3Bu6vI7pukqhEfNNl78CIMC59mar4odq3ZeI9U7gxDcGlAOu x7oOoHH4pLEgJo4w4uCCoX2SQNFysOmVyDEfsXP5LIZRhHy26cHhAfhnEkMvcOuluYwS MsBCimLDBcB34hZ2aEs6D3f8HjW8yVYxSyLXIy/UuypC3bvApT24TXcxoxxZXBzmiofK FHtmrtyVFEzgDjZUsGe5vOjHyLdf5gd5Qmzip4q+DOudh5cmXtwdFdbkY1ARDPuUzws9 dhAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=bONVJm2u7mjbnF6r6GUBKZ7MwSjtTYsdAL74ZwDL7PQ=; b=UDbLaqfMtIE+vzRmaIJKn6hEWG3Jjf7F9/C8NIjfxE4T7o+NZ2to+ji/d/hkv99hz8 fWhAgJQaMZoEijJo3HxipDC2M+Q/w53y/8RyUg4zOqMF5NHWK3mUBnOjivNKI2lsuIar z807Z+y73r7wzOYMXp2oVJIss9UMy2NjbBOmy6xAa2mO172heAnucpjmKkQIs6kr/AVs bX5Jp7kgkK2+jvrJ/eBTm5hw1xyzWrLtibtvy1ILidm2476gZAGZ3pHprfKN9Wl5Pp/W EC45cNGF2ByNhjk4HCKhsl9e6nNQHDLRfqUtKLnsH0svXcFuETLzlOwvFZN0fPhLFloZ U5Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LrTk2EPP; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si3572181edq.2.2021.08.04.14.55.39; Wed, 04 Aug 2021 14:56:12 -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=@kernel.org header.s=k20201202 header.b=LrTk2EPP; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239346AbhHDU1X (ORCPT + 99 others); Wed, 4 Aug 2021 16:27:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:54790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239264AbhHDU1W (ORCPT ); Wed, 4 Aug 2021 16:27:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1E75160EEA; Wed, 4 Aug 2021 20:27:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628108829; bh=OFuHzIx1yeS+oBkNtoPi2t+wD1xasUaIy6nbSaVVH9U=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=LrTk2EPP54RSKJ1w1msnV6aIhI9o8cb3L/oTfhzGDQcR5u22D3YKxYvE+sFqZoXVN hTcQcIfFOPCgZ+RX4RPWwQ1pCdPdePc180RiFI2L+lcg9gFlomcMtmqfRPG0vI1Ctm Y5z/X1IpUEO6p1OgaC34VQJtRLxfeiHDCKeWC/QWabIidooGI/EUV8aduLa0lh3+vY xal7vt2oYC9gN4D0w+R7driM39NtfFtMsjePAbQaGNyc6Guo6odCfH1Utsh0xVEHRe Zq5XY5NFmKVDCqxh1G1HgT7KCi3wwQoc6OZGOd81cq8QqMJu8RAC4zoEIk0FQbVHZh 0om1ewoNr6INA== Subject: Re: [PATCH v3] ucounts: add missing data type changes To: "Eric W. Biederman" Cc: Sven Schnelle , Alexey Gladkov , linux-kernel@vger.kernel.org References: <20210730062854.3601635-1-svens@linux.ibm.com> <875ywlat5e.fsf@disp2133> From: Nathan Chancellor Message-ID: <94478003-8259-4b57-6d93-5a07e0750946@kernel.org> Date: Wed, 4 Aug 2021 13:27:08 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <875ywlat5e.fsf@disp2133> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Eric, On 8/4/2021 12:47 PM, Eric W. Biederman wrote: > Nathan Chancellor writes: > >> On Fri, Jul 30, 2021 at 08:28:54AM +0200, Sven Schnelle wrote: >>> commit f9c82a4ea89c3 ("Increase size of ucounts to atomic_long_t") >>> changed the data type of ucounts/ucounts_max to long, but missed to >>> adjust a few other places. This is noticeable on big endian platforms >>> from user space because the /proc/sys/user/max_*_names files all >>> contain 0. >>> >>> Fixes: f9c82a4ea89c ("Increase size of ucounts to atomic_long_t") >>> Signed-off-by: Sven Schnelle >> >> This patch in -next as commit e43fc41d1f7f ("ucounts: add missing data type >> changes") causes Windows Subsystem for Linux to fail to start: >> >> [error 0x8007010b when launching `wsl.exe -d Arch'] Could not access starting >> directory "\\wsl$\Arch\home\nathan" >> >> Specifically, it is the change to max_user_watches in >> fs/notify/inotify/inotify_user.c, as the below diff gets me back to working. >> Unfortunately, I have no additional information to offer beyond that as WSL's >> init is custom and closed source (as far as I am aware) and there are no real >> debugging utilities. > > Could you try this patch and tell us what value is being set? > > The only think I can imagine is that someone wants unlimited watches and > sets the value to a ridiculously large value and the interpretation of > that value winds up being different between int and long. > > This should allow you to read either dmesg or the kernel's log as it > boots up and see what value is being written. From there it should > be relatively straight forward to figure out what is going on. I applied this diff on top of mine and running 'dmesg |& grep intvec' shows: [ 0.282500] intvec: dmesg_restrict <- 0 [ 0.282510] intvec: max_user_watches <- 524288 This seems much smaller than INT_MAX so I am not sure how the value could be different between int and long but I am not at all familiar with the sysctl code. More than happy to continue to test debug patches or provide any additional information as I can. Cheers, Nathan > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > index 272f4a272f8c..733c4cfa1f60 100644 > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -975,6 +975,14 @@ int proc_dointvec_minmax(struct ctl_table *table, int write, > .min = (int *) table->extra1, > .max = (int *) table->extra2, > }; > +#if 1 > + size_t lenv = *lenp; > + if (write && (lenv > 0) && (lenv < INT_MAX)) { > + int len = lenv; > + printk(KERN_EMERG "intvec: %s <- %*.*s\n", > + table->procname, len, len, (char *)buffer); > + } > +#endif > return do_proc_dointvec(table, write, buffer, lenp, ppos, > do_proc_dointvec_minmax_conv, ¶m); > } >