[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <871qnpqieg.fsf@ubik.fi.intel.com>
Date: Fri, 20 Jan 2023 18:29:11 +0200
From: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: jasowang@...hat.com, virtualization@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org, elena.reshetova@...el.com,
kirill.shutemov@...ux.intel.com, Andi Kleen <ak@...ux.intel.com>,
Christian Schoenebeck <linux_oss@...debyte.com>,
Eric Van Hensbergen <ericvh@...il.com>,
Latchesar Ionkov <lucho@...kov.net>,
Dominique Martinet <asmadeus@...ewreck.org>,
v9fs-developer@...ts.sourceforge.net,
alexander.shishkin@...ux.intel.com
Subject: Re: [PATCH v1 3/6] virtio 9p: Fix an overflow
"Michael S. Tsirkin" <mst@...hat.com> writes:
> On Thu, Jan 19, 2023 at 03:57:18PM +0200, Alexander Shishkin wrote:
>> From: Andi Kleen <ak@...ux.intel.com>
>>
>> diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
>> index 3c27ffb781e3..a78e4d80e5ba 100644
>> --- a/net/9p/trans_virtio.c
>> +++ b/net/9p/trans_virtio.c
>> @@ -629,7 +629,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)
>> err = -EINVAL;
>> goto out_free_vq;
>> }
>> - tag = kzalloc(tag_len + 1, GFP_KERNEL);
>> + tag = kzalloc((u32)tag_len + 1, GFP_KERNEL);
>> if (!tag) {
>> err = -ENOMEM;
>> goto out_free_vq;
>
> Hmm are you sure there's a difference in behaviour? I thought C will just
> extend the integer to int.
Actually, you're right, integer promotion would extend the original
expression to int. I'll drop this patch also.
Thanks,
--
Alex
Powered by blists - more mailing lists