Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp625944pxu; Sun, 25 Oct 2020 11:36:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwThMwqHPkTaoqWzRztHBi1tpKKto7/CQqmHTM4tb0CMXu7viuNRona45SaXWSh7I0EJtN1 X-Received: by 2002:a17:907:960b:: with SMTP id gb11mr8900973ejc.396.1603651004286; Sun, 25 Oct 2020 11:36:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603651004; cv=none; d=google.com; s=arc-20160816; b=LR/LanpfYent35rBV0xSJBlAZslGSgCGnK6m8LrgdSKPgO3NcUPA2+A4vGZYWPvVPz Wq+ZZ5cMeSPG5KIj1p6zDMZIGVWOuD7oYGwqxUUeOuuTxZHj782HFHac9jxJN5kkBrRm MUuPQxqLHAj1Tf+z0sCbwwH4A4/nV0Vg3VwwxmEkJrwXebLkb0nQvnoqK4fKjRMeJ3+o oLyzaPQZAQ8+xzRJXzJgMBUf8g6DkDmx3r0fKm8DWkKhT244tQgO1zPvfSnb4Bc1PQkL Qu9KFkySLpkmB57lL/mNpRqKB0eRaHaYsPodsIp347x9J+Wr7EybP/5FlWb0maLhu9nk AZVw== 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:autocrypt:from :references:cc:to:subject:sender:dkim-signature; bh=xs3Wsd8vpaYG0UM0SIf7U3L3ysofl8Y/B4K3NZYbjsQ=; b=kD3Vsw0Xf/N0hb6JtQHai6muszLdb4jMQUotgoBqGJAhEo42RaDYgMS6j5TjFPifuP 6rz8se2nx3XZwY4Q4nhHrnvqNHJGIoRJqm5AjFcq8ssNPa8Wr0BCyFjqndbCwc9D6gtf 3KIqr29ugrrQUnx8LZDpZgH+sv5Bf0efcAK5i6OebTbFR9PXSu7Az651ate47QiV53aD h6xztz2Vl0Xy1K9Y5jJlK9ZOgFw7CEQmhK3fj1u7Ozkg8igMecuLgEE3NchEBsWsspVc 8W1BOxaRLh9sWCMHHUc7yV15wfEIzzphBvyXfKDdBVdJ3CoZ88K2jkiRJwZ+YdwtwcyX USnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jdIuC8Z2; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p5si5676096ejy.384.2020.10.25.11.36.17; Sun, 25 Oct 2020 11:36:44 -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=jdIuC8Z2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1417680AbgJYRkq (ORCPT + 99 others); Sun, 25 Oct 2020 13:40:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1417675AbgJYRkp (ORCPT ); Sun, 25 Oct 2020 13:40:45 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86CEDC061755; Sun, 25 Oct 2020 10:40:45 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id 32so6071776otm.3; Sun, 25 Oct 2020 10:40:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xs3Wsd8vpaYG0UM0SIf7U3L3ysofl8Y/B4K3NZYbjsQ=; b=jdIuC8Z2TlU/9M8zE/okni2BBkixMFEeGyLKl1BhrItPQOCihSaWDeuQw5UO5TDQFZ sC/2X+xBbavK2V7IGqEOSMMNvf+wmyHC9G/TRB9oyfnsmqR2pvdXk3Yrvxs1dDBAvIrh MgFzSNso9CiegenrdlZJWFdCo9joocyJzwgjgpZi76fE0U3Jj8cHgs9674yA9wcRkVo5 /ZttpDu4vG7Df4Kj5YdugKRowS30f4ynXqeK6EwjhjEZfPc7WZ2O6XWVMQ07zflnCUJT 6yfC4cuAt7zeHEWwx9uoexTDpMb0HX7Wp8AQid+2aOwbufKx5aMU8TdysCfbcBVCaGoP J64g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=xs3Wsd8vpaYG0UM0SIf7U3L3ysofl8Y/B4K3NZYbjsQ=; b=qCBek8e4sQYUD35E5aWwBc/w90yqsjYqj3sG5RlCfo1AP0apoC5dZHKSCrUIFfa7tI LahUDTbyKhec9mjCLzUJOUS5d5qIW0VLGd1Nlm69cYKdFUhJSywJQlbwhQwg4PpWzQDi 7+LOPyzb/9usjJ/LOE//InpYzq8wd37Qiu9dfBA9xsx4U1OwMQajJW/g3xVMFd78xQ07 htPdSoQVI4O1zMCtuyI+KVsB5v+8/zxzIo9QIeCgczBUjXpzJODE2A2ZnlENTpCxelaq itA7pSk5pSJSbvz96mUyJYGlNpWWfyyTQiWFMpCAjADQesw5c1F2Mez0NvICE5ZCLynI sKmA== X-Gm-Message-State: AOAM531qQkQJLFoHOLaf6aZZgzz78XoQBCqryU3kIz/vVW8kLYL4AhaZ 0QqFvluYb0yxjYmwASYbLl/PSDv9NeU= X-Received: by 2002:a9d:6d99:: with SMTP id x25mr8352422otp.57.1603647644814; Sun, 25 Oct 2020 10:40:44 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 61sm2132820otc.9.2020.10.25.10.40.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 25 Oct 2020 10:40:44 -0700 (PDT) Sender: Guenter Roeck Subject: Re: [PATCH] watchdog: sbc_fitpc2_wdt: add __user annotations To: Rasmus Villemoes , Wim Van Sebroeck Cc: kernel test robot , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org References: <20201025124518.31647-1-linux@rasmusvillemoes.dk> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOh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WJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= Message-ID: Date: Sun, 25 Oct 2020 10:40:43 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201025124518.31647-1-linux@rasmusvillemoes.dk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/25/20 5:45 AM, Rasmus Villemoes wrote: > After a change to the put_user() macro on x86, kernel test robot has > started sending me complaints (from sparse) about passing kernel > pointers to put_user(). So add the __user annotations to the various > casts in fitpc2_wdt_ioctl(), and while in here, also make the write > method actually match the prototype of file_operations::write. > > Reported-by: kernel test robot > Signed-off-by: Rasmus Villemoes It would really be great if we can get rid of all those old drivers. Can we mark them all as deprecated ? Reviewed-by: Guenter Roeck > --- > drivers/watchdog/sbc_fitpc2_wdt.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/watchdog/sbc_fitpc2_wdt.c b/drivers/watchdog/sbc_fitpc2_wdt.c > index 04483d6453d6a147703e..13db71e165836eb73249 100644 > --- a/drivers/watchdog/sbc_fitpc2_wdt.c > +++ b/drivers/watchdog/sbc_fitpc2_wdt.c > @@ -78,7 +78,7 @@ static int fitpc2_wdt_open(struct inode *inode, struct file *file) > return stream_open(inode, file); > } > > -static ssize_t fitpc2_wdt_write(struct file *file, const char *data, > +static ssize_t fitpc2_wdt_write(struct file *file, const char __user *data, > size_t len, loff_t *ppos) > { > size_t i; > @@ -125,16 +125,16 @@ static long fitpc2_wdt_ioctl(struct file *file, unsigned int cmd, > > switch (cmd) { > case WDIOC_GETSUPPORT: > - ret = copy_to_user((struct watchdog_info *)arg, &ident, > + ret = copy_to_user((struct watchdog_info __user *)arg, &ident, > sizeof(ident)) ? -EFAULT : 0; > break; > > case WDIOC_GETSTATUS: > - ret = put_user(0, (int *)arg); > + ret = put_user(0, (int __user *)arg); > break; > > case WDIOC_GETBOOTSTATUS: > - ret = put_user(0, (int *)arg); > + ret = put_user(0, (int __user *)arg); > break; > > case WDIOC_KEEPALIVE: > @@ -143,7 +143,7 @@ static long fitpc2_wdt_ioctl(struct file *file, unsigned int cmd, > break; > > case WDIOC_SETTIMEOUT: > - ret = get_user(time, (int *)arg); > + ret = get_user(time, (int __user *)arg); > if (ret) > break; > > @@ -157,7 +157,7 @@ static long fitpc2_wdt_ioctl(struct file *file, unsigned int cmd, > fallthrough; > > case WDIOC_GETTIMEOUT: > - ret = put_user(margin, (int *)arg); > + ret = put_user(margin, (int __user *)arg); > break; > } > >