linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org,
	Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH][next] block: scsi_ioctl: Avoid the use of one-element arrays
Date: Fri, 2 Oct 2020 17:58:33 -0600	[thread overview]
Message-ID: <c06da705-3151-0902-066a-92d2e7c558bd@kernel.dk> (raw)
In-Reply-To: <20201003000338.GA13557@embeddedor>

On 10/2/20 6:03 PM, Gustavo A. R. Silva wrote:
> On Fri, Oct 02, 2020 at 05:53:05PM -0600, Jens Axboe wrote:
>> On 10/2/20 5:10 PM, Gustavo A. R. Silva wrote:
>>> diff --git a/include/uapi/linux/cdrom.h b/include/uapi/linux/cdrom.h
>>> index 2817230148fd..6c34f6e2f1f7 100644
>>> --- a/include/uapi/linux/cdrom.h
>>> +++ b/include/uapi/linux/cdrom.h
>>> @@ -289,7 +289,10 @@ struct cdrom_generic_command
>>>  	unsigned char		data_direction;
>>>  	int			quiet;
>>>  	int			timeout;
>>> -	void			__user *reserved[1];	/* unused, actually */
>>> +	union {
>>> +		void		__user *reserved[1];	/* unused, actually */
>>> +		void            __user *unused;
>>> +	};
>>
>> What's the point of this union, why not just turn it into
>>
>> 	void *			__user *unused;
>>
>> ?
> 
> I just don't want to take any chances of breaking any user-space
> application that, for some reason, may be considering that field.

I guess that's a valid concern, who knows what applications are doing
to an ignored field.

I'll apply it, thanks.

-- 
Jens Axboe


  reply	other threads:[~2020-10-02 23:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 23:10 [PATCH][next] block: scsi_ioctl: Avoid the use of one-element arrays Gustavo A. R. Silva
2020-10-02 23:53 ` Jens Axboe
2020-10-03  0:03   ` Gustavo A. R. Silva
2020-10-02 23:58     ` Jens Axboe [this message]
2020-10-03  0:07       ` Gustavo A. R. Silva
2020-10-05  7:25 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c06da705-3151-0902-066a-92d2e7c558bd@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=gustavoars@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).