From patchwork Mon Oct 24 11:32:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9733 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp548155wru; Mon, 24 Oct 2022 09:40:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5G4cL/g/958tx/XkgfCD1Ftxo/5m/OVbzEPOQY0tMCf5QbpqBLiSi3v/fWeg2RdFKY6Rpa X-Received: by 2002:a05:6402:4444:b0:458:f355:ce04 with SMTP id o4-20020a056402444400b00458f355ce04mr31984718edb.422.1666629657326; Mon, 24 Oct 2022 09:40:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666629657; cv=none; d=google.com; s=arc-20160816; b=hg9/n48+RFGus9fMG5OpLkfeQgesVubRzMtRYwNzIQjaB2uf07RZF7NIGQjfEpQKh8 tfgR1YhforFLq3oMxRd+8xLF/NFbXcCn05wT/7yfV0e0HZN0zdzLSeYriNi+7XtCv5qB 49fhD/KMqBUdghywHqV6DheHXS8ix9GY4qmV9RbBqdwmzIDZZkJpdDGLlLyb711SRjoz FVA0MsR+RAed1FBPeimgoSgua6XSRRni6JYA68z49WpQ+29cgSeddkJe0PmGozdaRNT9 xY9Q0mIPHQL6uXVwiuoQCKK1B88RJfru2dyVfi3mbOuvggegRsTmPYfZyzfltWh7BpWc 3f6Q== 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=IXgBo/m3rjtlAWmjdgHrqdRQPZjtwj+wuJm/E4uQGWY=; b=HJ3OxLVOn4o8qkfBNR54vX7ZdVPzLAfoREjR/lqHpXjd6qNFGXYZGQUi6paLhcKnb3 9ckLbp4ERkvRGKYPRteiolv2WtQKwUAgwEN9nR7R4haV3kvfG50y3GEBPK2whdhdzMHa Hiplqr+0sv2Qzr5TpKlYcfbMs25IJCoCJybtEXsx4BC8U4Irt5j1KhRp4OGRtPx9L5fs 8mJFZj7vWX3U4fXF8EA1q2CrtiQjs6g8WxmoAPA6kS/e5LFY3pt0UGMmy2cXS9yLD9Nt e8V7WsCVnKimAcB9Wrhys180q49sEwKgfP/zDDB/t/at5c5OlGiOZBCMrKuQbCynaLq9 Mmlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QJwHvvHy; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7-20020a50fc07000000b00445f660de5asi221341edr.141.2022.10.24.09.40.33; Mon, 24 Oct 2022 09:40:57 -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=QJwHvvHy; 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 S232344AbiJXQjI (ORCPT + 99 others); Mon, 24 Oct 2022 12:39:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234306AbiJXQic (ORCPT ); Mon, 24 Oct 2022 12:38:32 -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 698FA18F0DA; Mon, 24 Oct 2022 08:26:09 -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 76D87B81633; Mon, 24 Oct 2022 12:15:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE549C4314C; Mon, 24 Oct 2022 12:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613737; bh=dUlv4IUjZufYUsjXRHX/QmwZKP4NWeHS6rGyTNwFWuU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QJwHvvHyz0Z/AtKCzbo2MkumGWOJJcQ+KnbWLG/9eEBYD2TxytQsAeGfpplE0PqBg c/x3p+Rdlsn6Xbqqbs8Qd/s9g9WtNk9+PEETy9B7UiJiSfYHbUpEz5Fo/0V4ZO3lOc p23GE9zpZbc7zlrW2bnIxdhmUjwwf9MsLOPqq4PA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Aring , Stefan Schmidt , Sasha Levin Subject: [PATCH 5.4 249/255] Revert "net/ieee802154: reject zero-sized raw_sendmsg()" Date: Mon, 24 Oct 2022 13:32:39 +0200 Message-Id: <20221024113011.579988511@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747587859653915705?= X-GMAIL-MSGID: =?utf-8?q?1747587859653915705?= From: Alexander Aring [ Upstream commit 2eb2756f6c9e9621e022d78321ce40a62c4520b5 ] This reverts commit 3a4d061c699bd3eedc80dc97a4b2a2e1af83c6f5. There is a v2 which does return zero if zero length is given. Signed-off-by: Alexander Aring Link: https://lore.kernel.org/r/20221005014750.3685555-1-aahringo@redhat.com Signed-off-by: Stefan Schmidt Signed-off-by: Sasha Levin --- net/ieee802154/socket.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/ieee802154/socket.c b/net/ieee802154/socket.c index 72637d5994d8..a92b11999e5f 100644 --- a/net/ieee802154/socket.c +++ b/net/ieee802154/socket.c @@ -252,9 +252,6 @@ static int raw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) return -EOPNOTSUPP; } - if (!size) - return -EINVAL; - lock_sock(sk); if (!sk->sk_bound_dev_if) dev = dev_getfirstbyhwtype(sock_net(sk), ARPHRD_IEEE802154);