Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3414822rwa; Tue, 23 Aug 2022 04:30:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR7I3l80+Evd+gsEWLvE4A+YMKP6r2IY6Mpxi1eoBakxdkg4j9Ci/S66RhyRw5wOsw47wYrt X-Received: by 2002:aa7:81d7:0:b0:536:d357:d93d with SMTP id c23-20020aa781d7000000b00536d357d93dmr5900643pfn.63.1661254169777; Tue, 23 Aug 2022 04:29:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254169; cv=none; d=google.com; s=arc-20160816; b=wJirDE6eB1nLNHq2hD02pW5GFBNBPiNlspczQmfE3X7yOdfBBj99TcTo/V7Itl6Rte U/FCoxKGh1kdSaIHbY2ZMr5wjh9bvgpeyhPBmls2MRko0C6yzs3nnq+ogm2yPaMa3daV F7713nP5laYaZ7UMbwkfqzK244aDElzuPWOotjGDraOWghQQ+bNgz3jaJcNzmNyhJ/Xk Bx4V3pwgVklnBUgkO5bgZLRpYgXJgST1krOBHy9CaK0qZiT+JolFnXzq2DBIda5HWXen Of7pfGvHPl8MKxYoqFGtKlU1IsAkNiSbpXUgAeJToR5o0XaG8A3GDXsPvj+EBMm7U+xg Kf6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EkcTOGIHRyW1wUrmKsqFViO5P/cjczeePk7nBJFKPLI=; b=NhzhKzPSnBdzxl7jvAApDtD/rPPxu/pwyxppYXx3t+XLNuHHBKLcv0PTfOtotiKBv4 3SFebxC9XhTgVsVzzVb3gCczh9ab/RyPBKlsuaRR7w+FoQbUXZQLf3c0WLgXigOk3tsG cQfm8dMAk5YCF5vfX51FfAJfFLi1HSo6CkB8xyGrWwmkS7Lxgtdfq9K75y2a+uulQP66 QrSPHohV9XAcku7rwk82ULehBmpWypjXakFJG6+hXUHseqNmCEdEGHlkcyxSkS/1PQW3 frtDzL61Xe5JRh1NcXM+lQmDxaY3Z47tHUeHUqUJdwJhXVPFMYBpxzPlWXpU4Gb6oR5B 1V2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XWActTxs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mw13-20020a17090b4d0d00b001f1e9e2933asi16937879pjb.177.2022.08.23.04.29.18; Tue, 23 Aug 2022 04:29:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XWActTxs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352326AbiHWKH0 (ORCPT + 99 others); Tue, 23 Aug 2022 06:07:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352419AbiHWKBx (ORCPT ); Tue, 23 Aug 2022 06:01:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 803518689D; Tue, 23 Aug 2022 01:49:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 89FC361377; Tue, 23 Aug 2022 08:49:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C835C433C1; Tue, 23 Aug 2022 08:49:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244581; bh=qg+/edhD8Dj7xYw7+5T+IE/jl2tVylbiDANkfdB+QyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XWActTxssoXAYItvce5FDiHp084N0SO/fLQzjev1KwE4YE3bBvfQ6BD/Uv31Toyss Mj3EvA1JMi0oFP+t4CtLMYreIyyPINwR8McAmpz3swzIhmtbLvhX8hbpdqDy6B0C9j Hjv2ovIn0XNsvsfky/UOLDfuPmA2vIZH2Qp9J42g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Stefani Seibold , Randy Dunlap , Andrew Morton , Sasha Levin Subject: [PATCH 4.14 130/229] kfifo: fix kfifo_to_user() return type Date: Tue, 23 Aug 2022 10:24:51 +0200 Message-Id: <20220823080058.362416018@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 045ed31e23aea840648c290dbde04797064960db ] The kfifo_to_user() macro is supposed to return zero for success or negative error codes. Unfortunately, there is a signedness bug so it returns unsigned int. This only affects callers which try to save the result in ssize_t and as far as I can see the only place which does that is line6_hwdep_read(). TL;DR: s/_uint/_int/. Link: https://lkml.kernel.org/r/YrVL3OJVLlNhIMFs@kili Fixes: 144ecf310eb5 ("kfifo: fix kfifo_alloc() to return a signed int value") Signed-off-by: Dan Carpenter Cc: Stefani Seibold Cc: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- include/linux/kfifo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index 86b5fb08e96c..d1781f35dea4 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h @@ -629,7 +629,7 @@ __kfifo_uint_must_check_helper( \ * writer, you don't need extra locking to use these macro. */ #define kfifo_to_user(fifo, to, len, copied) \ -__kfifo_uint_must_check_helper( \ +__kfifo_int_must_check_helper( \ ({ \ typeof((fifo) + 1) __tmp = (fifo); \ void __user *__to = (to); \ -- 2.35.1