From patchwork Sun Dec 23 11:09:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Coly Li X-Patchwork-Id: 10741661 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F30A5161F for ; Sun, 23 Dec 2018 11:10:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5E7E28AF2 for ; Sun, 23 Dec 2018 11:10:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7FF628AF7; Sun, 23 Dec 2018 11:10:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CD5728AF2 for ; Sun, 23 Dec 2018 11:10:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727958AbeLWLKR (ORCPT ); Sun, 23 Dec 2018 06:10:17 -0500 Received: from mx2.suse.de ([195.135.220.15]:49462 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725868AbeLWLKR (ORCPT ); Sun, 23 Dec 2018 06:10:17 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9E3A0AF0B; Sun, 23 Dec 2018 11:10:15 +0000 (UTC) From: Coly Li To: linux-bcache@vger.kernel.org Cc: linux-block@vger.kernel.org, Coly Li Subject: [PATCH 00/11] fixes for setting values via sysfs interface Date: Sun, 23 Dec 2018 19:09:26 +0800 Message-Id: <20181223110937.11559-1-colyli@suse.de> X-Mailer: git-send-email 2.16.4 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When setting bcache parameters via sysfs interface, current code has potential overflow and results unexpected value got set. Once such condition happens, it is very hard to find out in product environment. This patch set is an effort to fix such overflow, to avoid further unpected problems. Coly Li --- Coly Li (11): bcache: fix input integer overflow of congested threshold bcache: fix input overflow to sequential_cutoff bcache: add sysfs_strtoul_bool() for setting bit-field variables bcache: use sysfs_strtoul_bool() to set bit-field variables bcache: fix input overflow to writeback_delay bcache: fix potential div-zero error of writeback_rate_i_term_inverse bcache: fix potential div-zero error of writeback_rate_p_term_inverse bcache: fix input overflow to writeback_rate_minimum bcache: fix input overflow to journal_delay_ms bcache: fix input overflow to cache set io_error_limit bcache: fix input overflow to cache set sysfs file io_error_halflife drivers/md/bcache/sysfs.c | 61 ++++++++++++++++++++++++++++++----------------- drivers/md/bcache/sysfs.h | 10 ++++++++ 2 files changed, 49 insertions(+), 22 deletions(-)