Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp652463pxb; Tue, 5 Apr 2022 17:23:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyk7aLBqJALcPJ/6yc3YNWqH1vAR/GylQVIcvfwwtHpnMfqvSG2SuQBOsylu8Jr7qi7lFw4 X-Received: by 2002:a05:6a00:14d5:b0:4fb:2adf:dcdd with SMTP id w21-20020a056a0014d500b004fb2adfdcddmr6255000pfu.72.1649204624994; Tue, 05 Apr 2022 17:23:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649204624; cv=none; d=google.com; s=arc-20160816; b=Rimuc9slrJ6IszRLX6OsPF5iCu9fk35EafRC2T1R+gUS7gq/wMrTkoy7QTuVlsiVRt AFBzgJ8ch1JvZU1oD865uP/LEKZt7Rcv1mDA2vv0ieU9lJip8MNNOuZo5VB6+omPPkLh ZkNpBw9tielLAas42OYPHVBs0GFblYcr6ZTSGVPJOpt7+K5QzSvaXQ/VfVCdnU9zQAi8 lRdQ1plJQPFhi44q9UqMIDp+THaadhI1xwIkijoU/Uf8ffHtbQYTzSTyBrwKcWD+kAaA cJdmZEk0UPnUfrn1yxmftU4VP++Z6EU4xSw8DAjiNKQUdyw26uxREjPZ9vSn+/R/vnWu mrJw== 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=fz0Wl6Z2pFnX81RHElc/+gpugfN/rn11FQKSBzlt3Gg=; b=le9fiR6GMqAoOuNKeH7A/mo3T7pePi9oqnzv/0JwsWTt4wau2GIXqIiVX7IhH/lFej BquOlvszA/HDur15JCiUqnY/X50D0PaVm6L8WPoVpU7akTw5k0NonE6eeAiFt47DmB54 69iF0r9yBlha0s1G1ZQkCsEmLTel54D32CjegfVTMJqG9IRtMavPeB6jjd8+IWVe8QYY hgpY+UBah0jsUK9tlAA8XiiQVQpSMVnH6uRgRcgQw0IJ3CRwZvDzHbKNjH+i7ninvOvT Z6SBQPDKTXY++qCv/Q80dXgdUBwq2LLdp3JBn8Vo2BCfqZUpvcXhf44O5Nq/KdRNTg+B HDvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RTgSBdtY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d5-20020a170902cec500b00153b2d165b3si10181264plg.443.2022.04.05.17.23.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 17:23:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RTgSBdtY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 82B21234043; Tue, 5 Apr 2022 17:10:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236388AbiDENxS (ORCPT + 99 others); Tue, 5 Apr 2022 09:53:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347702AbiDEJ2M (ORCPT ); Tue, 5 Apr 2022 05:28:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A526DFD40; Tue, 5 Apr 2022 02:15:36 -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 ams.source.kernel.org (Postfix) with ESMTPS id 77DE0B80DA1; Tue, 5 Apr 2022 09:15:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C56C2C385A2; Tue, 5 Apr 2022 09:15:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150133; bh=8amx3lYhPdvxlPyXrtkPsQvIG3FbeBS5jWOreTSZbyk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RTgSBdtYpj89IrdRZ/n2ME2CIp9/SKhJuk4G7toHEOxU9/cYS/JM073eG3ioNlVXn caEEIhRItuxNEexzUGw6FqTyFqpijSYH8taimrOdSV/K/DJcZJD9hw9PZ+rPUS6Zw+ 0jyrinP2cez3meRLjoeGuWjIZaHzNjc6weq4ekaU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Derek Will , Oliver Hartkopp , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 5.16 0959/1017] can: isotp: restore accidentally removed MSG_PEEK feature Date: Tue, 5 Apr 2022 09:31:12 +0200 Message-Id: <20220405070422.674777185@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: Oliver Hartkopp [ Upstream commit e382fea8ae54f5bb62869c6b69b33993d43adeca ] In commit 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading from socket") a new check for recvmsg flags has been introduced that only checked for the flags that are handled in isotp_recvmsg() itself. This accidentally removed the MSG_PEEK feature flag which is processed later in the call chain in __skb_try_recv_from_queue(). Add MSG_PEEK to the set of valid flags to restore the feature. Fixes: 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading from socket") Link: https://github.com/linux-can/can-utils/issues/347#issuecomment-1079554254 Link: https://lore.kernel.org/all/20220328113611.3691-1-socketcan@hartkopp.net Reported-by: Derek Will Suggested-by: Derek Will Tested-by: Derek Will Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- net/can/isotp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/can/isotp.c b/net/can/isotp.c index ad61342d2e16..a95d171b3a64 100644 --- a/net/can/isotp.c +++ b/net/can/isotp.c @@ -1009,7 +1009,7 @@ static int isotp_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, int noblock = flags & MSG_DONTWAIT; int ret = 0; - if (flags & ~(MSG_DONTWAIT | MSG_TRUNC)) + if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK)) return -EINVAL; if (!so->bound) -- 2.34.1