From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [205.139.111.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4445C17BCF for ; Tue, 16 Jan 2024 13:51:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=queasysnail.net Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=queasysnail.net Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-646-qfOomijkO5urtxTQcHKGpg-1; Tue, 16 Jan 2024 08:51:22 -0500 X-MC-Unique: qfOomijkO5urtxTQcHKGpg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 37FFB280A9AB; Tue, 16 Jan 2024 13:51:22 +0000 (UTC) Received: from hog (unknown [10.39.192.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1132CC15A0C; Tue, 16 Jan 2024 13:51:20 +0000 (UTC) Date: Tue, 16 Jan 2024 14:51:19 +0100 From: Sabrina Dubroca To: Paolo Abeni Cc: Rahul Rameshbabu , netdev@vger.kernel.org, Gal Pressman , Eric Dumazet , Jakub Kicinski , Radu Pirea , "David S . Miller" Subject: Re: [PATCH net] Revert "net: macsec: use skb_ensure_writable_head_tail to expand the skb" Message-ID: References: <20240114174208.34330-2-rrameshbabu@nvidia.com> <9b1d136c156b33759a0323e988b73839d5920acc.camel@redhat.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <9b1d136c156b33759a0323e988b73839d5920acc.camel@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: queasysnail.net Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 2024-01-16, 11:39:35 +0100, Paolo Abeni wrote: > On Sun, 2024-01-14 at 09:42 -0800, Rahul Rameshbabu wrote: > > This reverts commit b34ab3527b9622ca4910df24ff5beed5aa66c6b5. > >=20 > > Using skb_ensure_writable_head_tail without a call to skb_unshare cause= s > > the MACsec stack to operate on the original skb rather than a copy in t= he > > macsec_encrypt path. This causes the buffer to be exceeded in space, an= d > > leads to warnings generated by skb_put operations.=C2=A0 >=20 > This part of the changelog is confusing to me. It looks like the skb > should be uncloned under the same conditions before and after this > patch (and/or the reverted)??! I don't think so. The old code was doing unshare + expand. skb_ensure_writable_head_tail calls pskb_expand_head without unshare, which doesn't give us a fresh sk_buff, only takes care of the headroom/tailroom. Or do I need more coffee? :/ > Possibly dev->needed_headroom/needed_tailroom values are incorrect?!? That's also possible following commit a73d8779d61a ("net: macsec: introduce mdo_insert_tx_tag"). Then this revert would only be hiding the issue. --=20 Sabrina