Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1448150

Re: [PATCH resend 3/5] libata-scsi: fix overflow in mode page copy

From Tejun Heo <tj@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH resend 3/5] libata-scsi: fix overflow in mode page copy
Date 2016-07-21 23:20 +0200
Message-ID <rXtxT-4A4-9@gated-at.bofh.it> (permalink)
References <rXrcJ-2T6-3@gated-at.bofh.it> <rXrcJ-2T6-7@gated-at.bofh.it> <rXrcJ-2T6-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello,

On Fri, Jul 22, 2016 at 02:41:52AM +0800, tom.ty89@gmail.com wrote:
> From: Tom Yan <tom.ty89@gmail.com>
> 
> ata_mselect_*() would initialize a char array for storing a copy of
> the current mode page. However, if char was actually signed char,
> overflow could occur.

Do you mean sign extension?

> For example, `0xff` from def_control_mpage[] would be "truncated"
> to `-1`. This prevented ata_mselect_control() from working at all,
> since when it did the read-only bits check, there would always be
> a mismatch.

Heh, the description doesn't really make sense.  Are you talking about
something like the following?

	char ar[N];
	int i;

	i = ar[x];
	if (i == 0xff)
		asdf;

If so, the description isn't quite right.

Thanks.

-- 
tejun

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH resend 2/5] libata-scsi: fix read-only bits checking in ata_mselect_*() tom.ty89@gmail.com - 2016-07-21 20:50 +0200
  [PATCH resend 3/5] libata-scsi: fix overflow in mode page copy tom.ty89@gmail.com - 2016-07-21 20:50 +0200
    [PATCH resend 4/5] libata-scsi: have all checks done before calling ata_mselect_*() tom.ty89@gmail.com - 2016-07-21 20:50 +0200
    Re: [PATCH resend 3/5] libata-scsi: fix overflow in mode page copy Tejun Heo <tj@kernel.org> - 2016-07-21 23:20 +0200
      Re: [PATCH resend 3/5] libata-scsi: fix overflow in mode page copy Tom Yan <tom.ty89@gmail.com> - 2016-07-21 23:40 +0200
        Re: [PATCH resend 3/5] libata-scsi: fix overflow in mode page copy Tejun Heo <tj@kernel.org> - 2016-07-21 23:50 +0200
          [PATCH resend v2 3/5] libata-scsi: use u8 array to store mode page copy tom.ty89@gmail.com - 2016-07-22 01:30 +0200
            Re: [PATCH resend v2 3/5] libata-scsi: use u8 array to store mode  page copy Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-07-22 12:00 +0200
              Re: [PATCH resend v2 3/5] libata-scsi: use u8 array to store mode  page copy Tom Yan <tom.ty89@gmail.com> - 2016-07-22 20:30 +0200
                [PATCH resend v3 3/5] libata-scsi: use u8 array to store mode page copy tom.ty89@gmail.com - 2016-07-22 20:40 +0200
          [PATCH resend v2 3/5] libata-scsi: use u8 array to store mode page copy tom.ty89@gmail.com - 2016-07-22 01:40 +0200
  Re: [PATCH resend 2/5] libata-scsi: fix read-only bits checking in ata_mselect_*() Tom Yan <tom.ty89@gmail.com> - 2016-07-22 01:30 +0200
    [PATCH resend v2 2/5] libata-scsi: fix read-only bits checking in ata_mselect_*() tom.ty89@gmail.com - 2016-07-22 01:30 +0200
    [PATCH resend v2 2/5] libata-scsi: fix read-only bits checking in ata_mselect_*() tom.ty89@gmail.com - 2016-07-22 01:40 +0200

csiph-web