Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp131663ybk; Tue, 12 May 2020 17:41:50 -0700 (PDT) X-Google-Smtp-Source: APiQypKlOu3MsQCCbz1pynP02W+QHN+gByli25v2z6E5eKFBRfIWD3hXWFTwEdHiNZ1HYxsIYsKE X-Received: by 2002:aa7:dac4:: with SMTP id x4mr19531397eds.127.1589330509924; Tue, 12 May 2020 17:41:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589330509; cv=none; d=google.com; s=arc-20160816; b=Y3OctCUdW4zowhu17+HUwhx/siuiaSnVvBQQZhpUJqz7+UwQyqFAA95+BVFoYs5Nys u27k6c5OP0R1zlqAHq/R+91dFvIlicF7+F593Bs0/K15oeOFhUV2V+/E5oa6067WftIo 15t9roIfkCrQSUSh2cij7Nn6mzRN70KVZD8R/NuBzR6GEI4K7jVArqBS6RlE3EiCDPKg moQ9KhrRSfv3sVaUqbxxvJgAhHCSKx7ET1IKZ+ZEKSDawPs2ZU1uaD8Fjek0jKfTFFyZ TvQc3F/xqhybufjeZGtgiYRdpO2hosBlm0g8Gugsr1R4NT7WwnKOiSvYMtdZVbC+pt5x 9Mbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=uFKqSypxRhLNaszQ9FU/hBZK81MFbv8LrHsXvYdnkac=; b=faW+bqeCsFTJPiSLSycvOiB/TzVXRncs0OGcOwB68B1qjiG+KR8l94VeCYUOaLhojp rNAGf0oc/gG0yhdPQBdG9bF+6kc11cokf8nYYv+qLX8Y8Q8kIbfKqXV5cjL4h7dY4FcZ p9fDZBLP/vtqlRSK4dPZUyciS0LaTGmYGWwgL8tRkjxkLHwU/TWLj86Ph+qxL9GXYybi QPF9NKcdNX2+BAKOC1l9BoKOw9uQqCXQrFZgj20FvjG27oKUIaj+SOoJousmBionHN24 N9GW8EummqgI6lhs/GD+mGwI6hzryXs6vRG09TNJgT2bFtZPHIDlgkIyLUsTRcyq9MSz 6VkQ== ARC-Authentication-Results: i=1; mx.google.com; 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 c21si9943825edx.105.2020.05.12.17.41.26; Tue, 12 May 2020 17:41:49 -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; 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 S1731815AbgEMAj6 (ORCPT + 99 others); Tue, 12 May 2020 20:39:58 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:38514 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731946AbgEMAjz (ORCPT ); Tue, 12 May 2020 20:39:55 -0400 Received: by mail-pl1-f195.google.com with SMTP id m7so6132474plt.5; Tue, 12 May 2020 17:39:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=uFKqSypxRhLNaszQ9FU/hBZK81MFbv8LrHsXvYdnkac=; b=ZVrDbV9qgKnN9gGLjhFInOMSdohdaRKyVB77Y4evG8EWZu0shRcJgpdEp7QfqutPXR 8ZBfZawSLOABG+DfMUayCADnV+CoSQLc2XB8Tmvb01oMeQOj1hpvC1LhCJSdzV3cHXgT gdAQHC5auyQNhfCWSUyzhT0G3Msq+T9Yjqnt9fwXLww3PzZKV5BS8vzsELMT0CxQnBU0 zf8gMOXRZdnrNn8B3ejlPOjLSfNKRxs4KWyJzqfJgsJVL5iYMW9hlBarAWr9suDi282x KXvBWPnLHnWwcBPaa+Z6qi6d5WsPp35CXwBgdwvUdAlnCfqB4KvcpOE8DXwvvGvTycDr wz3g== X-Gm-Message-State: AGi0Puba5MOjRpgUlYmyVH26OvXVnLZbmLlO4Pqpl82Rur0LqKvPbhwL m4yIcdvN/jJ7v96K1FXO9DQ= X-Received: by 2002:a17:90a:ac05:: with SMTP id o5mr29078872pjq.184.1589330394632; Tue, 12 May 2020 17:39:54 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id h31sm14142647pjb.33.2020.05.12.17.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2020 17:39:53 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 0F22C4063E; Wed, 13 May 2020 00:39:53 +0000 (UTC) Date: Wed, 13 May 2020 00:39:53 +0000 From: Luis Chamberlain To: Rafael Aquini Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, keescook@chromium.org, akpm@linux-foundation.org, yzaikin@google.com, tytso@mit.edu Subject: Re: [PATCH v2] kernel: sysctl: ignore out-of-range taint bits introduced via kernel.tainted Message-ID: <20200513003953.GK11244@42.do-not-panic.com> References: <20200512223946.888020-1-aquini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200512223946.888020-1-aquini@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 12, 2020 at 06:39:46PM -0400, Rafael Aquini wrote: > Users with SYS_ADMIN capability can add arbitrary taint flags > to the running kernel by writing to /proc/sys/kernel/tainted > or issuing the command 'sysctl -w kernel.tainted=...'. > These interface, however, are open for any integer value > and this might an invalid set of flags being committed to > the tainted_mask bitset. > > This patch introduces a simple way for proc_taint() to ignore > any eventual invalid bit coming from the user input before > committing those bits to the kernel tainted_mask. > > Signed-off-by: Rafael Aquini Reviewed-by: Luis Chamberlain Luis